Add in correctness display for open ended response

This commit is contained in:
Vik Paruchuri
2013-01-04 17:42:42 -05:00
parent ccefeccecc
commit 9ba57ad5df
2 changed files with 9 additions and 3 deletions

View File

@@ -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)

View File

@@ -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>