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
ec0f8dac
Commit
ec0f8dac
authored
Nov 01, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up display code
parent
99b0795e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
common/lib/xmodule/xmodule/html_module.py
+0
-2
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
+1
-1
common/lib/xmodule/xmodule/self_assessment_module.py
+8
-6
No files found.
common/lib/xmodule/xmodule/html_module.py
View file @
ec0f8dac
...
...
@@ -38,8 +38,6 @@ class HtmlModule(XModule):
instance_state
,
shared_state
,
**
kwargs
)
self
.
html
=
self
.
definition
[
'data'
]
class
HtmlDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
Module for putting raw html in a course
...
...
common/lib/xmodule/xmodule/js/src/selfassessment/display.coffee
View file @
ec0f8dac
...
...
@@ -6,7 +6,7 @@ $(document).on('click', 'section.sa-wrapper input#show', ( ->
if
response
.
success
$
(
'section.sa-wrapper input#show'
).
remove
()
$
(
'section.sa-wrapper textarea#answer'
).
remove
()
$
(
'section.sa-wrapper p#rubric'
).
append
(
answer
)
$
(
'section.sa-wrapper p#rubric'
).
append
(
"Your answer:
#{
answer
}
"
)
$
(
'section.sa-wrapper p#rubric'
).
append
(
response
.
rubric
)
else
$
(
'section.sa-wrapper p#rubric'
).
append
(
response
.
message
)
...
...
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
ec0f8dac
...
...
@@ -121,7 +121,7 @@ class SelfAssessmentModule(XModule):
dom2
=
etree
.
fromstring
(
"<selfassessment>"
+
self
.
definition
[
'data'
]
+
"</selfassessment>"
)
#Extract problem, submission message and rubric from definition file
self
.
rubric
=
"<br/>
<br/>
"
+
''
.
join
([
etree
.
tostring
(
child
)
for
child
in
only_one
(
dom2
.
xpath
(
'rubric'
))])
self
.
rubric
=
"<br/>"
+
''
.
join
([
etree
.
tostring
(
child
)
for
child
in
only_one
(
dom2
.
xpath
(
'rubric'
))])
self
.
problem
=
''
.
join
([
etree
.
tostring
(
child
)
for
child
in
only_one
(
dom2
.
xpath
(
'problem'
))])
self
.
submit_message
=
etree
.
tostring
(
dom2
.
xpath
(
'submitmessage'
)[
0
])
...
...
@@ -133,8 +133,8 @@ class SelfAssessmentModule(XModule):
'<p id="rubric"></p><input type="hidden" '
'id="ajax_url" name="ajax_url" url="{0}"></section><br/><br/>'
)
.
format
(
system
.
ajax_url
)
rubric_form
=
(
'
<br/><br/>
Please assess your performance given the above rubric: <br/>'
'<
br/><
section class="sa-wrapper"><select name="assessment" id="assessment">'
rubric_form
=
(
'Please assess your performance given the above rubric: <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"/>'
...
...
@@ -142,14 +142,16 @@ class SelfAssessmentModule(XModule):
'id="ajax_url" name="ajax_url" url="{0}">'
'</section><br/><br/>'
)
.
format
(
system
.
ajax_url
)
rubric_header
=
(
'<br/><br/><b>Rubric</b>'
)
#Combine problem, rubric, and the forms
if
self
.
answer
is
not
""
:
answer_html
=
"<br/>
<br/>Previous Answer: <br/>{0}<br/>
<br/>"
.
format
(
self
.
answer
)
answer_html
=
"<br/>
Previous answer: {0}
<br/>"
.
format
(
self
.
answer
)
self
.
problem
=
''
.
join
([
self
.
problem
,
answer_html
,
problem_form
])
else
:
self
.
problem
=
''
.
join
([
self
.
problem
,
problem_form
])
self
.
rubric
=
''
.
join
([
self
.
rubric
,
rubric_form
])
self
.
rubric
=
''
.
join
([
rubric_header
,
self
.
rubric
,
rubric_form
])
#Display the problem to the student to begin with
self
.
html
=
self
.
problem
...
...
@@ -284,7 +286,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
stores_state
=
True
has_score
=
True
template_dir_name
=
"
html
"
template_dir_name
=
"
selfassessment
"
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js_module_name
=
"HTMLEditingDescriptor"
...
...
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