Add in ability to define score points

This commit is contained in:
Vik Paruchuri
2012-11-12 14:19:04 -05:00
parent ba8781ddf4
commit d5702fc712
2 changed files with 7 additions and 5 deletions

View File

@@ -112,7 +112,7 @@ class SelfAssessmentModule(XModule):
# Used for progress / grading. Currently get credit just for
# completion (doesn't matter if you self-assessed correct/incorrect).
self._max_score = instance_state.get('max_score', MAX_SCORE)
self._max_score = int(self.metadata.get('max_score', MAX_SCORE))
self.attempts = instance_state.get('attempts', 0)
@@ -137,7 +137,6 @@ class SelfAssessmentModule(XModule):
'initial_message': self.get_message_html(),
'state': self.state,
'allow_reset': allow_reset,
'max_score' : self._max_score,
}
html = self.system.render_template('self_assessment_prompt.html', context)
@@ -225,7 +224,9 @@ class SelfAssessmentModule(XModule):
return ''
# we'll render it
context = {'rubric': self.rubric}
context = {'rubric': self.rubric,
'max_score' : self._max_score,
}
if self.state == self.ASSESSING:
context['read_only'] = False

View File

@@ -6,8 +6,9 @@
% if not read_only:
<select name="assessment" class="assessment">
<option value="incorrect">Incorrect</option>
<option value="correct">Correct</option>
%for i in xrange(0,max_score+1):
<option value="${i}">${i}</option>
%endfor
</select>
% endif