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
1fd2f0c6
Commit
1fd2f0c6
authored
Aug 29, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix double show answer bug
parent
a29991e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+18
-9
No files found.
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
1fd2f0c6
...
...
@@ -192,8 +192,11 @@ class @Problem
if
file_not_selected
errors
.
push
'You did not select any files to submit'
if
errors
.
length
>
0
alert
errors
.
join
(
"
\n
"
)
error_html
=
'<ul>
\n
'
for
error
in
errors
error_html
+=
'<li>'
+
error
+
'</li>
\n
'
error_html
+=
'</ul>'
@
gentle_alert
error_html
abort_submission
=
file_too_large
or
file_not_selected
or
unallowed_file_submitted
or
required_files_not_submitted
...
...
@@ -208,7 +211,7 @@ class @Problem
@
render
(
response
.
contents
)
@
updateProgress
response
else
alert
(
response
.
success
)
@
gentle_alert
response
.
success
if
not
abort_submission
$
.
ajaxWithPrefix
(
"
#{
@
url
}
/problem_check"
,
settings
)
...
...
@@ -220,8 +223,10 @@ class @Problem
when
'incorrect'
,
'correct'
@
render
(
response
.
contents
)
@
updateProgress
response
if
@
el
.
hasClass
'showed'
@
el
.
removeClass
'showed'
else
alert
(
response
.
success
)
@
gentle_alert
response
.
success
reset
:
=>
Logger
.
log
'problem_reset'
,
@
answers
...
...
@@ -253,15 +258,19 @@ class @Problem
@
el
.
removeClass
'showed'
@
$
(
'.show'
).
val
'Show Answer'
gentle_alert
:
(
msg
)
=>
if
@
el
.
find
(
'.capa_alert'
).
length
@
el
.
find
(
'.capa_alert'
).
remove
()
alert_elem
=
"<div class='capa_alert'>"
+
msg
+
"</div>"
@
el
.
find
(
'.action'
).
after
(
alert_elem
)
@
el
.
find
(
'.capa_alert'
).
animate
(
opacity
:
0
,
500
).
animate
(
opacity
:
1
,
500
)
save
:
=>
Logger
.
log
'problem_save'
,
@
answers
$
.
postWithPrefix
"
#{
@
url
}
/problem_save"
,
@
answers
,
(
response
)
=>
if
response
.
success
if
@
el
.
find
(
'.save_message'
).
length
@
el
.
find
(
'.save_message'
).
animate
(
opacity
:
0
,
500
).
animate
(
opacity
:
1
,
500
)
else
saveMessage
=
"<div class='save_message'>Your answers have been saved but not graded. Hit 'Check' to grade them.</div>"
@
el
.
find
(
'.action'
).
after
(
saveMessage
)
saveMessage
=
"Your answers have been saved but not graded. Hit 'Check' to grade them."
@
gentle_alert
saveMessage
@
updateProgress
response
refreshMath
:
(
event
,
element
)
=>
...
...
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