Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-poll
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
xblock-poll
Commits
2edb24a8
Commit
2edb24a8
authored
Feb 16, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressed review notes.
parent
5c01fe94
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
poll/public/html/poll_edit.html
+2
-3
poll/public/js/poll.js
+10
-1
tests/integration/test_max_submissions.py
+0
-2
No files found.
poll/public/html/poll_edit.html
View file @
2edb24a8
...
...
@@ -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"
>
...
...
poll/public/js/poll.js
View file @
2edb24a8
...
...
@@ -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
({
...
...
tests/integration/test_max_submissions.py
View file @
2edb24a8
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment