]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17995 replacing is_null() by empty().
authorpichetp <pichetp>
Mon, 26 Jan 2009 01:21:58 +0000 (01:21 +0000)
committerpichetp <pichetp>
Mon, 26 Jan 2009 01:21:58 +0000 (01:21 +0000)
question/type/multianswer/edit_multianswer_form.php
question/type/multianswer/questiontype.php

index d698dd7c62645192d9160b8cdb0f4306f8a59ef2..035962b138efd336661efba67c1a35abef82c1c1 100644 (file)
@@ -36,7 +36,7 @@ class question_edit_multianswer_form extends question_edit_form {
         if ( isset($this->questiondisplay->options->questions) && is_array($this->questiondisplay->options->questions) ) {
             $countsubquestions =0;
             foreach($this->questiondisplay->options->questions as $subquestion){
-                if ($subquestion != ''){
+                if (!empty($subquestion)){
                    $countsubquestions++;
                 }
             }
@@ -97,7 +97,7 @@ class question_edit_multianswer_form extends question_edit_form {
         if (isset($question->id) and $question->id and $question->qtype and $question->questiontext) {
 
             foreach ($question->options->questions as $key => $wrapped) {
-                if($wrapped != ''){
+                if(!empty($wrapped)){
                 // The old way of restoring the definitions is kept to gradually
                 // update all multianswer questions
                 if (empty($wrapped->questiontext)) {
index 0ddc62161dad5c15c87cc403fc24bb450480ad19..ce5c89b6e2a5df94bb51784970dadfa592b9b329 100644 (file)
@@ -101,7 +101,7 @@ class embedded_cloze_qtype extends default_questiontype {
         }
         $sequence = array();
         foreach($question->options->questions as $wrapped) {
-            if (!is_null($wrapped)){
+            if (!empty($wrapped)){
                 // if we still have some old wrapped question ids, reuse the next of them
 
                 if (is_array($oldwrappedquestions) && $oldwrappedquestion = array_shift($oldwrappedquestions)) {
@@ -240,7 +240,7 @@ class embedded_cloze_qtype extends default_questiontype {
         global $QTYPES;
         $responses = array();
         foreach($question->options->questions as $key => $wrapped) {
-            if (!is_null($wrapped)){
+            if (!empty($wrapped)){
                 if ($correct = $QTYPES[$wrapped->qtype]->get_correct_responses($wrapped, $state)) {
                     $responses[$key] = $correct[''];
                 } else {
@@ -258,7 +258,7 @@ class embedded_cloze_qtype extends default_questiontype {
         global $QTYPES;
         $responses = array();
         foreach($question->options->questions as $key => $wrapped) {
-            if (!is_null($wrapped)){
+            if (!empty($wrapped)){
                 if ($correct = $QTYPES[$wrapped->qtype]->get_possible_responses($wrapped)) {
                     $responses += $correct;
                 } else {
@@ -275,7 +275,7 @@ class embedded_cloze_qtype extends default_questiontype {
         global $QTYPES;
         $details = array();
         foreach($question->options->questions as $key => $wrapped) {
-            if (!is_null($wrapped)){
+            if (!empty($wrapped)){
                 $stateforquestion = clone($state);
                 $stateforquestion->responses[''] = $state->responses[$key];
                 $details = array_merge($details, $QTYPES[$wrapped->qtype]->get_actual_response_details($wrapped, $stateforquestion));
@@ -616,7 +616,7 @@ class embedded_cloze_qtype extends default_questiontype {
         $teststate = clone($state);
         $state->raw_grade = 0;
         foreach($question->options->questions as $key => $wrapped) {
-            if (!is_null($wrapped)){
+            if (!empty($wrapped)){
                 if(isset($state->responses[$key])){
                     $state->responses[$key] = $state->responses[$key];
                 }else {