Merge branch 'MDL-70966-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Sara Arjona
2021-03-03 09:30:41 +01:00
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -193,7 +193,7 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group {
}
}
$requestvalue=$value;
if ($value == 0) {
if ($value == 0 || $value === '') {
$value = $this->_options['defaulttime'];
if (!$value) {
$value = time();
+1 -1
View File
@@ -745,7 +745,7 @@ class structure {
}
// Check the target page number is OK.
if ($page == 0) {
if ($page == 0 || $page === '') {
$page = 1;
}
if (($moveafterslotnumber > 0 && $page < $this->get_page_number_for_slot($moveafterslotnumber)) ||
@@ -729,7 +729,7 @@ class qformat_gift_test extends question_testcase {
'files' => array(),
),
),
'tolerance' => array(2, 0),
'tolerance' => array(2, ''),
);
// Repeated test for better failure messages.
+1 -1
View File
@@ -1132,7 +1132,7 @@ END;
'format' => FORMAT_HTML),
array('text' => 'Completely wrong.',
'format' => FORMAT_HTML));
$expectedq->tolerance = array(0.001, 1, 0);
$expectedq->tolerance = array(0.001, 1, '');
$this->assert(new question_check_specified_fields_expectation($expectedq), $q);
}
+1 -1
View File
@@ -357,7 +357,7 @@ class qtype_numerical_answer extends question_answer {
public function __construct($id, $answer, $fraction, $feedback, $feedbackformat, $tolerance) {
parent::__construct($id, $answer, $fraction, $feedback, $feedbackformat);
$this->tolerance = abs($tolerance);
$this->tolerance = abs((float)$tolerance);
}
public function get_tolerance_interval() {