Skip to content

Commit 1ddee03

Browse files
author
Keegan Jorgensen
committed
Added a quick fix for the average and STD display.
1 parent ecbfd14 commit 1ddee03

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/js/controllers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ function RoomCtrl($scope, $routeParams, $timeout, socket) {
127127

128128

129129
var total = _.reduce(_.map(_.pluck($scope.votes, 'vote'), parseFloat), sumOfTwo, 0);
130-
$scope.votingAverage = Math.round(total / $scope.votes.length);
131-
$scope.votingStandardDeviation = standardDeviation(_.pluck($scope.votes, 'vote'), parseFloat);
130+
$scope.votingAverage = Math.round(total / $scope.votes.length) || 0;
131+
$scope.votingStandardDeviation = standardDeviation(_.pluck($scope.votes, 'vote'), parseFloat) || 0;
132132

133133
$scope.forceRevealDisable = (!$scope.forcedReveal && ($scope.votes.length < $scope.voterCount || $scope.voterCount === 0)) ? false : true;
134134

app/partials/room.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@
7373
&nbsp;
7474
</div>
7575

76-
<div class="voting-average">Average: <b>{{votingAverage}} (SD = {{votingStandardDeviation}})</b></div>
76+
<div ng-show="votingState">
77+
<div class="voting-average">Average: <b>{{votingAverage}} (SD = {{votingStandardDeviation}})</b></div>
78+
</div>
7779
</div>
7880

7981
<div ng-switch on="showAdmin" >

0 commit comments

Comments
 (0)