- result.plurality_winners=session.controller.plurality_result.winners.inspect
- result.approval_winners=session.controller.approval_result.winners.inspect
- result.condorcet_winners=session.controller.condorcet_result.winners.inspect
- result.ssd_winners=session.controller.ssd_result.winners.inspect
- result.borda_winners=session.controller.borda_result.winners.inspect
+ result.errors=[]
+ unless qv
+ result.errors << "No quickvote with name #{shortname} found!"
+ return result
+ end
+ qv.results
+ result.plurality_winners=qv.plurality_result.winners
+ result.approval_winners=qv.approval_result.winners
+ result.condorcet_winners=qv.condorcet_result.winners
+ result.ssd_winners=qv.ssd_result.winners
+ result.borda_winners=qv.borda_result.winners
+ result
+ end
+ def get_quickvote_candidate_map(shortname)
+ qv=QuickVote.ident_to_quickvote(shortname)
+ result=CandidateMap.new
+ result.errors=[]
+ unless qv
+ result.errors << "No quickvote with name #{shortname} found!"
+ return result
+ end
+ candidates={}
+ qv.candidates.each {|c| candidates[c.id] = c.name}
+ result.candidate_ids=candidates.keys
+ result.candidate_names=candidates.values