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
b98f4e02
Commit
b98f4e02
authored
Dec 31, 2013
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JSON serialization error fixed and added test for it.
ORA-195
parent
f3f0e8a5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
+1
-1
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py
+5
-2
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
+8
-0
No files found.
common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py
View file @
b98f4e02
...
...
@@ -651,7 +651,7 @@ class CombinedOpenEndedV1Module():
last_post_evaluation
=
task
.
format_feedback_with_evaluation
(
self
.
system
,
last_post_assessment
)
last_post_assessment
=
last_post_evaluation
try
:
rubric_data
=
task
.
_parse_score_msg
(
task
.
child_history
[
-
1
]
.
get
(
'post_assessment'
,
""
),
self
.
system
)
rubric_data
=
task
.
_parse_score_msg
(
task
.
child_history
[
-
1
]
.
get
(
'post_assessment'
,
"
{}
"
),
self
.
system
)
except
Exception
:
log
.
debug
(
"Could not parse rubric data from child history. "
"Likely we have not yet initialized a previous step, so this is perfectly fine."
)
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py
View file @
b98f4e02
...
...
@@ -503,6 +503,9 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
fail
[
'feedback'
]
=
error_message
return
fail
if
not
score_result
:
return
fail
for
tag
in
[
'score'
,
'feedback'
,
'grader_type'
,
'success'
,
'grader_id'
,
'submission_id'
]:
if
tag
not
in
score_result
:
# This is a dev_facing_error
...
...
@@ -586,7 +589,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
return
""
feedback_dict
=
self
.
_parse_score_msg
(
self
.
child_history
[
-
1
]
.
get
(
'post_assessment'
,
""
),
self
.
child_history
[
-
1
]
.
get
(
'post_assessment'
,
"
{}
"
),
system
,
join_feedback
=
join_feedback
)
...
...
@@ -756,7 +759,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
"""
attempt
=
self
.
child_history
[
index
]
score
=
attempt
.
get
(
'score'
)
post_assessment_data
=
self
.
_parse_score_msg
(
attempt
.
get
(
'post_assessment'
),
self
.
system
)
post_assessment_data
=
self
.
_parse_score_msg
(
attempt
.
get
(
'post_assessment'
,
"{}"
),
self
.
system
)
grader_types
=
post_assessment_data
.
get
(
'grader_types'
)
# According to _parse_score_msg in ML grading there should be only one grader type.
...
...
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
View file @
b98f4e02
...
...
@@ -390,6 +390,14 @@ class OpenEndedModuleTest(unittest.TestCase):
# Confirm that the answer is stored properly.
self
.
assertEqual
(
test_module
.
latest_answer
(),
submitted_response
)
def
test_parse_score_msg
(
self
):
"""
Test _parse_score_msg with empty dict.
"""
assessment
=
self
.
openendedmodule
.
_parse_score_msg
(
"{}"
,
self
.
test_system
)
self
.
assertEqual
(
assessment
.
get
(
"valid"
),
False
)
class
CombinedOpenEndedModuleTest
(
unittest
.
TestCase
):
"""
...
...
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