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
a06680a2
Commit
a06680a2
authored
Jan 07, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move status, remove self assessment format conversion
parent
1c6f271b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
48 deletions
+2
-48
common/lib/xmodule/xmodule/self_assessment_module.py
+0
-46
lms/templates/combined_open_ended.html
+2
-2
No files found.
common/lib/xmodule/xmodule/self_assessment_module.py
View file @
a06680a2
...
@@ -47,52 +47,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
...
@@ -47,52 +47,6 @@ class SelfAssessmentModule(openendedchild.OpenEndedChild):
self
.
submit_message
=
definition
[
'submitmessage'
]
self
.
submit_message
=
definition
[
'submitmessage'
]
self
.
hint_prompt
=
definition
[
'hintprompt'
]
self
.
hint_prompt
=
definition
[
'hintprompt'
]
@staticmethod
def
convert_state_to_current_format
(
old_state
):
"""
This module used to use a problematic state representation. This method
converts that into the new format.
Args:
old_state: dict of state, as passed in. May be old.
Returns:
new_state: dict of new state
"""
if
old_state
.
get
(
'version'
,
0
)
==
SelfAssessmentModule
.
STATE_VERSION
:
# already current
return
old_state
# for now, there's only one older format.
new_state
=
{
'version'
:
SelfAssessmentModule
.
STATE_VERSION
}
def
copy_if_present
(
key
):
if
key
in
old_state
:
new_state
[
key
]
=
old_state
[
key
]
for
to_copy
in
[
'attempts'
,
'state'
]:
copy_if_present
(
to_copy
)
# The answers, scores, and hints need to be kept together to avoid them
# getting out of sync.
# NOTE: Since there's only one problem with a few hundred submissions
# in production so far, not trying to be smart about matching up hints
# and submissions in cases where they got out of sync.
student_answers
=
old_state
.
get
(
'student_answers'
,
[])
scores
=
old_state
.
get
(
'scores'
,
[])
hints
=
old_state
.
get
(
'hints'
,
[])
new_state
[
'history'
]
=
[
{
'answer'
:
answer
,
'score'
:
score
,
'hint'
:
hint
}
for
answer
,
score
,
hint
in
itertools
.
izip_longest
(
student_answers
,
scores
,
hints
)]
return
new_state
def
get_html
(
self
,
system
):
def
get_html
(
self
,
system
):
#set context variables and render template
#set context variables and render template
if
self
.
state
!=
self
.
INITIAL
:
if
self
.
state
!=
self
.
INITIAL
:
...
...
lms/templates/combined_open_ended.html
View file @
a06680a2
<section
id=
"combined-open-ended"
class=
"combined-open-ended"
data-ajax-url=
"${ajax_url}"
data-allow_reset=
"${allow_reset}"
data-state=
"${state}"
data-task-count=
"${task_count}"
data-task-number=
"${task_number}"
>
<section
id=
"combined-open-ended"
class=
"combined-open-ended"
data-ajax-url=
"${ajax_url}"
data-allow_reset=
"${allow_reset}"
data-state=
"${state}"
data-task-count=
"${task_count}"
data-task-number=
"${task_number}"
>
<div
class=
"status"
>
${status | n}
</div>
% for item in items:
% for item in items:
<div
class=
"item"
>
${item['content'] | n}
</div>
<div
class=
"item"
>
${item['content'] | n}
</div>
% endfor
% endfor
...
@@ -7,7 +9,5 @@
...
@@ -7,7 +9,5 @@
<input
type=
"button"
value=
"Reset"
class=
"reset-button"
name=
"reset"
/>
<input
type=
"button"
value=
"Reset"
class=
"reset-button"
name=
"reset"
/>
<input
type=
"button"
value=
"Next Step"
class=
"next-step-button"
name=
"reset"
/>
<input
type=
"button"
value=
"Next Step"
class=
"next-step-button"
name=
"reset"
/>
<div
class=
"status"
>
${status | n}
</div>
</section>
</section>
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