Commit f71893fd by Eric Fischer

Merge pull request #901 from edx/efischer/show_ungraded_feedback

TNL-4351 Fix bug with no-option reponses
parents 0f254729 d6738357
......@@ -124,7 +124,11 @@
<div>{{ individual_assessment.title }} - {{ individual_assessment.option.label}}</div>
{% endfor %}
{% elif assessment.points == None %}
<div>{{ assessment.option.label }}</div>
{% if assessment.option != None %}
<div>{{ assessment.option.label }}</div>
{% else %}
<div>{% trans 'Feedback Recorded' %}</div>
{% endif %}
{% endif %}
</td>
{% endfor %}
......
......@@ -31,12 +31,20 @@
<tbody>
{% for criterion in rubric_criteria %}
{% for part in assessment.parts %}
{% if part.option.criterion.name == criterion.name %}
{% if part.criterion.name == criterion.name %}
<tr>
<td class="label">{{ criterion.label }}</td>
<td class="value">{{ part.option.label }}</td>
{% if part.option != None %}
<td class="value">{{ part.option.label }}</td>
{% else %}
<td class="value"></td>
{% endif %}
<td class="value">{{ part.feedback }}</td>
<td class="value">{{ part.option.points }}</td>
{% if part.option != None %}
<td class="value">{{ part.option.points }}</td>
{% else %}
<td class="value"></td>
{% endif %}
<td class="value">{{ criterion.total_value }}</td>
</tr>
{% endif %}
......
<openassessment>
<title>Feedback only criterion</title>
<prompts>
<prompt>
<description>Given the state of the world today, what do you think should be done to combat poverty?</description>
</prompt>
<prompt>
<description>Given the state of the world today, what do you think should be done to combat pollution?</description>
</prompt>
</prompts>
<rubric>
<criterion feedback="required">
<name>vocabulary</name>
<prompt>This criterion accepts only written feedback, so it has no options</prompt>
</criterion>
</rubric>
<assessments>
<assessment name="staff-assessment" required="true"/>
</assessments>
</openassessment>
......@@ -247,6 +247,40 @@ class TestCourseStaff(XBlockHandlerTestCase):
self.assertEquals(1, len(grade_details['criteria'][0]['assessments']))
self.assertEquals('Self Assessment Grade', grade_details['criteria'][0]['assessments'][0]['title'])
@scenario('data/feedback_only_criterion_staff.xml', user_id='Bob')
def test_staff_area_student_info_staff_only_no_options(self, xblock):
# Simulate that we are course staff
xblock.xmodule_runtime = self._create_mock_runtime(
xblock.scope_ids.usage_id, True, False, "Bob"
)
xblock.runtime._services['user'] = NullUserService()
bob_item = STUDENT_ITEM.copy()
bob_item["item_id"] = xblock.scope_ids.usage_id
# Create a submission for Bob, and corresponding workflow.
submission = self._create_submission(
bob_item, prepare_submission_for_serialization(("Bob Answer 1", "Bob Answer 2")), ['staff']
)
# Bob assesses himself as staff.
staff_api.create_assessment(
submission['uuid'],
STUDENT_ITEM["student_id"],
{}, # no options available
{"vocabulary": "Good use of vocabulary!"},
ASSESSMENT_DICT['overall_feedback'],
{'criteria': xblock.rubric_criteria},
)
_, context = xblock.get_student_info_path_and_context("Bob")
self.assertIn(
"Good use of vocabulary!",
self.request(
xblock,
"render_student_info",
urllib.urlencode({"student_username": "Bob"})
)
)
@scenario('data/staff_grade_scenario.xml', user_id='Bob')
def test_staff_area_student_info_staff_only(self, xblock):
# Simulate that we are course staff
......@@ -494,7 +528,7 @@ class TestCourseStaff(XBlockHandlerTestCase):
# Schedule training
response = self.request(xblock, 'schedule_training', json.dumps({}), response_format='json')
self.assertTrue(response['success'], msg=response.get('msg'))
self.assertTrue('workflow_uuid' in response)
self.assertIn('workflow_uuid', response)
@scenario('data/example_based_assessment.xml', user_id='Bob')
def test_not_displaying_schedule_training(self, xblock):
......
......@@ -33,7 +33,7 @@ def load_requirements(*requirements_paths):
setup(
name='ora2',
version='1.1.2',
version='1.1.3',
author='edX',
url='http://github.com/edx/edx-ora2',
description='edx-ora2',
......
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