diff --git a/play/img/ballot_range.png b/play/img/ballot_range.png index 4dae4f60..2a78fb8e 100644 Binary files a/play/img/ballot_range.png and b/play/img/ballot_range.png differ diff --git a/play/img/ballot_range3.png b/play/img/ballot_range3.png index d8d4d835..92232c7a 100644 Binary files a/play/img/ballot_range3.png and b/play/img/ballot_range3.png differ diff --git a/play/img/ballot_rate.png b/play/img/ballot_rate.png index 27296bed..8e94c9e1 100644 Binary files a/play/img/ballot_rate.png and b/play/img/ballot_rate.png differ diff --git a/play/img/ballot_three.png b/play/img/ballot_three.png index eda538fc..bf180fe5 100644 Binary files a/play/img/ballot_three.png and b/play/img/ballot_three.png differ diff --git a/play/js/Ballot.js b/play/js/Ballot.js index 132c9ac3..a68f8600 100644 --- a/play/js/Ballot.js +++ b/play/js/Ballot.js @@ -24,7 +24,7 @@ function ScoreBallot(config){ self.update = function(ballot){ for(var cID in ballot){ var score = ballot[cID]; - self.boxes[cID].gotoFrame(score-1); + self.boxes[cID].gotoFrame(score); } }; @@ -48,7 +48,7 @@ function ThreeBallot(config){ self.update = function(ballot){ for(var cID in ballot){ var score = ballot[cID]; - self.boxes[cID].gotoFrame(score-1+1); + self.boxes[cID].gotoFrame(score); } }; diff --git a/play/js/Voters.js b/play/js/Voters.js index 8d1ce40a..d2d9f009 100644 --- a/play/js/Voters.js +++ b/play/js/Voters.js @@ -201,18 +201,23 @@ function dostrategy(x,y,minscore,maxscore,rangescore,strategy,lastwinner,frontru } else if (strategy == "normalize frontrunners only" || strategy == "starnormfrontrunners") { var fnorm = 1/ (maxfront-minfront); var normit = function(d) {return (d-minfront)*fnorm;} - if (strategy == "starnormfrontrunners") maxscore--; var gs = function(d) { return minscore+Math.round((maxscore-minscore)*(1-normit(d))); } var thresholdit = function(d) {return (d<=minfront) ? maxscore : (d>=maxfront) ? minscore : gs(d)} radiusFirst = minfront; - radiusLast = maxfront; - } + radiusLast = maxfront; + } } var scores2 = dista.map(thresholdit); var assignit = function(d,i) { scores[ candidates[i].id ] = d; } scores2.map(assignit) - if (strategy == "starnormfrontrunners") maxscore++; scores[mini] = maxscore; + if (strategy == "starnormfrontrunners") { + for(i in candidates){ + var c = candidates[i].id + if (scores[c]==maxscore && c!=mini) { + scores[c]=maxscore-1; + }}} + }// otherwise, there is no strategy strategy == "no strategy. judge on an absolute scale." @@ -230,7 +235,10 @@ function ScoreVoter(model){ var self = this; self.model = model; - + var maxscore = 5; + var minscore = 0; + var scorearray = []; + for (var i=minscore; i<= maxscore; i++) scorearray.push(i) self.radiusStep = window.HACK_BIG_RANGE ? 61 : 25; // step: x<25, 25