Commit 2edb24a8 by Jonathan Piacenti

Addressed review notes.

parent 5c01fe94
......@@ -49,9 +49,8 @@
<input id="poll-max-submissions" type="number" min="0" step="1" value="{{ max_submissions }}"/>
</div>
<span class="tip setting-help">
Maximum number of times a user may submit a poll. **Setting this to a value other than 1 will imply that
'Private Results' should be true.** Setting it to 0 will allow infinite submissions.
resubmissions.
Maximum number of times a user may submit a poll. <strong>Setting this to a value other than 1 will imply that
'Private Results' should be true.</strong> Setting it to 0 will allow infinite resubmissions.
</span>
</li>
<li class="field comp-setting-entry is-set">
......
......@@ -29,6 +29,9 @@ function PollUtil (runtime, element, pollType) {
// studio.
radio = $(selector, element);
var choice = radio.val();
var thanks = $('.poll-voting-thanks', element);
thanks.addClass('poll-hidden');
thanks.removeAttr('style');
$.ajax({
type: "POST",
url: self.voteUrl,
......@@ -45,13 +48,19 @@ function PollUtil (runtime, element, pollType) {
var answers = $('input[type=radio]', element);
if (! radio.val()) {
answers.bind("change.enableSubmit", self.enableSubmit);
} else {
} else if ($('div.poll-block', element).data('can-vote')) {
self.enableSubmit();
}
};
this.surveyInit = function () {
// Initialization function for Survey Blocks
// If the user is unable to vote, disable input.
if (! $('div.poll-block', element).data('can-vote')) {
$('input', element).attr('disabled', true);
return
}
self.answers.bind("change.enableSubmit", self.verifyAll);
self.submit.click(function () {
$.ajax({
......
......@@ -55,8 +55,6 @@ class TestPrivateResults(PollBaseTest):
def submission_run(self, names):
self.do_submit(names)
self.browser.execute_script("$('.poll-voting-thanks').stop().addClass('poll-hidden').removeAttr('style')")
self.wait_until_hidden(self.browser.find_element_by_css_selector('.poll-voting-thanks'))
@unpack
@data(*scenarios_max)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment