/** * check if poll is ok. if true, save modified poll * @param Object the req.data object coming in from the action * @param Object the user as creator of the poll modifications * @return 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 */ function evalPoll(param, creator) { var result; var choiceInput = param.choice; if (param.choice_array) { var choiceCnt = 0; for (var i in param.choice_array) { if (param.choice_array[i]) choiceCnt++; } } if (param.question && choiceCnt > 1) { this.question = param.question; this.modifytime = new Date(); for (var i=this.size(); i>0; i--) { var ch = this.get(i-1); this.remove(ch); } for (var i=0; i