Commit 0c0935dd by Will Daly

Self then peer

Added self-->peer scenarios to the test course

Added test case for self-->peer
parent fa455174
......@@ -64,8 +64,9 @@ class SelfAssessmentMixin(object):
# and `workflow_status` will be None.
workflow = self.get_workflow_info()
workflow_status = workflow.get('status')
self_complete = workflow.get('status_details', {}).get('self', {}).get('complete', False)
if workflow_status == 'waiting' or workflow_status == 'done':
if self_complete:
path = 'openassessmentblock/self/oa_self_complete.html'
elif workflow_status == 'self' or problem_closed:
assessment = self_api.get_assessment(workflow.get("submission_uuid"))
......
......@@ -77,11 +77,11 @@
<select criterion="form" option="Old-timey letters"/>
</example>
</assessment>
<assessment name="self-assessment" />
<assessment name="peer-assessment"
start="2013-12-20T19:00-7:00"
due="2014-12-21T22:22-7:00"
must_grade="1"
must_be_graded_by="1" />
<assessment name="self-assessment" />
</assessments>
</openassessment>
......@@ -37,9 +37,27 @@
"is_released": false
},
"self_before_peer": {
"valid": false,
"valid": true,
"assessments": [
{
"name": "self-assessment"
},
{
"name": "peer-assessment",
"must_grade": 5,
"must_be_graded_by": 3
}
],
"current_assessments": null,
"is_released": false
},
"student_training_self_then_peer": {
"valid": true,
"assessments": [
{
"name": "student-training"
},
{
"name": "self-assessment"
},
{
......
......@@ -16,7 +16,7 @@
</criterion>
</rubric>
<assessments>
<assessment name="self-assessment" />
<assessment name="peer-assessment" />
<assessment name="peer-assessment" />
</assessments>
</openassessment>
<openassessment>
<title>Open Assessment Test</title>
<prompt>
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.
</prompt>
<rubric>
<prompt>Read for conciseness, clarity of thought, and form.</prompt>
<criterion>
<name>𝓒𝓸𝓷𝓬𝓲𝓼𝓮</name>
<prompt>How concise is it?</prompt>
<option points="3">
<name>ﻉซƈﻉɭɭﻉกՇ</name>
<explanation>Extremely concise</explanation>
</option>
<option points="2">
<name>Ġööḋ</name>
<explanation>Concise</explanation>
</option>
<option points="1">
<name>ק๏๏г</name>
<explanation>Wordy</explanation>
</option>
</criterion>
<criterion>
<name>Form</name>
<prompt>How well-formed is it?</prompt>
<option points="3">
<name>Good</name>
<explanation>Good</explanation>
</option>
<option points="2">
<name>Fair</name>
<explanation>Fair</explanation>
</option>
<option points="1">
<name>Poor</name>
<explanation>Poor</explanation>
</option>
</criterion>
</rubric>
<assessments>
<assessment name="self-assessment" />
<assessment name="peer-assessment" must_grade="5" must_be_graded_by="3" />
</assessments>
</openassessment>
......@@ -168,15 +168,36 @@ class TestSelfAssessmentRender(XBlockHandlerTestCase):
@scenario('data/self_assessment_open.xml', user_id='James Brown')
def test_open_in_waiting_for_peer_step(self, xblock):
# Simulate the workflow status being "waiting"
# Currently, this implies that we've completed the self assessment module,
# but this may change in the future.
# In the peer-->self configuration, if we're done with the
# self step, but not with the peer step (because we're waiting
# to be assessed), then the self step should display as completed.
xblock.create_submission(
xblock.get_student_item_dict(), u"𝓟𝓪𝓼𝓼 𝓽𝓱𝓮 𝓹𝓮𝓪𝓼"
)
self._assert_path_and_context(
xblock, 'openassessmentblock/self/oa_self_complete.html', {},
workflow_status='waiting'
workflow_status='waiting',
status_details={
'self': {'complete': True},
'peer': {'complete': False}
}
)
@scenario('data/self_then_peer.xml', user_id="The Bee Gees")
def test_self_then_peer(self, xblock):
xblock.create_submission(
xblock.get_student_item_dict(), u"Stayin' alive!"
)
# In the self --> peer configuration, self can be complete
# if our status is "peer"
self._assert_path_and_context(
xblock, 'openassessmentblock/self/oa_self_complete.html', {},
workflow_status="peer",
status_details={
'self': {'complete': True},
'peer': {'complete': False}
}
)
@scenario('data/self_assessment_open.xml', user_id='James Brown')
......@@ -296,7 +317,8 @@ class TestSelfAssessmentRender(XBlockHandlerTestCase):
def _assert_path_and_context(
self, xblock, expected_path, expected_context,
workflow_status=None, submission_uuid=None
workflow_status=None, status_details=None,
submission_uuid=None
):
"""
Render the self assessment step and verify:
......@@ -310,11 +332,19 @@ class TestSelfAssessmentRender(XBlockHandlerTestCase):
Kwargs:
workflow_status (str): If provided, simulate this status from the workflow API.
workflow_status (str): If provided, simulate these details from the workflow API.
submission_uuid (str): If provided, simulate this submision UUI for the current workflow.
"""
if workflow_status is not None:
# Assume a peer-->self flow by default
if status_details is None:
status_details = {
'peer': {'complete': workflow_status == 'done'},
'self': {'complete': workflow_status in ['waiting', 'done']}
}
xblock.get_workflow_info = mock.Mock(return_value={
'status': workflow_status,
'status_details': status_details,
'submission_uuid': submission_uuid
})
path, context = xblock.self_path_and_context()
......
......@@ -33,8 +33,7 @@ class AssessmentValidationTest(TestCase):
self.assertFalse(success)
self.assertGreater(len(msg), 0)
# Make sure only legal assessment combinations are allowed. For now, that's
# (peer -> self), and (self)
# Make sure only legal assessment combinations are allowed.
@ddt.file_data('data/assessment_combo.json')
def test_enforce_assessment_combo_restrictions(self, data):
self._assert_validation(
......
......@@ -62,8 +62,10 @@ def _is_valid_assessment_sequence(assessments):
['self-assessment'],
['peer-assessment'],
['peer-assessment', 'self-assessment'],
['self-assessment', 'peer-assessment'],
['student-training', 'peer-assessment'],
['student-training', 'peer-assessment', 'self-assessment'],
['student-training', 'self-assessment', 'peer-assessment'],
]
sequence = [asmnt.get('name') for asmnt in assessments]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment