Author: tchemit Date: 2012-09-23 21:07:20 +0200 (Sun, 23 Sep 2012) New Revision: 3706 Url: http://chorem.org/repositories/revision/pollen/3706 Log: fix group voter choices Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java Modified: trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java =================================================================== --- trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java 2012-09-23 14:37:50 UTC (rev 3705) +++ trunk/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/model/GroupOfVoter.java 2012-09-23 19:07:20 UTC (rev 3706) @@ -106,11 +106,13 @@ public void setResult(VoteCountingResult result) { this.result = result; + Set<ChoiceScore> winners = result.getTopRanking(); for (ChoiceScore choiceScore : result.getScores()) { + + double score = winners.contains(choiceScore) ? 1d : 0d; VoteForChoice voteForChoice = VoteForChoice.newVote( choiceScore.getChoiceId(), - //FIXME-tchemit-2012-06-26 Which is the value to set as choice for each result? - choiceScore.getScoreValue().doubleValue()); + score); addVoteForChoice(voteForChoice); } }