Allow tolerance to be specified as array (like fraction and feedback) to
improve GIFT format compatibility.
This commit is contained in:
@@ -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"); ?>" />±
|
||||
<input align="left" type="text" id="acceptederror0" name="tolerance[]" size="10" value="<?php p($tolerance); ?>" alt="<?php print_string("acceptederror", "quiz"); ?>" />±
|
||||
<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
|
||||
|
||||
Reference in New Issue
Block a user