Commit 605a1d26 by Waheed Ahmed

Merge pull request #693 from edx/waheed/tnl2000-fix-student-submission-on-grading

Fixed student can't view their submission after recieving grades.
parents 82c2e563 25f18a00
...@@ -28,9 +28,7 @@ ...@@ -28,9 +28,7 @@
<article class="submission__answer__display step__content__section"> <article class="submission__answer__display step__content__section">
<h3 class="submission__answer__display__title">{% trans "Your Response" %}</h3> <h3 class="submission__answer__display__title">{% trans "Your Response" %}</h3>
<div class="submission__answer__display__content"> {% include "openassessmentblock/oa_submission_answer.html" with answer=student_submission.answer answer_text_label="Your response to the question above:" %}
{{ student_submission.answer.text|linebreaks }}
</div>
{% if allow_file_upload and file_url %} {% if allow_file_upload and file_url %}
<h3 class="submission__answer__display__title"> <h3 class="submission__answer__display__title">
......
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
<article class="submission__answer__display"> <article class="submission__answer__display">
<h3 class="submission__answer__display__title">{% trans "Your Response" %}</h3> <h3 class="submission__answer__display__title">{% trans "Your Response" %}</h3>
<div class="submission__answer__display__content"> {% include "openassessmentblock/oa_submission_answer.html" with answer=student_submission.answer answer_text_label="Your response to the question above:" %}
{{ student_submission.answer.text|linebreaks }}
</div>
{% if allow_file_upload and file_url %} {% if allow_file_upload and file_url %}
<h3 class="submission__answer__display__title">{% trans "Your Image" %}</h3> <h3 class="submission__answer__display__title">{% trans "Your Image" %}</h3>
......
...@@ -13,6 +13,8 @@ from openassessment.assessment.api import ai as ai_api ...@@ -13,6 +13,8 @@ from openassessment.assessment.api import ai as ai_api
from openassessment.assessment.errors import SelfAssessmentError, PeerAssessmentError from openassessment.assessment.errors import SelfAssessmentError, PeerAssessmentError
from submissions import api as sub_api from submissions import api as sub_api
from data_conversion import create_submission_dict
class GradeMixin(object): class GradeMixin(object):
"""Grade Mixin introduces all handlers for displaying grades """Grade Mixin introduces all handlers for displaying grades
...@@ -133,7 +135,7 @@ class GradeMixin(object): ...@@ -133,7 +135,7 @@ class GradeMixin(object):
context = { context = {
'score': score, 'score': score,
'feedback_text': feedback_text, 'feedback_text': feedback_text,
'student_submission': student_submission, 'student_submission': create_submission_dict(student_submission, self.prompts),
'peer_assessments': peer_assessments, 'peer_assessments': peer_assessments,
'self_assessment': self_assessment, 'self_assessment': self_assessment,
'example_based_assessment': example_based_assessment, 'example_based_assessment': example_based_assessment,
......
...@@ -61,6 +61,9 @@ class TestGrade(XBlockHandlerTestCase): ...@@ -61,6 +61,9 @@ class TestGrade(XBlockHandlerTestCase):
self.assertIn(u'єאςєɭɭєภՇ ฬ๏гк!', resp.decode('utf-8')) self.assertIn(u'єאςєɭɭєภՇ ฬ๏гк!', resp.decode('utf-8'))
self.assertIn(u'Good job!', resp.decode('utf-8')) self.assertIn(u'Good job!', resp.decode('utf-8'))
# Verify that student submission is in the view
self.assertIn(self.SUBMISSION[1], resp.decode('utf-8'))
# Verify that the submission and peer steps show that we're graded # Verify that the submission and peer steps show that we're graded
# This isn't strictly speaking part of the grade step rendering, # This isn't strictly speaking part of the grade step rendering,
# but we've already done all the setup to get to this point in the flow, # but we've already done all the setup to get to this point in the flow,
...@@ -69,6 +72,9 @@ class TestGrade(XBlockHandlerTestCase): ...@@ -69,6 +72,9 @@ class TestGrade(XBlockHandlerTestCase):
self.assertIn('response', resp.lower()) self.assertIn('response', resp.lower())
self.assertIn('complete', resp.lower()) self.assertIn('complete', resp.lower())
# Verify that student submission is in the view
self.assertIn(self.SUBMISSION[1], resp.decode('utf-8'))
resp = self.request(xblock, 'render_peer_assessment', json.dumps(dict())) resp = self.request(xblock, 'render_peer_assessment', json.dumps(dict()))
self.assertIn('peer', resp.lower()) self.assertIn('peer', resp.lower())
self.assertIn('complete', resp.lower()) self.assertIn('complete', resp.lower())
......
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