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
99f7667a
Commit
99f7667a
authored
Feb 18, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Javascript scoping issues and missing return statement in vote.
parent
c3d895c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
poll/poll.py
+1
-0
poll/public/js/poll.js
+4
-2
No files found.
poll/poll.py
View file @
99f7667a
...
...
@@ -385,6 +385,7 @@ class PollBlock(PollBase):
if
not
self
.
can_vote
():
result
[
'errors'
]
.
append
(
'You have already voted as many times as you are allowed.'
)
return
result
self
.
clean_tally
()
if
old_choice
is
not
None
:
...
...
poll/public/js/poll.js
View file @
99f7667a
...
...
@@ -16,7 +16,9 @@ function PollUtil (runtime, element, pollType) {
self
.
getResults
({
'success'
:
true
});
return
false
;
}
if
(
parseInt
(
$
(
'.poll-max-submissions'
).
text
())
>
1
&&
parseInt
(
$
(
'.poll-current-count'
).
text
())
>
0
)
{
var
max_submissions
=
parseInt
(
$
(
'.poll-max-submissions'
,
element
).
text
());
var
current_count
=
parseInt
(
$
(
'.poll-current-count'
,
element
).
text
());
if
(
max_submissions
>
1
&&
current_count
>
0
)
{
$
(
'.poll-submissions-count'
,
element
).
show
();
}
return
true
;
...
...
@@ -117,7 +119,7 @@ function PollUtil (runtime, element, pollType) {
var
can_vote
=
data
[
'can_vote'
];
$
(
'.poll-current-count'
,
element
).
text
(
data
[
'submissions_count'
]);
if
(
data
[
'max_submissions'
]
>
1
)
{
$
(
'.poll-submissions-count'
).
show
();
$
(
'.poll-submissions-count'
,
element
).
show
();
}
if
(
$
(
'div.poll-block'
,
element
).
data
(
'private'
))
{
// User may be changing their vote. Give visual feedback that it was accepted.
...
...
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