MDL-17995 replacing is_null() by empty().
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user