Skip to content

Commit

Permalink
Merge pull request #36 from agoravoting/desborda2
Browse files Browse the repository at this point in the history
for borda type, question percentage over points
  • Loading branch information
Findeton authored May 17, 2017
2 parents 7a8840d + 3d9e20e commit 5b58ab2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion avUi/percent-votes-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ angular.module('avUi')
if (over === undefined || over === null) {
over = question.answer_total_votes_percentage;
}
if (over === "over-valid-votes") {
if ("over-valid-votes" === over || "over-total-valid-votes" === over) {
base = question.totals.valid_votes;
}
else if ("over-total-valid-points" === over &&
undefined !== question.totals.valid_points) {
base = question.totals.valid_points;
}

return print(100*total_votes / base);
};
Expand Down
3 changes: 2 additions & 1 deletion dist/appCommon-v17.04.js
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,8 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
if (void 0 === format && (format = "str"), 0 === total_votes) return print(0);
var base = question.totals.valid_votes + question.totals.null_votes + question.totals.blank_votes;
return void 0 !== over && null !== over || (over = question.answer_total_votes_percentage),
"over-valid-votes" === over && (base = question.totals.valid_votes), print(100 * total_votes / base);
"over-valid-votes" === over || "over-total-valid-votes" === over ? base = question.totals.valid_votes : "over-total-valid-points" === over && void 0 !== question.totals.valid_points && (base = question.totals.valid_points),
print(100 * total_votes / base);
};
}), angular.module("avUi").service("CheckerService", function() {
function checker(d) {
Expand Down

0 comments on commit 5b58ab2

Please sign in to comment.