Bug 5971 - Allow matching questions to have extra wrong answers - supplimental. And another one.

This commit is contained in:
tjhunt 2006-07-05 12:19:11 +00:00
parent 974383f976
commit 645d76103b

View file

@ -310,13 +310,13 @@ class question_match_qtype extends default_questiontype {
$answers = array(); $answers = array();
if (is_array($question->options->subquestions)) { if (is_array($question->options->subquestions)) {
foreach ($question->options->subquestions as $aid => $answer) { foreach ($question->options->subquestions as $aid => $answer) {
if ($answer->questiontext) {
$r = new stdClass; $r = new stdClass;
$r->answer = $answer->questiontext . ": " . $answer->answertext; $r->answer = $answer->questiontext . ": " . $answer->answertext;
$r->credit = 1; $r->credit = 1;
$answers[$aid] = $r; $answers[$aid] = $r;
} }
} else { }
$answers[] = "error"; // just for debugging, eliminate
} }
$result = new stdClass; $result = new stdClass;
$result->id = $question->id; $result->id = $question->id;