]> git.mjollnir.org Git - moodle.git/commitdiff
fix notices: MDL-15974 Some systems that were upgraded have nullable columns, leading...
authortjhunt <tjhunt>
Thu, 27 Nov 2008 05:12:11 +0000 (05:12 +0000)
committertjhunt <tjhunt>
Thu, 27 Nov 2008 05:12:11 +0000 (05:12 +0000)
A new install has NOT NULL DEFAULT 0.

mod/quiz/accessrules.php
question/type/multichoice/questiontype.php

index 92d22fc10a123a2eec433ff70cbeb62756280b40..7ef4cec21a857f8c729e6a4cd61f9e2b83aa13ca 100644 (file)
@@ -29,20 +29,20 @@ class quiz_access_manager {
             $this->_rules[] = new num_attempts_access_rule($this->_quizobj, $this->_timenow);
         }
         $this->_rules[] = new open_close_date_access_rule($this->_quizobj, $this->_timenow);
-        if ($quiz->timelimit && !$canignoretimelimits) {
+        if (!empty($quiz->timelimit) && !$canignoretimelimits) {
             $this->_rules[] = new time_limit_access_rule($this->_quizobj, $this->_timenow);
         }
-        if ($quiz->delay1 || $quiz->delay2) {
+        if (!empty($quiz->delay1) || !empty($quiz->delay2)) {
             $this->_rules[] = new inter_attempt_delay_access_rule($this->_quizobj, $this->_timenow);
         }
-        if ($quiz->subnet) {
+        if (!empty($quiz->subnet)) {
             $this->_rules[] = new ipaddress_access_rule($this->_quizobj, $this->_timenow);
         }
-        if ($quiz->password) {
+        if (!empty($quiz->password)) {
             $this->_passwordrule = new password_access_rule($this->_quizobj, $this->_timenow);
             $this->_rules[] = $this->_passwordrule;
         }
-        if ($quiz->popup) {
+        if (!empty($quiz->popup)) {
             $this->_securewindowrule = new securewindow_access_rule($this->_quizobj, $this->_timenow);
             $this->_rules[] = $this->_securewindowrule;
         }
index f8d3c7af3a259ec83288d27f16f0417b9d3f41d3..6e64dd86d93209e4f3d97ddb65571a1f5a2b6ba6 100644 (file)
@@ -167,7 +167,7 @@ class question_multichoice_qtype extends default_questiontype {
         $answerids = array_values(array_map(create_function('$val',
          'return $val->id;'), $question->options->answers));
         // Shuffle the answers if required
-        if ($cmoptions->shuffleanswers and $question->options->shuffleanswers) {
+        if (!empty($cmoptions->shuffleanswers) and !empty($question->options->shuffleanswers)) {
            $answerids = swapshuffle($answerids);
         }
         $state->options->order = $answerids;