Commit 9ba57ad5 by Vik Paruchuri

Add in correctness display for open ended response

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