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
cffda376
Commit
cffda376
authored
Apr 28, 2017
by
Eric Fischer
Committed by
GitHub
Apr 28, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1002 from edx/efischer/fix_release
Handle legacy problem definitions
parents
f7faec7b
ca9e48ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
1 deletions
+52
-1
openassessment/xblock/openassessmentblock.py
+19
-1
openassessment/xblock/test/data/neither_response_type.xml
+26
-0
openassessment/xblock/test/test_openassessment.py
+7
-0
No files found.
openassessment/xblock/openassessmentblock.py
View file @
cffda376
...
@@ -126,7 +126,7 @@ class OpenAssessmentBlock(MessageMixin,
...
@@ -126,7 +126,7 @@ class OpenAssessmentBlock(MessageMixin,
help
=
"ISO-8601 formatted string representing the submission due date."
help
=
"ISO-8601 formatted string representing the submission due date."
)
)
text_response
=
String
(
text_response
_raw
=
String
(
help
=
"Specify whether learners must include a text based response to this problem's prompt."
,
help
=
"Specify whether learners must include a text based response to this problem's prompt."
,
default
=
"required"
,
default
=
"required"
,
scope
=
Scope
.
settings
scope
=
Scope
.
settings
...
@@ -245,6 +245,24 @@ class OpenAssessmentBlock(MessageMixin,
...
@@ -245,6 +245,24 @@ class OpenAssessmentBlock(MessageMixin,
return
self
.
_serialize_opaque_key
(
self
.
xmodule_runtime
.
course_id
)
# pylint:disable=E1101
return
self
.
_serialize_opaque_key
(
self
.
xmodule_runtime
.
course_id
)
# pylint:disable=E1101
@property
@property
def
text_response
(
self
):
"""
Backward compatibility for existing blocks that were created without text_response
or file_upload_response fields. These blocks will be treated as required text.
"""
if
not
self
.
file_upload_response
and
not
self
.
text_response_raw
:
return
'required'
else
:
return
self
.
text_response_raw
@text_response.setter
def
text_response
(
self
,
value
):
"""
Setter for text_response_raw
"""
self
.
text_response_raw
=
value
if
value
else
None
@property
def
file_upload_response
(
self
):
def
file_upload_response
(
self
):
"""
"""
Backward compatibility for existing block before that were created without
Backward compatibility for existing block before that were created without
...
...
openassessment/xblock/test/data/neither_response_type.xml
0 → 100644
View file @
cffda376
<openassessment>
<title>
Open Assessment Test
</title>
<prompts>
<prompt>
<description>
Given the state of the world today, what do you think should be done to combat poverty? Please answer in a short essay of 200-300 words.
</description>
</prompt>
</prompts>
<rubric>
<criterion>
<name>
Concise
</name>
<prompt>
How concise is it?
</prompt>
<option
points=
"0"
>
<name>
Neal Stephenson (late)
</name>
<explanation>
Neal Stephenson explanation
</explanation>
</option>
<option
points=
"1"
>
<name>
HP Lovecraft
</name>
<explanation>
HP Lovecraft explanation
</explanation>
</option>
</criterion>
</rubric>
<assessments>
<assessment
name=
"peer-assessment"
must_grade=
"1"
must_be_graded_by=
"1"
/>
<assessment
name=
"self-assessment"
/>
</assessments>
</openassessment>
openassessment/xblock/test/test_openassessment.py
View file @
cffda376
...
@@ -452,6 +452,13 @@ class TestOpenAssessment(XBlockHandlerTestCase):
...
@@ -452,6 +452,13 @@ class TestOpenAssessment(XBlockHandlerTestCase):
xblock
.
prompts
=
[{
'description'
:
'Prompt 4.'
},
{
'description'
:
'Prompt 5.'
}]
xblock
.
prompts
=
[{
'description'
:
'Prompt 4.'
},
{
'description'
:
'Prompt 5.'
}]
self
.
assertEqual
(
xblock
.
prompt
,
'[{"description": "Prompt 4."}, {"description": "Prompt 5."}]'
)
self
.
assertEqual
(
xblock
.
prompt
,
'[{"description": "Prompt 4."}, {"description": "Prompt 5."}]'
)
@scenario
(
'data/neither_response_type.xml'
)
def
test_no_response_type
(
self
,
xblock
):
"""
Ensure that legacy courses will still load properly.
"""
self
.
assertEqual
(
xblock
.
text_response
,
'required'
)
class
TestDates
(
XBlockHandlerTestCase
):
class
TestDates
(
XBlockHandlerTestCase
):
...
...
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