MDL-39945 qtype multichoice was not comparing blank responses correctly.

This commit is contained in:
Tim Hunt
2013-06-04 15:54:44 +08:00
committed by Dan Poltawski
parent 94572e5c93
commit 22be561eb6
4 changed files with 188 additions and 116 deletions
+3 -3
View File
@@ -757,16 +757,16 @@ abstract class question_utils {
public static function arrays_same_at_key_integer(
array $array1, array $array2, $key) {
if (array_key_exists($key, $array1)) {
$value1 = $array1[$key];
$value1 = (int) $array1[$key];
} else {
$value1 = 0;
}
if (array_key_exists($key, $array2)) {
$value2 = $array2[$key];
$value2 = (int) $array2[$key];
} else {
$value2 = 0;
}
return ((integer) $value1) === ((integer) $value2);
return $value1 === $value2;
}
private static $units = array('', 'i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii', 'viii', 'ix');