From dd192b2692a74510083ef781f9598b58eac09e70 Mon Sep 17 00:00:00 2001 From: michaelpenne Date: Wed, 29 Jun 2005 23:02:12 +0000 Subject: [PATCH] Numerical import was still looking at min/max arrays. I changed it so numerical will now subtract the tolerance from the answer to get the min and add the tolerance to the answer to get the max --- mod/lesson/locallib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index c03551e2fed..32c9bd20e5a 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -182,7 +182,10 @@ function lesson_save_question_options($question) { $answer->jumpto = LESSON_NEXTPAGE; $answer->timecreated = $timenow; $answer->grade = $question->fraction[$key] * 100; - $answer->answer = $question->min[$key].":".$question->max[$key]; + $min = $question->answer[$key] - $question->tolerance[$key]; + $max = $question->answer[$key] + $question->tolerance[$key]; + $answer->answer = $min.":".$max; + // $answer->answer = $question->min[$key].":".$question->max[$key]; original line for min/max $answer->response = $question->feedback[$key]; if (!$answer->id = insert_record("lesson_answers", $answer)) { $result->error = "Could not insert numerical quiz answer!";