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
0b99e802
Commit
0b99e802
authored
Feb 19, 2015
by
Matjaz Gregoric
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9 from mckinseyacademy/cleanup
Addressed remaining issues from second review
parents
1a94e3ef
99f7667a
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 @
0b99e802
...
@@ -385,6 +385,7 @@ class PollBlock(PollBase):
...
@@ -385,6 +385,7 @@ class PollBlock(PollBase):
if
not
self
.
can_vote
():
if
not
self
.
can_vote
():
result
[
'errors'
]
.
append
(
'You have already voted as many times as you are allowed.'
)
result
[
'errors'
]
.
append
(
'You have already voted as many times as you are allowed.'
)
return
result
self
.
clean_tally
()
self
.
clean_tally
()
if
old_choice
is
not
None
:
if
old_choice
is
not
None
:
...
...
poll/public/js/poll.js
View file @
0b99e802
...
@@ -16,7 +16,9 @@ function PollUtil (runtime, element, pollType) {
...
@@ -16,7 +16,9 @@ function PollUtil (runtime, element, pollType) {
self
.
getResults
({
'success'
:
true
});
self
.
getResults
({
'success'
:
true
});
return
false
;
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
();
$
(
'.poll-submissions-count'
,
element
).
show
();
}
}
return
true
;
return
true
;
...
@@ -117,7 +119,7 @@ function PollUtil (runtime, element, pollType) {
...
@@ -117,7 +119,7 @@ function PollUtil (runtime, element, pollType) {
var
can_vote
=
data
[
'can_vote'
];
var
can_vote
=
data
[
'can_vote'
];
$
(
'.poll-current-count'
,
element
).
text
(
data
[
'submissions_count'
]);
$
(
'.poll-current-count'
,
element
).
text
(
data
[
'submissions_count'
]);
if
(
data
[
'max_submissions'
]
>
1
)
{
if
(
data
[
'max_submissions'
]
>
1
)
{
$
(
'.poll-submissions-count'
).
show
();
$
(
'.poll-submissions-count'
,
element
).
show
();
}
}
if
(
$
(
'div.poll-block'
,
element
).
data
(
'private'
))
{
if
(
$
(
'div.poll-block'
,
element
).
data
(
'private'
))
{
// User may be changing their vote. Give visual feedback that it was accepted.
// 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