Allow tolerance to be specified as array (like fraction and feedback) to

improve GIFT format compatibility.
This commit is contained in:
thepurpleblob
2005-05-17 14:29:28 +00:00
parent b5abaacf51
commit 73ffd0ac03
2 changed files with 2 additions and 3 deletions
@@ -81,7 +81,7 @@
<tr valign="top">
<td align="right"><b><?php print_string("acceptederror", "quiz"); ?>:</b></td>
<td>
<input align="left" type="text" id="acceptederror0" name="tolerance" size="10" value="<?php p($tolerance); ?>" alt="<?php print_string("acceptederror", "quiz"); ?>" />&plusmn;
<input align="left" type="text" id="acceptederror0" name="tolerance[]" size="10" value="<?php p($tolerance); ?>" alt="<?php print_string("acceptederror", "quiz"); ?>" />&plusmn;
<input type="hidden" name="fraction[]" value="1" />
</td>
</tr>
@@ -51,7 +51,6 @@ class quiz_numerical_qtype extends quiz_shortanswer_qtype {
}
}
}
return true;
}
@@ -133,7 +132,7 @@ class quiz_numerical_qtype extends quiz_shortanswer_qtype {
}
$options->question = $question->id;
$options->answer = $answer->id;
$options->tolerance = $this->apply_unit($question->tolerance, $units);
$options->tolerance = $this->apply_unit($question->tolerance[$key], $units);
// Save options
if (isset($options->id)) { // reusing existing record