Index: lams_learning/web/includes/javascript/kumalive.js =================================================================== diff -u -recd3b320baed53ab184cc7c5d1a67def50651fe2 -redcf26c6dbd1e4ff36858d876e908774abb7910d --- lams_learning/web/includes/javascript/kumalive.js (.../kumalive.js) (revision ecd3b320baed53ab184cc7c5d1a67def50651fe2) +++ lams_learning/web/includes/javascript/kumalive.js (.../kumalive.js) (revision edcf26c6dbd1e4ff36858d876e908774abb7910d) @@ -633,12 +633,13 @@ // validation if (question) { $('#pollSetupQuestionGroup').removeClass('has-error'); - poll.question = question; + poll.name = question; } else { $('#pollSetupQuestionGroup').addClass('has-error'); } - if ($('#pollSetupAnswer option:selected').val() === 'custom'){ + var selectedOption = $('#pollSetupAnswer option:selected'); + if (selectedOption.val() === 'custom'){ $('#pollSetupAnswerCustomParseError').hide(); var answerString = $('#pollSetupAnswerCustom').val(); // check if brackets are closed and there is nothing between them, for example "{aaa} {bb" or "{aaa} bb {ccc}" @@ -685,12 +686,18 @@ } else { $('#pollSetupAnswerCustomGroup').addClass('has-error'); } + } else { + var answers = []; + $.each(selectedOption.text().split(','), function() { + answers.push(this.trim()); + }); + poll.answers = answers; } - if (!poll.question || !poll.answers) { + if (!poll.name || !poll.answers) { return; } - + kumaliveWebsocket.send(JSON.stringify({ 'type' : 'startPoll', 'poll' : poll