Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
c61aedc1
Commit
c61aedc1
authored
Feb 06, 2013
by
Valera Rozuvan
Committed by
Alexander Kryklia
Feb 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix. Now can add more than one Poll to a vertical.
parent
58365ec9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
common/lib/xmodule/xmodule/js/src/poll/poll_main.js
+15
-3
No files found.
common/lib/xmodule/xmodule/js/src/poll/poll_main.js
View file @
c61aedc1
...
...
@@ -152,14 +152,14 @@ function PollMain(el) {
this
.
questionEl
=
$
(
el
).
find
(
'.poll_question'
);
if
(
this
.
questionEl
.
length
!==
1
)
{
// We require one question DOM element.
logme
(
'ERROR: PollMain constructor '
);
logme
(
'ERROR: PollMain constructor
requires one question DOM element.
'
);
return
;
}
// Just a safety precussion. If we run this code more than once, multiple 'click' callback handlers will be
// attached to the same DOM elements. We don't want this to happen.
if
(
this
.
vertMod
El
.
attr
(
'poll_main_processed'
)
===
'true'
)
{
if
(
this
.
question
El
.
attr
(
'poll_main_processed'
)
===
'true'
)
{
logme
(
'ERROR: PolMain JS constructor was called on a DOM element that has already been processed once.'
);
...
...
@@ -169,7 +169,7 @@ function PollMain(el) {
// This element was not processed earlier.
// Make sure that next time we will not process this element a second time.
this
.
vertMod
El
.
attr
(
'poll_main_processed'
,
'true'
);
this
.
question
El
.
attr
(
'poll_main_processed'
,
'true'
);
// Access this object inside inner functions.
_this
=
this
;
...
...
@@ -241,6 +241,18 @@ function PollMain(el) {
}
}
if
(
(
this
.
jsonConfig
.
poll_answer
.
length
>
0
)
&&
(
this
.
jsonConfig
.
answers
.
hasOwnProperty
(
this
.
jsonConfig
.
poll_answer
)
===
false
)
)
{
this
.
questionEl
.
append
(
'<h3>Error!</h3>'
+
'<p>XML data format changed. List of answers was modified, but poll data was not updated.</p>'
);
return
;
}
// Get the DOM id of the question.
this
.
id
=
this
.
questionEl
.
attr
(
'id'
);
...
...
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