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
f54d4241
Commit
f54d4241
authored
Nov 12, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1038 from MITx/vik/add_self_assessment
Vik/add self assessment
parents
b378af87
3f95116a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
53 deletions
+117
-53
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
+20
-8
common/lib/xmodule/xmodule/self_assessment_module.py
+90
-43
lms/static/sass/course/courseware/_courseware.scss
+4
-0
lms/templates/self_assessment_rubric.html
+3
-2
No files found.
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
View file @
f54d4241
...
...
@@ -21,7 +21,6 @@ class @SelfAssessment
@
find_assessment_elements
()
@
find_hint_elements
()
@
rebind
()
# locally scoped jquery.
...
...
@@ -33,16 +32,22 @@ class @SelfAssessment
@
submit_button
.
unbind
(
'click'
)
@
submit_button
.
show
()
@
reset_button
.
hide
()
@
hint_area
.
attr
(
'disabled'
,
false
)
if
@
state
==
'initial'
@
answer_area
.
attr
(
"disabled"
,
false
)
@
submit_button
.
prop
(
'value'
,
'Submit'
)
@
submit_button
.
click
@
save_answer
else
if
@
state
==
'assessing'
@
answer_area
.
attr
(
"disabled"
,
true
)
@
submit_button
.
prop
(
'value'
,
'Submit assessment'
)
@
submit_button
.
click
@
save_assessment
else
if
@
state
==
'request_hint'
@
answer_area
.
attr
(
"disabled"
,
true
)
@
submit_button
.
prop
(
'value'
,
'Submit hint'
)
@
submit_button
.
click
@
save_hint
else
if
@
state
==
'done'
@
answer_area
.
attr
(
"disabled"
,
true
)
@
hint_area
.
attr
(
'disabled'
,
true
)
@
submit_button
.
hide
()
if
@
allow_reset
@
reset_button
.
show
()
...
...
@@ -67,7 +72,7 @@ class @SelfAssessment
@
find_assessment_elements
()
@
rebind
()
else
@
errors_area
.
html
(
response
.
message
)
@
errors_area
.
html
(
response
.
error
)
else
@
errors_area
.
html
(
'Problem state got out of sync. Try reloading the page.'
)
...
...
@@ -77,12 +82,18 @@ class @SelfAssessment
data
=
{
'assessment'
:
@
assessment
.
find
(
':selected'
).
text
()}
$
.
postWithPrefix
"
#{
@
ajax_url
}
/save_assessment"
,
data
,
(
response
)
=>
if
response
.
success
@
hint_wrapper
.
html
(
response
.
hint_html
)
@
state
=
'request_hint'
@
find_hint_elements
()
@
state
=
response
.
state
if
@
state
==
'request_hint'
@
hint_wrapper
.
html
(
response
.
hint_html
)
@
find_hint_elements
()
else
if
@
state
==
'done'
@
message_wrapper
.
html
(
response
.
message_html
)
@
allow_reset
=
response
.
allow_reset
@
rebind
()
else
@
errors_area
.
html
(
response
.
message
)
@
errors_area
.
html
(
response
.
error
)
else
@
errors_area
.
html
(
'Problem state got out of sync. Try reloading the page.'
)
...
...
@@ -99,7 +110,7 @@ class @SelfAssessment
@
allow_reset
=
response
.
allow_reset
@
rebind
()
else
@
errors_area
.
html
(
response
.
message
)
@
errors_area
.
html
(
response
.
error
)
else
@
errors_area
.
html
(
'Problem state got out of sync. Try reloading the page.'
)
...
...
@@ -109,6 +120,7 @@ class @SelfAssessment
if
@
state
==
'done'
$
.
postWithPrefix
"
#{
@
ajax_url
}
/reset"
,
{},
(
response
)
=>
if
response
.
success
@
answer_area
.
html
(
''
)
@
rubric_wrapper
.
html
(
''
)
@
hint_wrapper
.
html
(
''
)
@
message_wrapper
.
html
(
''
)
...
...
@@ -116,6 +128,6 @@ class @SelfAssessment
@
rebind
()
@
reset_button
.
hide
()
else
@
errors_area
.
html
(
response
.
message
)
@
errors_area
.
html
(
response
.
error
)
else
@
errors_area
.
html
(
'Problem state got out of sync. Try reloading the page.'
)
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
f54d4241
This diff is collapsed.
Click to expand it.
lms/static/sass/course/courseware/_courseware.scss
View file @
f54d4241
...
...
@@ -262,5 +262,9 @@ section.self-assessment {
margin-bottom
:
5px
;
}
.error
{
font-size
:
14px
;
font-weight
:
bold
;
}
}
lms/templates/self_assessment_rubric.html
View file @
f54d4241
...
...
@@ -6,8 +6,9 @@
% if not read_only:
<select
name=
"assessment"
class=
"assessment"
>
<option
value=
"incorrect"
>
Incorrect
</option>
<option
value=
"correct"
>
Correct
</option>
%for i in xrange(0,max_score+1):
<option
value=
"${i}"
>
${i}
</option>
%endfor
</select>
% endif
...
...
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