Poll.evalPoll (question, choices, creator)
check if poll is ok. if true, save modified poll

  • Parameter Object:
    the req.data object coming in from the action
  • Parameter Object:
    the user as creator of the poll modifications
  • Returns
    Object containing the properties - error (boolean): true if error occured, false otherwise - message (String): an error or a confirmation message - url (String): the URL string of the poll - id (Number): the internal Hop ID of the 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:  }