Index: lams_learning/web/includes/javascript/kumalive.js =================================================================== diff -u -rd96eaa6be28787c68f898a2455efc1b957f5447d -r88f3c4e68acd7c0ad6bcab7c6a3f36197d009468 --- lams_learning/web/includes/javascript/kumalive.js (.../kumalive.js) (revision d96eaa6be28787c68f898a2455efc1b957f5447d) +++ lams_learning/web/includes/javascript/kumalive.js (.../kumalive.js) (revision 88f3c4e68acd7c0ad6bcab7c6a3f36197d009468) @@ -165,10 +165,19 @@ roleTeacher = message.isTeacher && message.roleTeacher; // hide all buttons and enable ones appropriate for the role - $('#mainDiv button').hide(); + $('#actionCell button').hide(); if (roleTeacher) { $('#raiseHandPromptButton').click(raiseHandPrompt); $('#downHandPromptButton').click(downHandPrompt); + $('#pollButton').click(pollSetup).show(); + $('#pollSetupAnswer').change(function(){ + if ($('#pollSetupAnswer option:selected').val() === 'custom') { + $('#pollSetupAnswerCustom').show(); + } else { + $('#pollSetupAnswerCustom').hide(); + } + }); + $('#pollSetupCancelButton').click(pollSetupCancel); $('#score i').click(score); $('#finishButton').click(finish).show(); } else { @@ -290,7 +299,6 @@ } learnerFadeIn(learnerDiv); }); - // remove learners who left $('.learner', learnersContainer).each(function(){ var learnerDiv = $(this), @@ -601,7 +609,18 @@ } } +function pollSetup() { + $('#pollButton').prop('disabled', true); + $('#pollCell').show(); +} +function pollSetupCancel() { + $('#pollCell').hide(); + $('#pollCell input').val(null); + $('#pollCell select option:first-child').prop('selected', true); + $('#pollButton').prop('disabled', false); +} + /** * Create a new Kumalive */