moodle/mod/quiz/randomsamatch.html

76 lines
2.4 KiB
HTML
Raw Normal View History

<FORM name="theform" method="post" <?=$onsubmit ?> action="question.php">
<CENTER>
<TABLE cellpadding=5>
<TR valign=top>
<TD align=right><P><B><? print_string("category", "quiz") ?>:</B></P></TD>
<TD>
<?PHP echo $categories[$question->category]; ?>
<input type="hidden" name="category" value="<?PHP echo "$question->category"; ?>">
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><? print_string("questionname", "quiz") ?>:</B></P></TD>
<TD>
<?PHP
if (empty($question->name)) {
$question->name = get_string("randomsamatch", "quiz");
}
?>
<INPUT type="text" name="name" size=40 value="<? p($question->name) ?>">
<? if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><? print_string("introduction", "quiz") ?>:</B></P></TD>
<TD>
<? if (isset($err["questiontext"])) {
formerr($err["questiontext"]);
echo "<BR \>";
}
if (empty($question->questiontext)) {
$question->questiontext = get_string("randomsamatchintro", "quiz");
}
print_textarea($usehtmleditor, 15, 60, 595, 300, "questiontext", $question->questiontext);
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle");
} else {
helpbutton("text", get_string("helptext"), "moodle");
}
?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><? print_string("randomsamatchnumber", "quiz") ?>:</B></P></TD>
<TD>
<?
if ($numberavailable < 2) {
echo "ERROR";
$maxrandom=2;
} else if ($numberavailable < 6) {
$maxrandom = $numberavailable;
} else {
$maxrandom = QUIZ_MAX_NUMBER_ANSWERS;
}
for ($i=2;$i<=$maxrandom;$i++) {
$menu[$i] = $i;
}
choose_from_menu($menu, "choose", "$options->choose", "");
unset($menu);
?>
</TD>
</TR>
</TABLE>
<INPUT type="hidden" name=id value="<? p($question->id) ?>">
<INPUT type="hidden" name=qtype value="<? p($question->qtype) ?>">
<INPUT type="submit" value="<? print_string("savechanges") ?>">
</CENTER>
</FORM>
<?
if ($usehtmleditor) {
print_richedit_javascript("theform", "questiontext", "no");
}
?>