mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Bug 5971 - Allow matching questions to have extra wrong answers - supplimental. And another one.
This commit is contained in:
parent
974383f976
commit
645d76103b
1 changed files with 8 additions and 8 deletions
|
@ -309,14 +309,14 @@ class question_match_qtype extends default_questiontype {
|
||||||
function get_all_responses($question, $state) {
|
function get_all_responses($question, $state) {
|
||||||
$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) {
|
||||||
$r = new stdClass;
|
if ($answer->questiontext) {
|
||||||
$r->answer = $answer->questiontext." : ".$answer->answertext;
|
$r = new stdClass;
|
||||||
$r->credit = 1;
|
$r->answer = $answer->questiontext . ": " . $answer->answertext;
|
||||||
$answers[$aid] = $r;
|
$r->credit = 1;
|
||||||
|
$answers[$aid] = $r;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$answers[] = "error"; // just for debugging, eliminate
|
|
||||||
}
|
}
|
||||||
$result = new stdClass;
|
$result = new stdClass;
|
||||||
$result->id = $question->id;
|
$result->id = $question->id;
|
||||||
|
@ -332,7 +332,7 @@ class question_match_qtype extends default_questiontype {
|
||||||
foreach ($subquestions as $key => $sub) {
|
foreach ($subquestions as $key => $sub) {
|
||||||
foreach ($responses as $ind => $code) {
|
foreach ($responses as $ind => $code) {
|
||||||
if (isset($sub->options->answers[$code])) {
|
if (isset($sub->options->answers[$code])) {
|
||||||
$results[$ind] = $subquestions[$ind]->questiontext . ":" . $sub->options->answers[$code]->answer;
|
$results[$ind] = $subquestions[$ind]->questiontext . ": " . $sub->options->answers[$code]->answer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue