Permalink
Browse files

MDL-26445 question -fix numerical unit grade

fix unit penalty grading and display


Signed-off-by: ppichet <pichet.pierre@uqam.ca>
  • Loading branch information...
1 parent 48fe5c6 commit 8f63ab1f447b1b5943286783a86ca9c1e34c65fa @ppichet ppichet committed with timhunt Feb 16, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 question/type/numerical/questiontype.php
  2. +1 −1 question/type/shortanswer/questiontype.php
View
4 question/type/numerical/questiontype.php
@@ -608,7 +608,7 @@ function print_question_formulation_and_controls(&$question, &$state, $cmoptions
if($question->options->unitgradingtype == 1){
$raw_unitpenalty = $question->options->unitpenalty * $rawgrade ;
}else {
- $raw_unitpenalty = $question->options->unitpenalty * $question->maxgrade;
+ $raw_unitpenalty = $question->options->unitpenalty ;
}
$state->options->raw_unitpenalty = $raw_unitpenalty ;
}
@@ -818,7 +818,7 @@ function grade_responses(&$question, &$state, $cmoptions) {
if($question->options->unitgradingtype == 1){
$raw_unitpenalty = $question->options->unitpenalty * $state->raw_grade ;
}else {
- $raw_unitpenalty = $question->options->unitpenalty * $question->maxgrade;
+ $raw_unitpenalty = $question->options->unitpenalty ;
}
$state->raw_grade -= $raw_unitpenalty ;
}
View
2 question/type/shortanswer/questiontype.php
@@ -318,7 +318,7 @@ function print_question_grading_details(&$question, &$state, $cmoptions, $option
// waiting for the new question engine code for a permanent one
if(isset($state->options->raw_unitpenalty) && $state->options->raw_unitpenalty > 0.0 ){
echo ' ';
- print_string('unitappliedpenalty','qtype_numerical',question_format_grade($cmoptions, $state->options->raw_unitpenalty ));
+ print_string('unitappliedpenalty','qtype_numerical',question_format_grade($cmoptions, $state->options->raw_unitpenalty * $question->maxgrade ));
}
if ($cmoptions->penaltyscheme) {
// print details of grade adjustment due to penalties

0 comments on commit 8f63ab1

Please sign in to comment.