+ ## methods for computing and printing results
+ ####################################################################
+ def results
+ @election = Election.find( params[:id] )
+ votes = []
+
+ @election.voters.each do |voter|
+ if voter.vote and voter.vote.confirmed?
+ votes << voter.vote.rankings.sort.collect {|vote| vote.candidate_id}
+ end
+ end
+
+ @voteobj = CloneproofSSDVote.new(votes)
+ @resultobj = @voteobj.result
+ @winners = @resultobj.winners
+
+ @candidates_by_id = {}
+ @election.candidates.each {|cand| @candidates_by_id[cand.id] = cand}