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
1c2ec275
Commit
1c2ec275
authored
Nov 01, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajax working, refinements now
parent
ecba6bd4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
13 deletions
+6
-13
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
+1
-9
common/lib/xmodule/xmodule/self_assessment_module.py
+5
-4
No files found.
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
View file @
1c2ec275
...
...
@@ -3,24 +3,16 @@ $(document).on('click', 'section.sa-wrapper input#show', ( ->
post_url
=
$
(
'section.sa-wrapper input#show'
).
attr
(
'url'
)
final_url
=
"/courses/MITx/6.002x/2012_Fall/modx/
#{
post_url
}
/sa_show"
answer
=
$
(
'section.sa-wrapper input#answer'
).
val
()
alert
(
answer
)
alert
(
final_url
)
$
.
post
final_url
,
answer
,
(
response
)
->
alert
(
"posted"
)
if
response
.
success
alert
(
response
.
rubric
)
$
(
'section.sa-wrapper p#rubric'
).
append
(
response
.
rubric
)
));
$
(
document
).
on
(
'click'
,
'section.sa-wrapper input#save'
,
(
->
answer
=
$
(
'section.sa-wrapper input#answer'
).
val
()
alert
(
answer
)
assessment
=
0
assessment_correct
=
$
(
'section.sa-wrapper
input#assessment_correct'
).
selected
()
assessment_correct
=
$
(
'section.sa-wrapper
#assessment'
).
find
(
':selected'
).
text
()
alert
(
assessment_correct
)
assessment_incorrect
=
$
(
'section.sa-wrapper input#assessment_incorrect'
).
selected
()
alert
(
assessment_incorrect
)
root
=
location
.
protocol
+
"//"
+
location
.
host
post_url
=
$
(
'section.sa-wrapper input#show'
).
attr
(
'url'
)
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
1c2ec275
...
...
@@ -21,9 +21,9 @@ from xmodule.contentstore.content import XASSET_SRCREF_PREFIX, StaticContent
log
=
logging
.
getLogger
(
"mitx.courseware"
)
rubric_form
=
(
'<
section class="sa-wrapper"><input type="radio" name="assessment" id="assessment" value="correct"/>Correct<br/
>'
'<input type="radio" id="assessment" name="assessment" value="incorrect"
>'
'Incorrect<br/>
<input type="button" value="Save" id="save" name="save"/><p id="save_message"></p></section><br/><br/>'
)
rubric_form
=
(
'<
br/><br/>Please assess your performance given the above rubric: <br/><br/><section class="sa-wrapper"><select name="assessment" id="assessment"
>'
'<option value="incorrect">Incorrect</option><option value="correct">Correct</option></select><br/
>'
'
<input type="button" value="Save" id="save" name="save"/><p id="save_message"></p></section><br/><br/>'
)
def
only_one
(
lst
,
default
=
""
,
process
=
lambda
x
:
x
):
"""
...
...
@@ -68,7 +68,7 @@ class SelfAssessmentModule(XModule):
problem_form
=
(
'<section class="sa-wrapper"><input type="text" name="answer" '
'id="answer"/><br/>'
'<input type="button" value="Check" id ="show" name="show" url="{0}"/>'
'<p id="rubric"></p></section>'
)
.
format
(
self
.
location
)
'<p id="rubric"></p></section>
<br/><br/>
'
)
.
format
(
self
.
location
)
self
.
problem
=
''
.
join
([
self
.
problem
,
problem_form
])
self
.
rubric
=
''
.
join
([
self
.
rubric
,
rubric_form
])
self
.
html
=
self
.
problem
...
...
@@ -151,6 +151,7 @@ class SelfAssessmentModule(XModule):
event_info
[
'problem_id'
]
=
self
.
location
.
url
()
answers
=
self
.
make_dict_of_responses
(
get
)
log
.
debug
(
answers
)
event_info
[
'answers'
]
=
answers
self
.
system
.
track_function
(
'save_problem_succeed'
,
event_info
)
...
...
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