Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
8b999964
Commit
8b999964
authored
Sep 06, 2017
by
Eric Fischer
Committed by
GitHub
Sep 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1047 from edx/efischer/cleanup
Cleanup of #1046
parents
453612fd
ae432ca3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
openassessment/xblock/student_training_mixin.py
+2
-5
No files found.
openassessment/xblock/student_training_mixin.py
View file @
8b999964
...
...
@@ -63,11 +63,8 @@ class StudentTrainingMixin(object):
Helper to parse answer as a fully-qualified dict.
"""
parts
=
answer
.
get
(
'parts'
,
[])
logger
.
error
(
parts
)
if
parts
and
isinstance
(
parts
[
0
],
dict
):
logger
.
error
(
parts
[
0
])
if
isinstance
(
parts
[
0
]
.
get
(
'text'
),
basestring
):
logger
.
error
(
parts
[
0
]
.
get
(
'text'
))
return
create_submission_dict
({
'answer'
:
answer
},
self
.
prompts
)
...
...
@@ -77,6 +74,8 @@ class StudentTrainingMixin(object):
"""
if
answer
and
isinstance
(
answer
[
0
],
basestring
):
return
self
.
_parse_answer_string
(
answer
[
0
])
elif
len
(
answer
)
==
0
:
return
self
.
_parse_answer_string
(
""
)
def
_parse_answer_string
(
self
,
answer
):
...
...
@@ -104,7 +103,6 @@ class StudentTrainingMixin(object):
)
answer
=
example
[
'answer'
]
submission_dict
=
None
logger
.
error
(
answer
)
if
isinstance
(
answer
,
basestring
):
submission_dict
=
self
.
_parse_answer_string
(
answer
)
elif
isinstance
(
answer
,
dict
):
...
...
@@ -112,7 +110,6 @@ class StudentTrainingMixin(object):
elif
isinstance
(
answer
,
list
):
submission_dict
=
self
.
_parse_answer_list
(
answer
)
logger
.
error
(
submission_dict
)
return
(
submission_dict
,
""
)
or
(
{},
"Improperly formatted example, cannot render student training. Example: {}"
.
format
(
example
)
...
...
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