PollMgr.evalNewPoll (question, choices, creator) |
check if poll is ok. if true, save new Poll
|
Sourcecode in PollMgr/objectFunctions.js:
1: function evalNewPoll(question, choices, creator) { 2: if (!question || !choices || choices.length < 2) 3: throw new Exception("pollMissing"); 4: var newPoll = new Poll(question, creator); 5: this.add(newPoll); 6: for (var i=0; i<choices.length; i++) 7: newPoll.add(choices[i]); 8: return new Message("pollCreate"); 9: } |