MDL-49913 mod_lesson: round question grades on import

This commit is contained in:
Jean-Michel Vedrine
2015-04-23 08:31:05 +02:00
parent b4a592aa3b
commit a6e090b15f
+3 -3
View File
@@ -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 ) {