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
e8cb3590
Commit
e8cb3590
authored
Feb 09, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trim hint and submit messages out of self assessment
parent
ae1df010
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
24 deletions
+8
-24
common/lib/xmodule/xmodule/self_assessment_module.py
+5
-21
lms/templates/self_assessment_hint.html
+1
-1
lms/templates/self_assessment_prompt.html
+2
-2
No files found.
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
e8cb3590
...
...
@@ -53,8 +53,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
@param descriptor: SelfAssessmentDescriptor
@return: None
"""
self
.
submit_message
=
definition
[
'submitmessage'
]
self
.
hint_prompt
=
definition
[
'hintprompt'
]
self
.
prompt
=
stringify_children
(
self
.
prompt
)
self
.
rubric
=
stringify_children
(
self
.
rubric
)
...
...
@@ -76,8 +74,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
'previous_answer'
:
previous_answer
,
'ajax_url'
:
system
.
ajax_url
,
'initial_rubric'
:
self
.
get_rubric_html
(
system
),
'initial_hint'
:
""
,
'initial_message'
:
self
.
get_message_html
(),
'state'
:
self
.
state
,
'allow_reset'
:
self
.
_allow_reset
(),
'child_type'
:
'selfassessment'
,
...
...
@@ -157,8 +153,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
else
:
hint
=
''
context
=
{
'hint_prompt'
:
self
.
hint_prompt
,
'hint'
:
hint
}
context
=
{
'hint'
:
hint
}
if
self
.
state
==
self
.
POST_ASSESSMENT
:
context
[
'read_only'
]
=
False
...
...
@@ -169,15 +164,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
return
system
.
render_template
(
'self_assessment_hint.html'
,
context
)
def
get_message_html
(
self
):
"""
Return the appropriate version of the message view, based on state.
"""
if
self
.
state
!=
self
.
DONE
:
return
""
return
"""<div class="save_message">{0}</div>"""
.
format
(
self
.
submit_message
)
def
save_answer
(
self
,
get
,
system
):
"""
...
...
@@ -274,7 +260,7 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
self
.
change_state
(
self
.
DONE
)
return
{
'success'
:
True
,
'message_html'
:
self
.
get_message_html
()
,
'message_html'
:
''
,
'allow_reset'
:
self
.
_allow_reset
()}
def
latest_post_assessment
(
self
,
system
):
...
...
@@ -314,7 +300,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
'hintprompt': 'some-html'
}
"""
expected_children
=
[
'submitmessage'
,
'hintprompt'
]
expected_children
=
[]
for
child
in
expected_children
:
if
len
(
xml_object
.
xpath
(
child
))
!=
1
:
raise
ValueError
(
"Self assessment definition must include exactly one '{0}' tag"
.
format
(
child
))
...
...
@@ -323,9 +309,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
"""Assumes that xml_object has child k"""
return
stringify_children
(
xml_object
.
xpath
(
k
)[
0
])
return
{
'submitmessage'
:
parse
(
'submitmessage'
),
'hintprompt'
:
parse
(
'hintprompt'
),
}
return
{}
def
definition_to_xml
(
self
,
resource_fs
):
'''Return an xml element representing this definition.'''
...
...
@@ -336,7 +320,7 @@ class SelfAssessmentDescriptor(XmlDescriptor, EditingDescriptor):
child_node
=
etree
.
fromstring
(
child_str
)
elt
.
append
(
child_node
)
for
child
in
[
'submitmessage'
,
'hintprompt'
]:
for
child
in
[]:
add_child
(
child
)
return
elt
lms/templates/self_assessment_hint.html
View file @
e8cb3590
<div
class=
"hint"
>
<div
class=
"hint-prompt"
>
${hint_prompt}
Please enter a hint below:
</div>
<textarea
name=
"post_assessment"
class=
"post_assessment"
cols=
"70"
rows=
"5"
${'
readonly=
"true"
'
if
read_only
else
''}
>
${hint}
</textarea>
...
...
lms/templates/self_assessment_prompt.html
View file @
e8cb3590
...
...
@@ -14,9 +14,9 @@
<div
class=
"rubric-wrapper"
>
${initial_rubric}
</div>
<div
class=
"hint-wrapper"
>
${initial_hint}
</div>
<div
class=
"hint-wrapper"
></div>
<div
class=
"message-wrapper"
>
${initial_message}
</div>
<div
class=
"message-wrapper"
></div>
<div
class=
"file-upload"
></div>
<input
type=
"button"
value=
"Submit"
class=
"submit-button"
name=
"show"
/>
...
...
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