Commit 3f816d0a by Usman Khalid

Student training steps shows example submissions in new format.

TNL-708
parent 2c2192b7
......@@ -72,9 +72,8 @@
{% endwith %}
</header>
<div class="student-training__display__response">
{{ training_essay|linebreaks }}
</div>
{% include "openassessmentblock/oa_submission_answer.html" with answer=training_essay.answer answer_text_label="The response to the question above:" %}
</article>
<form id="student-training--001__assessment" class="student-training__assessment" method="post">
......
......@@ -7,7 +7,7 @@ from xblock.core import XBlock
from openassessment.assessment.api import student_training
from openassessment.workflow import api as workflow_api
from openassessment.workflow.errors import AssessmentWorkflowError
from openassessment.xblock.data_conversion import convert_training_examples_list_to_dict
from openassessment.xblock.data_conversion import convert_training_examples_list_to_dict, create_submission_dict
from .resolve_dates import DISTANT_FUTURE
......@@ -124,7 +124,7 @@ class StudentTrainingMixin(object):
examples
)
if example:
context['training_essay'] = example['answer']
context['training_essay'] = create_submission_dict({'answer': example['answer']}, self.prompts)
context['training_rubric'] = {
'criteria': example['rubric']['criteria'],
'points_possible': example['rubric']['points_possible']
......
......@@ -8,7 +8,9 @@
"training_essay": { "answer": {
"parts": [
{
"prompt": "Given the state of the world today, what do you think should be done to combat poverty?",
"prompt": {
"description": "Given the state of the world today, what do you think should be done to combat poverty?"
},
"text": "This is my answer."
}
]}
......
......@@ -155,7 +155,19 @@ class StudentTrainingAssessTest(StudentTrainingTest):
expected_context["training_num_completed"] = 1
expected_context["training_num_current"] = 2
expected_context["training_essay"] = u"тєѕт αηѕωєя"
expected_context["training_essay"] = {
'answer': {
'parts': [
{
'text': u"тєѕт αηѕωєя",
'prompt': {
'description': u'Given the state of the world today, what do you think should be done to combat poverty?'
}
}
]
}
}
self.assert_path_and_context(xblock, expected_template, expected_context)
resp = self.request(xblock, 'training_assess', json.dumps(selected_data), response_format='json')
......
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