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
a85db9f3
Commit
a85db9f3
authored
Jun 02, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gracefully handle when someone calls the self-assess handler without first making a submission
parent
2c265217
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
apps/openassessment/xblock/self_assessment_mixin.py
+3
-0
apps/openassessment/xblock/test/test_self.py
+7
-0
No files found.
apps/openassessment/xblock/self_assessment_mixin.py
View file @
a85db9f3
...
...
@@ -106,6 +106,9 @@ class SelfAssessmentMixin(object):
if
'options_selected'
not
in
data
:
return
{
'success'
:
False
,
'msg'
:
_
(
u"Missing options_selected key in request"
)}
if
self
.
submission_uuid
is
None
:
return
{
'success'
:
False
,
'msg'
:
_
(
u"You must submit a response before you can perform a self-assessment."
)}
try
:
assessment
=
self_api
.
create_assessment
(
self
.
submission_uuid
,
...
...
apps/openassessment/xblock/test/test_self.py
View file @
a85db9f3
...
...
@@ -53,6 +53,13 @@ class TestSelfAssessment(XBlockHandlerTestCase):
self
.
assertEqual
(
parts
[
1
][
'option'
][
'name'
],
u'ﻉซƈﻉɭɭﻉกՇ'
)
@scenario
(
'data/self_assessment_scenario.xml'
,
user_id
=
'Bob'
)
def
test_self_assess_no_submission
(
self
,
xblock
):
# Submit a self-assessment without first creating a submission
resp
=
self
.
request
(
xblock
,
'self_assess'
,
json
.
dumps
(
self
.
ASSESSMENT
),
response_format
=
'json'
)
self
.
assertFalse
(
resp
[
'success'
])
self
.
assertGreater
(
len
(
resp
[
'msg'
]),
0
)
@scenario
(
'data/self_assessment_scenario.xml'
,
user_id
=
'Bob'
)
def
test_self_assess_updates_workflow
(
self
,
xblock
):
# Create a submission for the student
...
...
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