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
570d587b
Commit
570d587b
authored
Apr 24, 2014
by
Joe Blaylock
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #284 from edx/jrbl/410-optional-prompts-and-instructions
Make rubric prompt display and instructions optional
parents
93ef7906
10a7d90a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
310 additions
and
24 deletions
+310
-24
apps/openassessment/templates/openassessmentblock/oa_base.html
+2
-0
apps/openassessment/xblock/openassessmentblock.py
+6
-1
apps/openassessment/xblock/static/xml/promptless_rubric_example.xml
+32
-0
apps/openassessment/xblock/test/data/empty_prompt.xml
+21
-0
apps/openassessment/xblock/test/data/serialize.json
+127
-0
apps/openassessment/xblock/test/data/update_from_xml.json
+107
-0
apps/openassessment/xblock/test/data/update_from_xml_error.json
+0
-19
apps/openassessment/xblock/test/test_openassessment.py
+10
-0
apps/openassessment/xblock/xml.py
+5
-4
No files found.
apps/openassessment/templates/openassessmentblock/oa_base.html
View file @
570d587b
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
{% endblock %}
{% endblock %}
<div
class=
"wrapper--openassessment__prompt"
>
<div
class=
"wrapper--openassessment__prompt"
>
{% if question %}
<article
class=
"openassessment__prompt ui-toggle-visibility"
>
<article
class=
"openassessment__prompt ui-toggle-visibility"
>
<h2
class=
"openassessment__prompt__title"
>
{% trans "The prompt for this assignment" %}
</h2>
<h2
class=
"openassessment__prompt__title"
>
{% trans "The prompt for this assignment" %}
</h2>
...
@@ -37,6 +38,7 @@
...
@@ -37,6 +38,7 @@
{{ question|linebreaks }}
{{ question|linebreaks }}
</div>
</div>
</article>
</article>
{% endif %}
</div>
</div>
<ol
class=
"openassessment__steps"
id=
"openassessment__steps"
>
<ol
class=
"openassessment__steps"
id=
"openassessment__steps"
>
...
...
apps/openassessment/xblock/openassessmentblock.py
View file @
570d587b
...
@@ -120,8 +120,9 @@ class OpenAssessmentBlock(
...
@@ -120,8 +120,9 @@ class OpenAssessmentBlock(
course_id
=
String
(
course_id
=
String
(
default
=
u"TestCourse"
,
default
=
u"TestCourse"
,
scope
=
Scope
.
content
,
scope
=
Scope
.
content
,
help
=
"The course_id associated with this prompt (until we can get it from runtime)."
,
help
=
"The course_id associated with this prompt (until we can get it from runtime)."
)
)
submission_uuid
=
String
(
submission_uuid
=
String
(
default
=
None
,
default
=
None
,
scope
=
Scope
.
user_state
,
scope
=
Scope
.
user_state
,
...
@@ -311,6 +312,10 @@ class OpenAssessmentBlock(
...
@@ -311,6 +312,10 @@ class OpenAssessmentBlock(
"OpenAssessmentBlock Censorship Rubric"
,
"OpenAssessmentBlock Censorship Rubric"
,
load
(
'static/xml/censorship_rubric_example.xml'
)
load
(
'static/xml/censorship_rubric_example.xml'
)
),
),
(
"OpenAssessmentBlock Promptless Rubric"
,
load
(
'static/xml/promptless_rubric_example.xml'
)
),
]
]
@classmethod
@classmethod
...
...
apps/openassessment/xblock/static/xml/promptless_rubric_example.xml
0 → 100644
View file @
570d587b
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<openassessment>
<title>
Promptless rubric
</title>
<rubric>
<criterion>
<name>
concise
</name>
<prompt>
How concise is it?
</prompt>
<option
points=
"0"
>
<name>
The Bible
</name>
<explanation></explanation>
</option>
<option
points=
"1"
>
<name>
Earnest Hemingway
</name>
<explanation></explanation>
</option>
<option
points=
"3"
>
<name>
Matsuo Basho
</name>
<explanation></explanation>
</option>
</criterion>
</rubric>
<assessments>
<assessment
name=
"peer-assessment"
start=
"2014-12-20T19:00-7:00"
due=
"2014-12-21T22:22-7:00"
must_grade=
"2"
must_be_graded_by=
"1"
/>
<assessment
name=
"self-assessment"
/>
</assessments>
</openassessment>
apps/openassessment/xblock/test/data/empty_prompt.xml
0 → 100644
View file @
570d587b
<openassessment>
<title>
Open Assessment Test
</title>
<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=
"2"
must_be_graded_by=
"1"
/>
<assessment
name=
"self-assessment"
/>
</assessments>
</openassessment>
apps/openassessment/xblock/test/data/serialize.json
View file @
570d587b
...
@@ -63,6 +63,133 @@
...
@@ -63,6 +63,133 @@
]
]
},
},
"promptless"
:
{
"title"
:
"Foo"
,
"prompt"
:
null
,
"rubric_feedback_prompt"
:
"Test Feedback Prompt"
,
"start"
:
null
,
"due"
:
null
,
"submission_start"
:
null
,
"submission_due"
:
null
,
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
],
"assessments"
:
[
{
"name"
:
"peer-assessment"
,
"start"
:
"2014-02-27T09:46:28"
,
"due"
:
"2014-03-01T00:00:00"
,
"must_grade"
:
5
,
"must_be_graded_by"
:
3
},
{
"name"
:
"self-assessment"
,
"start"
:
"2014-04-01T00:00:00"
,
"due"
:
"2014-06-01T00:00:00"
}
],
"expected_xml"
:
[
"<openassessment>"
,
"<title>Foo</title>"
,
"<assessments>"
,
"<assessment name=
\"
peer-assessment
\"
start=
\"
2014-02-27T09:46:28
\"
due=
\"
2014-03-01T00:00:00
\"
must_grade=
\"
5
\"
must_be_graded_by=
\"
3
\"
/>"
,
"<assessment name=
\"
self-assessment
\"
start=
\"
2014-04-01T00:00:00
\"
due=
\"
2014-06-01T00:00:00
\"
/>"
,
"</assessments>"
,
"<rubric>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
"<option points=
\"
0
\"
><name>No</name><explanation>No explanation</explanation></option>"
,
"<option points=
\"
2
\"
><name>Yes</name><explanation>Yes explanation</explanation></option>"
,
"</criterion>"
,
"<feedbackprompt>Test Feedback Prompt</feedbackprompt>"
,
"</rubric>"
,
"</openassessment>"
]
},
"empty_prompt"
:
{
"title"
:
"Foo"
,
"prompt"
:
""
,
"rubric_feedback_prompt"
:
"Test Feedback Prompt"
,
"start"
:
null
,
"due"
:
null
,
"submission_start"
:
null
,
"submission_due"
:
null
,
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
],
"assessments"
:
[
{
"name"
:
"peer-assessment"
,
"start"
:
"2014-02-27T09:46:28"
,
"due"
:
"2014-03-01T00:00:00"
,
"must_grade"
:
5
,
"must_be_graded_by"
:
3
},
{
"name"
:
"self-assessment"
,
"start"
:
"2014-04-01T00:00:00"
,
"due"
:
"2014-06-01T00:00:00"
}
],
"expected_xml"
:
[
"<openassessment>"
,
"<title>Foo</title>"
,
"<assessments>"
,
"<assessment name=
\"
peer-assessment
\"
start=
\"
2014-02-27T09:46:28
\"
due=
\"
2014-03-01T00:00:00
\"
must_grade=
\"
5
\"
must_be_graded_by=
\"
3
\"
/>"
,
"<assessment name=
\"
self-assessment
\"
start=
\"
2014-04-01T00:00:00
\"
due=
\"
2014-06-01T00:00:00
\"
/>"
,
"</assessments>"
,
"<rubric>"
,
"<prompt></prompt>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
"<option points=
\"
0
\"
><name>No</name><explanation>No explanation</explanation></option>"
,
"<option points=
\"
2
\"
><name>Yes</name><explanation>Yes explanation</explanation></option>"
,
"</criterion>"
,
"<feedbackprompt>Test Feedback Prompt</feedbackprompt>"
,
"</rubric>"
,
"</openassessment>"
]
},
"unicode"
:
{
"unicode"
:
{
"title"
:
"ƒσσ"
,
"title"
:
"ƒσσ"
,
"prompt"
:
"Ṫëṡẗ ṗṛöṁṗẗ"
,
"prompt"
:
"Ṫëṡẗ ṗṛöṁṗẗ"
,
...
...
apps/openassessment/xblock/test/data/update_from_xml.json
View file @
570d587b
...
@@ -61,6 +61,113 @@
...
@@ -61,6 +61,113 @@
]
]
},
},
"promptless"
:
{
"xml"
:
[
"<openassessment>"
,
"<title>Foo</title>"
,
"<assessments>"
,
"<assessment name=
\"
self-assessment
\"
start=
\"
2014-04-01T00:00:00
\"
due=
\"
2014-06-01T00:00:00
\"
/>"
,
"</assessments>"
,
"<rubric>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
"<option points=
\"
0
\"
><name>No</name><explanation>No explanation</explanation></option>"
,
"<option points=
\"
2
\"
><name>Yes</name><explanation>Yes explanation</explanation></option>"
,
"</criterion>"
,
"</rubric>"
,
"</openassessment>"
],
"title"
:
"Foo"
,
"prompt"
:
null
,
"start"
:
"2000-01-01T00:00:00"
,
"due"
:
"3000-01-01T00:00:00"
,
"submission_start"
:
null
,
"submission_due"
:
null
,
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
],
"assessments"
:
[
{
"name"
:
"self-assessment"
,
"start"
:
"2014-04-01T00:00:00"
,
"due"
:
"2014-06-01T00:00:00"
}
]
},
"empty_prompt"
:
{
"xml"
:
[
"<openassessment>"
,
"<title>Foo</title>"
,
"<assessments>"
,
"<assessment name=
\"
self-assessment
\"
start=
\"
2014-04-01T00:00:00
\"
due=
\"
2014-06-01T00:00:00
\"
/>"
,
"</assessments>"
,
"<rubric>"
,
"<prompt></prompt>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
"<option points=
\"
0
\"
><name>No</name><explanation>No explanation</explanation></option>"
,
"<option points=
\"
2
\"
><name>Yes</name><explanation>Yes explanation</explanation></option>"
,
"</criterion>"
,
"</rubric>"
,
"</openassessment>"
],
"title"
:
"Foo"
,
"prompt"
:
""
,
"start"
:
"2000-01-01T00:00:00"
,
"due"
:
"3000-01-01T00:00:00"
,
"submission_start"
:
null
,
"submission_due"
:
null
,
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
],
"assessments"
:
[
{
"name"
:
"self-assessment"
,
"start"
:
"2014-04-01T00:00:00"
,
"due"
:
"2014-06-01T00:00:00"
}
]
},
"unicode"
:
{
"unicode"
:
{
"xml"
:
[
"xml"
:
[
"<openassessment>"
,
"<openassessment>"
,
...
...
apps/openassessment/xblock/test/data/update_from_xml_error.json
View file @
570d587b
...
@@ -202,25 +202,6 @@
...
@@ -202,25 +202,6 @@
]
]
},
},
"missing_rubric_prompt"
:
{
"xml"
:
[
"<openassessment>"
,
"<title>Foo</title>"
,
"<assessments>"
,
"<assessment name=
\"
peer-assessment
\"
start=
\"
2014-02-27T09:46:28
\"
due=
\"
2014-03-01T00:00:00
\"
must_grade=
\"
5
\"
must_be_graded_by=
\"
3
\"
/>"
,
"</assessments>"
,
"<rubric>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
"<option points=
\"
0
\"
><name>No</name><explanation>No explanation</explanation></option>"
,
"<option points=
\"
2
\"
><name>Yes</name><explanation>Yes explanation</explanation></option>"
,
"</criterion>"
,
"</rubric>"
,
"</openassessment>"
]
},
"missing_option_points"
:
{
"missing_option_points"
:
{
"xml"
:
[
"xml"
:
[
"<openassessment>"
,
"<openassessment>"
,
...
...
apps/openassessment/xblock/test/test_openassessment.py
View file @
570d587b
...
@@ -54,6 +54,16 @@ class TestOpenAssessment(XBlockHandlerTestCase):
...
@@ -54,6 +54,16 @@ class TestOpenAssessment(XBlockHandlerTestCase):
expected_prompt
=
u"<p><br />Line 1</p><p>Line 2</p><p>Line 3<br /></p>"
expected_prompt
=
u"<p><br />Line 1</p><p>Line 2</p><p>Line 3<br /></p>"
self
.
assertIn
(
expected_prompt
,
xblock_fragment
.
body_html
())
self
.
assertIn
(
expected_prompt
,
xblock_fragment
.
body_html
())
@scenario
(
'data/empty_prompt.xml'
)
def
test_prompt_intentionally_empty
(
self
,
xblock
):
# Verify that prompts intentionally left empty don't create DOM elements
xblock_fragment
=
self
.
runtime
.
render
(
xblock
,
"student_view"
)
body_html
=
xblock_fragment
.
body_html
()
present_prompt_text
=
"you'll provide a response to the question"
missing_article
=
u'<article class="openassessment__prompt'
self
.
assertIn
(
present_prompt_text
,
body_html
)
self
.
assertNotIn
(
missing_article
,
body_html
)
@scenario
(
'data/basic_scenario.xml'
)
@scenario
(
'data/basic_scenario.xml'
)
def
test_page_load_updates_workflow
(
self
,
xblock
):
def
test_page_load_updates_workflow
(
self
,
xblock
):
...
...
apps/openassessment/xblock/xml.py
View file @
570d587b
...
@@ -136,9 +136,10 @@ def _serialize_rubric(rubric_root, oa_block):
...
@@ -136,9 +136,10 @@ def _serialize_rubric(rubric_root, oa_block):
Returns:
Returns:
None
None
"""
"""
# Rubric prompt (default to empty text)
# Rubric prompt (default to empty text); None indicates no input element
prompt
=
etree
.
SubElement
(
rubric_root
,
'prompt'
)
if
oa_block
.
prompt
is
not
None
:
prompt
.
text
=
unicode
(
oa_block
.
prompt
)
prompt
=
etree
.
SubElement
(
rubric_root
,
'prompt'
)
prompt
.
text
=
unicode
(
oa_block
.
prompt
)
# Criteria
# Criteria
criteria_list
=
oa_block
.
rubric_criteria
criteria_list
=
oa_block
.
rubric_criteria
...
@@ -293,7 +294,7 @@ def _parse_rubric_xml(rubric_root):
...
@@ -293,7 +294,7 @@ def _parse_rubric_xml(rubric_root):
if
prompt_el
is
not
None
:
if
prompt_el
is
not
None
:
rubric_dict
[
'prompt'
]
=
_safe_get_text
(
prompt_el
)
rubric_dict
[
'prompt'
]
=
_safe_get_text
(
prompt_el
)
else
:
else
:
r
aise
UpdateFromXmlError
(
_
(
'Every "criterion" element must contain a "prompt" element.'
))
r
ubric_dict
[
'prompt'
]
=
None
feedback_prompt_el
=
rubric_root
.
find
(
'feedbackprompt'
)
feedback_prompt_el
=
rubric_root
.
find
(
'feedbackprompt'
)
if
feedback_prompt_el
is
not
None
:
if
feedback_prompt_el
is
not
None
:
...
...
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