Removed notices caused by empty responses
This commit is contained in:
@@ -326,7 +326,7 @@ class question_match_qtype extends default_questiontype {
|
||||
if (isset($state->responses)) {
|
||||
foreach($state->responses as $left=>$right){
|
||||
$lpair = $question->options->subquestions[$left]->questiontext;
|
||||
$rpair = $question->options->subquestions[$right]->answertext;
|
||||
$rpair = $right ? $question->options->subquestions[$right]->answertext : '';
|
||||
$results[$left] = $lpair." : ".$rpair;
|
||||
}
|
||||
return $results;
|
||||
|
||||
@@ -362,7 +362,7 @@ class question_multichoice_qtype extends default_questiontype {
|
||||
$answers = $question->options->answers;
|
||||
if (!empty($state->responses)) {
|
||||
foreach ($state->responses as $aid =>$rid){
|
||||
$answer = $answers[$rid]->answer;
|
||||
$answer = $rid ? $answers[$rid]->answer : '';
|
||||
$responses[] = $answer;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user