Commit 9ba57ad5 by Vik Paruchuri

Add in correctness display for open ended response

parent ccefecce
......@@ -629,7 +629,12 @@ class OpenEndedModule():
if self.state != self.INITIAL:
latest = self.latest_answer()
previous_answer = latest if latest is not None else self.initial_display
feedback = self.latest_feedback()
score= self.latest_score()
correct = "correct" if is_submission_correct else 'incorrect'
else:
feedback=""
correct=""
previous_answer = self.initial_display
context = {
......@@ -640,8 +645,9 @@ class OpenEndedModule():
'rows' : 30,
'cols' : 80,
'id' : 'open_ended',
'msg' : self.latest_feedback(),
'msg' : feedback,
'child_type' : 'openended',
'correct' : correct,
}
html = system.render_template('open_ended.html', context)
......
......@@ -9,9 +9,9 @@
<div class="message-wrapper">
% if state == 'initial':
<span class="unanswered" style="display:inline-block;" id="status_${id}">Unanswered</span>
% elif state == 'done':
% elif state == 'done' and correct=='incorrect':
<span class="correct" id="status_${id}">Correct</span>
% elif state == 'incorrect':
% elif state == 'done' and correct=='correct':
<span class="incorrect" id="status_${id}">Incorrect</span>
% elif state == 'assessing':
<span class="grading" id="status_${id}">Submitted for grading</span>
......
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