MDL-20296 correcting unit penalty display

This commit is contained in:
Pierre Pichet 2010-05-22 02:22:46 +00:00
parent ff3ad312f0
commit ec3dbcd48c

View file

@ -341,7 +341,7 @@ class question_shortanswer_qtype extends default_questiontype {
if (($state->last_graded->raw_grade < $question->maxgrade) and (QUESTION_EVENTCLOSEANDGRADE != $state->event)) {
if ('' !== $state->last_graded->penalty && ((float)$state->last_graded->penalty) > 0.0) {
// A unit penalty for numerical was applied so display it
if(isset($question->raw_unitpenalty) && $question->raw_unitpenalty > 0.0 ){
if(isset($this->raw_unitpenalty) && $this->raw_unitpenalty > 0.0 ){
echo ' ';
print_string('unitappliedpenalty','qtype_numerical',question_format_grade($cmoptions, $this->raw_unitpenalty));
}