Removed notices caused by empty responses

This commit is contained in:
gustav_delius
2006-03-27 08:38:55 +00:00
parent 616ae6d5fe
commit ffa1f07890
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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 {