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
59af66c6
Commit
59af66c6
authored
Nov 03, 2015
by
Adam
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10488 from edx/adam/disable-check-button-on-save-click
Adam/disable check button on save click
parents
79c2501c
bc6caea6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee
+13
-0
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+2
-0
No files found.
common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee
View file @
59af66c6
...
...
@@ -538,6 +538,19 @@ describe 'Problem', ->
runs
->
expect
(
window
.
SR
.
readElts
).
toHaveBeenCalled
()
it
'disables check button while posting'
,
->
runs
->
spyOn
(
$
,
'postWithPrefix'
).
andCallFake
(
url
,
answers
,
callback
)
->
callback
(
success
:
'OK'
)
spyOn
@
problem
,
'enableCheckButton'
@
problem
.
save
()
expect
(
@
problem
.
enableCheckButton
).
toHaveBeenCalledWith
false
waitsFor
(
->
return
jQuery
.
active
==
0
),
"jQuery requests finished"
,
1000
runs
->
expect
(
@
problem
.
enableCheckButton
).
toHaveBeenCalledWith
true
describe
'refreshMath'
,
->
beforeEach
->
@
problem
=
new
Problem
(
$
(
'.xblock-student_view'
))
...
...
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
59af66c6
...
...
@@ -412,11 +412,13 @@ class @Problem
@
save_internal
()
save_internal
:
=>
@
enableCheckButton
false
Logger
.
log
'problem_save'
,
@
answers
$
.
postWithPrefix
"
#{
@
url
}
/problem_save"
,
@
answers
,
(
response
)
=>
saveMessage
=
response
.
msg
@
gentle_alert
saveMessage
@
updateProgress
response
@
enableCheckButton
true
refreshMath
:
(
event
,
element
)
=>
element
=
event
.
target
unless
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