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
68fb5c97
Commit
68fb5c97
authored
Nov 12, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfixes re: button state
parent
4922ab33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
+18
-13
No files found.
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
View file @
68fb5c97
...
...
@@ -4,7 +4,7 @@ class @SelfAssessment
@
id
=
@
el
.
data
(
'id'
)
@
ajax_url
=
@
el
.
data
(
'ajax-url'
)
@
state
=
@
el
.
data
(
'state'
)
allow_reset
=
@
el
.
data
(
'allow_reset'
)
@
allow_reset
=
@
el
.
data
(
'allow_reset'
)
# valid states: 'initial', 'assessing', 'request_hint', 'done'
# Where to put the rubric once we load it
...
...
@@ -14,17 +14,13 @@ class @SelfAssessment
@
rubric_wrapper
=
@
$
(
'.rubric-wrapper'
)
@
hint_wrapper
=
@
$
(
'.hint-wrapper'
)
@
message_wrapper
=
@
$
(
'.message-wrapper'
)
@
check
_button
=
@
$
(
'.submit-button'
)
@
submit
_button
=
@
$
(
'.submit-button'
)
@
reset_button
=
@
$
(
'.reset-button'
)
@
reset_button
.
click
@
reset
@
find_assessment_elements
()
@
find_hint_elements
()
if
allow_reset
@
reset_button
.
show
()
else
@
reset_button
.
hide
()
@
rebind
()
...
...
@@ -34,15 +30,25 @@ class @SelfAssessment
rebind
:
()
=>
# rebind to the appropriate function for the current state
@
check_button
.
unbind
(
'click'
)
@
submit_button
.
unbind
(
'click'
)
@
submit_button
.
show
()
@
reset_button
.
hide
()
if
@
state
==
'initial'
@
check_button
.
click
@
save_answer
@
submit_button
.
prop
(
'value'
,
'Submit'
)
@
submit_button
.
click
@
save_answer
else
if
@
state
==
'assessing'
@
check_button
.
click
@
save_assessment
@
submit_button
.
prop
(
'value'
,
'Submit assessment'
)
@
submit_button
.
click
@
save_assessment
else
if
@
state
==
'request_hint'
@
check_button
.
click
@
save_hint
@
submit_button
.
prop
(
'value'
,
'Submit hint'
)
@
submit_button
.
click
@
save_hint
else
if
@
state
==
'done'
@
check_button
.
hide
()
@
submit_button
.
hide
()
if
@
allow_reset
@
reset_button
.
show
()
else
@
reset_button
.
hide
()
find_assessment_elements
:
->
@
assessment
=
@
$
(
'select.assessment'
)
...
...
@@ -90,9 +96,8 @@ class @SelfAssessment
if
response
.
success
@
message_wrapper
.
html
(
response
.
message_html
)
@
state
=
'done'
@
allow_reset
=
response
.
allow_reset
@
rebind
()
if
response
.
allow_reset
@
reset_button
.
show
()
else
@
errors_area
.
html
(
response
.
message
)
else
...
...
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