From a6e090b15ff3cb2c1bd0d458037cfb18587945be Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Wed, 22 Apr 2015 12:38:23 +0200 Subject: [PATCH] MDL-49913 mod_lesson: round question grades on import --- mod/lesson/format.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/lesson/format.php b/mod/lesson/format.php index bf76d73a099..397640844d1 100644 --- a/mod/lesson/format.php +++ b/mod/lesson/format.php @@ -73,7 +73,7 @@ function lesson_save_question_options($question, $lesson) { $answer->jumpto = LESSON_NEXTPAGE; } $answer->timecreated = $timenow; - $answer->grade = $question->fraction[$key] * 100; + $answer->grade = round($question->fraction[$key] * 100); $answer->answer = $dataanswer; $answer->response = $question->feedback[$key]['text']; $answer->responseformat = $question->feedback[$key]['format']; @@ -108,7 +108,7 @@ function lesson_save_question_options($question, $lesson) { $answer->pageid = $question->id; $answer->jumpto = LESSON_NEXTPAGE; $answer->timecreated = $timenow; - $answer->grade = $question->fraction[$key] * 100; + $answer->grade = round($question->fraction[$key] * 100); $min = $question->answer[$key] - $question->tolerance[$key]; $max = $question->answer[$key] + $question->tolerance[$key]; $answer->answer = $min.":".$max; @@ -183,7 +183,7 @@ function lesson_save_question_options($question, $lesson) { $answer->lessonid = $question->lessonid; $answer->pageid = $question->id; $answer->timecreated = $timenow; - $answer->grade = $question->fraction[$key] * 100; + $answer->grade = round($question->fraction[$key] * 100); // changed some defaults /* Original Code if ($answer->grade > 50 ) {