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):
...
@@ -38,8 +38,6 @@ class HtmlModule(XModule):
instance_state
,
shared_state
,
**
kwargs
)
instance_state
,
shared_state
,
**
kwargs
)
self
.
html
=
self
.
definition
[
'data'
]
self
.
html
=
self
.
definition
[
'data'
]
class
HtmlDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
class
HtmlDescriptor
(
XmlDescriptor
,
EditingDescriptor
):
"""
"""
Module for putting raw html in a course
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', ( ->
...
@@ -6,7 +6,7 @@ $(document).on('click', 'section.sa-wrapper input#show', ( ->
if
response
.
success
if
response
.
success
$
(
'section.sa-wrapper input#show'
).
remove
()
$
(
'section.sa-wrapper input#show'
).
remove
()
$
(
'section.sa-wrapper textarea#answer'
).
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
)
$
(
'section.sa-wrapper p#rubric'
).
append
(
response
.
rubric
)
else
else
$
(
'section.sa-wrapper p#rubric'
).
append
(
response
.
message
)
$
(
'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):
...
@@ -121,7 +121,7 @@ class SelfAssessmentModule(XModule):
dom2
=
etree
.
fromstring
(
"<selfassessment>"
+
self
.
definition
[
'data'
]
+
"</selfassessment>"
)
dom2
=
etree
.
fromstring
(
"<selfassessment>"
+
self
.
definition
[
'data'
]
+
"</selfassessment>"
)
#Extract problem, submission message and rubric from definition file
#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
.
problem
=
''
.
join
([
etree
.
tostring
(
child
)
for
child
in
only_one
(
dom2
.
xpath
(
'problem'
))])
self
.
submit_message
=
etree
.
tostring
(
dom2
.
xpath
(
'submitmessage'
)[
0
])
self
.
submit_message
=
etree
.
tostring
(
dom2
.
xpath
(
'submitmessage'
)[
0
])
...
@@ -133,8 +133,8 @@ class SelfAssessmentModule(XModule):
...
@@ -133,8 +133,8 @@ class SelfAssessmentModule(XModule):
'<p id="rubric"></p><input type="hidden" '
'<p id="rubric"></p><input type="hidden" '
'id="ajax_url" name="ajax_url" url="{0}"></section><br/><br/>'
)
.
format
(
system
.
ajax_url
)
'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/>'
rubric_form
=
(
'Please assess your performance given the above rubric: <br/>'
'<
br/><
section class="sa-wrapper"><select name="assessment" id="assessment">'
'<section class="sa-wrapper"><select name="assessment" id="assessment">'
'<option value="incorrect">Incorrect</option><option value="correct">'
'<option value="incorrect">Incorrect</option><option value="correct">'
'Correct</option></select><br/>'
'Correct</option></select><br/>'
'<input type="button" value="Save" id="save" name="save"/>'
'<input type="button" value="Save" id="save" name="save"/>'
...
@@ -142,14 +142,16 @@ class SelfAssessmentModule(XModule):
...
@@ -142,14 +142,16 @@ class SelfAssessmentModule(XModule):
'id="ajax_url" name="ajax_url" url="{0}">'
'id="ajax_url" name="ajax_url" url="{0}">'
'</section><br/><br/>'
)
.
format
(
system
.
ajax_url
)
'</section><br/><br/>'
)
.
format
(
system
.
ajax_url
)
rubric_header
=
(
'<br/><br/><b>Rubric</b>'
)
#Combine problem, rubric, and the forms
#Combine problem, rubric, and the forms
if
self
.
answer
is
not
""
:
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
])
self
.
problem
=
''
.
join
([
self
.
problem
,
answer_html
,
problem_form
])
else
:
else
:
self
.
problem
=
''
.
join
([
self
.
problem
,
problem_form
])
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
#Display the problem to the student to begin with
self
.
html
=
self
.
problem
self
.
html
=
self
.
problem
...
@@ -284,7 +286,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
...
@@ -284,7 +286,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
stores_state
=
True
stores_state
=
True
has_score
=
True
has_score
=
True
template_dir_name
=
"
html
"
template_dir_name
=
"
selfassessment
"
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/html/edit.coffee'
)]}
js_module_name
=
"HTMLEditingDescriptor"
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