mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
Fixed glaring error in Match format
This commit is contained in:
parent
7d95c2b824
commit
971a7ce06f
@ -61,28 +61,36 @@ function writequestion( $question ) {
|
||||
break;
|
||||
case SHORTANSWER:
|
||||
$expout .= "<ul class=\"shortanswer\">\n";
|
||||
$count = 0;
|
||||
foreach($question->answers as $answer) {
|
||||
$ans_text = $this->repchar( $answer->answer );
|
||||
$expout .= " <li>$ans_text</li><br />\n";
|
||||
$expout .= " <input name=\"quest_{$id}_$count\" type=\"text\" /></li>\n";
|
||||
++$count;
|
||||
}
|
||||
$expout .= " <li><input name=\"quest_$id\" type=\"text\" /></li>\n";
|
||||
$expout .= "</ul>\n";
|
||||
break;
|
||||
case NUMERICAL:
|
||||
$expout .= "<p class=\"numerical\">\n";
|
||||
$expout .= " <input name=\"quest_$id\" type=\"text\" />\n";
|
||||
$expout .= "</p>\n";
|
||||
$expout .= "<ul class=\"numerical\">\n";
|
||||
$expout .= " <li><input name=\"quest_$id\" type=\"text\" /></li>\n";
|
||||
$expout .= "</ul>\n";
|
||||
break;
|
||||
case MATCH:
|
||||
$expout .= "<ul class=\"match\">\n";
|
||||
$count = 0;
|
||||
|
||||
// build answer list
|
||||
$ans_list = array();
|
||||
foreach($question->subquestions as $subquestion) {
|
||||
$ans_text = $this->repchar( $subquestion->questiontext );
|
||||
$expout .= " <li>$ans_text</li><br />\n";
|
||||
$expout .= " <input name=\"quest_{$id}_$count\" type=\"text\" /></li>\n";
|
||||
++$count;
|
||||
$ans_list[] = $this->repchar( $subquestion->answertext );
|
||||
}
|
||||
shuffle( $ans_list ); // random display order
|
||||
|
||||
// build drop down for answers
|
||||
$dropdown = "<select name=\"quest_$id\">\n";
|
||||
foreach($ans_list as $ans) {
|
||||
$dropdown .= "<option value=\"$ans\">$ans</option>\n";
|
||||
}
|
||||
$dropdown .= "</select>\n";
|
||||
|
||||
// finally display
|
||||
foreach($question->subquestions as $subquestion) {
|
||||
$quest_text = $this->repchar( $subquestion->questiontext );
|
||||
$expout .= " <li>$quest_text</li>\n";
|
||||
$expout .= $dropdown;
|
||||
}
|
||||
$expout .= "</ul>\n";
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user