Merge branch 'MDL-70966-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user