Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 603a35322ad2651fee0736ef7b62a027c2030e4c 1 parent 9160e17
michaelpenne authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 mod/lesson/locallib.php
View
5 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!";
Please sign in to comment.
Something went wrong with that request. Please try again.