Poll.evalPoll (question, choices, creator) |
check if poll is ok. if true, save modified poll
|
Sourcecode in Poll/objectFunctions.js:
1: function evalPoll(question, choices, creator) { 2: if (!question || !choices || choices.length < 2) 3: throw new Exception("pollMissingValues"); 4: this.question = question; 5: this.modifytime = new Date(); 6: for (var i=this.size(); i>0; i--) 7: this.get(i-1).remove(); 8: for (var i=0;i<choices.length;i++) 9: this.add(choices[i]); 10: return new Message("pollCreate"); 11: } |