diff --git a/avUi/percent-votes-service.js b/avUi/percent-votes-service.js index c9c80b3f..db4fbea8 100644 --- a/avUi/percent-votes-service.js +++ b/avUi/percent-votes-service.js @@ -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); }; diff --git a/dist/appCommon-v17.04.js b/dist/appCommon-v17.04.js index 08b99434..62689d56 100644 --- a/dist/appCommon-v17.04.js +++ b/dist/appCommon-v17.04.js @@ -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) {