From 837c7f569684a3331e2e358d9345ef5ca6ef485b 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 790fdeebac6..7c85cb73d0e 100644 --- a/mod/lesson/format.php +++ b/mod/lesson/format.php @@ -96,7 +96,7 @@ function lesson_save_question_options($question, $lesson, $contextid) { $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']; @@ -132,7 +132,7 @@ function lesson_save_question_options($question, $lesson, $contextid) { $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; @@ -210,7 +210,7 @@ function lesson_save_question_options($question, $lesson, $contextid) { $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 ) {