mirror of
https://github.com/ArenMg/aren.git
synced 2024-11-16 05:30:51 +00:00
Regler problème même vote sur vote majoritaire
This commit is contained in:
parent
bcd6cfbd1f
commit
6a7ed064c4
1 changed files with 5 additions and 13 deletions
|
@ -106,7 +106,7 @@ public class VMThemeRESTFacade extends AbstractRESTFacade<VMTheme>{
|
|||
choicesNotVoted.add(choice) ;
|
||||
}
|
||||
}
|
||||
VMChoice newChoices[]=new VMChoice[choices.length] ;
|
||||
HashSet<VMChoice> newChoices = new HashSet<>();
|
||||
if(!proposalTallyInterfaces.isEmpty()){
|
||||
ProposalTallyInterface []proposalTallyInterfacesArray=new ProposalTallyInterface[proposalTallyInterfaces.size()] ;
|
||||
for(int i=0 ; i<proposalTallyInterfaces.size() ; i++){
|
||||
|
@ -121,24 +121,16 @@ public class VMThemeRESTFacade extends AbstractRESTFacade<VMTheme>{
|
|||
for(ProposalResultInterface item : result.getProposalResults()){
|
||||
VMChoice vmChoice=(VMChoice) choices[index] ;
|
||||
vmChoice.setRank(item.getRank());
|
||||
newChoices[item.getRank()-1]=vmChoice ;
|
||||
System.out.println(item.getRank()+" - "+newChoices[item.getRank()-1].getTitle());
|
||||
newChoices.add(vmChoice) ;
|
||||
index++ ;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0 ; i<choicesNotVoted.size() ; i++){
|
||||
VMChoice vmChoice=choicesNotVoted.get(i) ;
|
||||
vmChoice.setRank(newChoices.length-i);
|
||||
newChoices[newChoices.length-(i+1)]= vmChoice ;
|
||||
vmChoice.setRank(newChoices.size()-i);
|
||||
newChoices.add(vmChoice) ;
|
||||
}
|
||||
HashSet<VMChoice> setChoices = new HashSet<>();
|
||||
System.out.println("Rang : ") ;
|
||||
for(int i=0 ; i<newChoices.length ; i++){
|
||||
System.out.println(i+" - "+newChoices[i].getTitle());
|
||||
setChoices.add(newChoices[i]) ;
|
||||
}
|
||||
|
||||
theme.setChoices(setChoices);
|
||||
theme.setChoices(newChoices);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue