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
cb203a6f
Commit
cb203a6f
authored
Jan 09, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error messages
parent
62e93870
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
common/lib/xmodule/xmodule/combined_open_ended_module.py
+1
-0
common/lib/xmodule/xmodule/open_ended_module.py
+12
-6
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
cb203a6f
...
@@ -224,6 +224,7 @@ class CombinedOpenEndedModule(XModule):
...
@@ -224,6 +224,7 @@ class CombinedOpenEndedModule(XModule):
current_task_state
=
self
.
overwrite_state
(
current_task_state
)
current_task_state
=
self
.
overwrite_state
(
current_task_state
)
self
.
current_task
=
children
[
'modules'
][
current_task_type
](
self
.
system
,
self
.
location
,
self
.
current_task_parsed_xml
,
self
.
current_task_descriptor
,
self
.
static_data
,
instance_state
=
current_task_state
)
self
.
current_task
=
children
[
'modules'
][
current_task_type
](
self
.
system
,
self
.
location
,
self
.
current_task_parsed_xml
,
self
.
current_task_descriptor
,
self
.
static_data
,
instance_state
=
current_task_state
)
log
.
debug
(
current_task_state
)
return
True
return
True
def
check_allow_reset
(
self
):
def
check_allow_reset
(
self
):
...
...
common/lib/xmodule/xmodule/open_ended_module.py
View file @
cb203a6f
...
@@ -405,23 +405,29 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
...
@@ -405,23 +405,29 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
correct: Correctness of submission (Boolean)
correct: Correctness of submission (Boolean)
score: Points to be assigned (numeric, can be float)
score: Points to be assigned (numeric, can be float)
"""
"""
fail
=
{
'valid'
:
False
,
'
correct'
:
False
,
'points'
:
0
,
'msg
'
:
''
}
fail
=
{
'valid'
:
False
,
'
score'
:
0
,
'feedback
'
:
''
}
try
:
try
:
score_result
=
json
.
loads
(
score_msg
)
score_result
=
json
.
loads
(
score_msg
)
except
(
TypeError
,
ValueError
):
except
(
TypeError
,
ValueError
):
log
.
error
(
"External grader message should be a JSON-serialized dict."
error_message
=
(
"External grader message should be a JSON-serialized dict."
" Received score_msg = {0}"
.
format
(
score_msg
))
" Received score_msg = {0}"
.
format
(
score_msg
))
log
.
error
(
error_message
)
fail
[
'feedback'
]
=
error_message
return
fail
return
fail
if
not
isinstance
(
score_result
,
dict
):
if
not
isinstance
(
score_result
,
dict
):
log
.
error
(
"External grader message should be a JSON-serialized dict."
error_message
=
(
"External grader message should be a JSON-serialized dict."
" Received score_result = {0}"
.
format
(
score_result
))
" Received score_result = {0}"
.
format
(
score_result
))
log
.
error
(
error_message
)
fail
[
'feedback'
]
=
error_message
return
fail
return
fail
for
tag
in
[
'score'
,
'feedback'
,
'grader_type'
,
'success'
,
'grader_id'
,
'submission_id'
]:
for
tag
in
[
'score'
,
'feedback'
,
'grader_type'
,
'success'
,
'grader_id'
,
'submission_id'
]:
if
tag
not
in
score_result
:
if
tag
not
in
score_result
:
log
.
error
(
"External grader message is missing required tag: {0}"
error_message
=
(
"External grader message is missing required tag: {0}"
.
format
(
tag
))
.
format
(
tag
))
log
.
error
(
error_message
)
fail
[
'feedback'
]
=
error
_message
return
fail
return
fail
#This is to support peer grading
#This is to support peer grading
if
isinstance
(
score_result
[
'score'
],
list
):
if
isinstance
(
score_result
[
'score'
],
list
):
...
...
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