mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
Merge branch 'MDL-30167' of git://github.com/timhunt/moodle
This commit is contained in:
commit
b22dc5374c
@ -641,16 +641,17 @@ class qtype_numerical_answer_processor {
|
||||
|
||||
$numberstring = $matches[0];
|
||||
if ($this->unitsbefore) {
|
||||
$unit = substr($response, 0, -strlen($numberstring));
|
||||
// substr returns false when it means '', so cast back to string.
|
||||
$unit = (string) substr($response, 0, -strlen($numberstring));
|
||||
} else {
|
||||
$unit = substr($response, strlen($numberstring));
|
||||
$unit = (string) substr($response, strlen($numberstring));
|
||||
}
|
||||
|
||||
if (!is_null($separateunit)) {
|
||||
$unit = $separateunit;
|
||||
}
|
||||
|
||||
if ($unit && $this->is_known_unit($unit)) {
|
||||
if ($this->is_known_unit($unit)) {
|
||||
$multiplier = 1 / $this->units[$unit];
|
||||
} else {
|
||||
$multiplier = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user