moodle/mod/quiz/randomsamatch.html
moodler 5cdb8a856a Quiz questions now have proper formatting controls.
Any format can be used.  This fixes a number of problems at once,
but the latest one is Bug #1047
2004-02-13 14:01:27 +00:00

99 lines
3.3 KiB
HTML

<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">
<CENTER>
<TABLE cellpadding=5>
<TR valign=top>
<TD align=right><P><B><?php 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><?php 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="<?php p($question->name) ?>">
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</TR>
<tr valign=top>
<td align=right><p><b><?php print_string("introduction", "quiz") ?>:</b></p></td>
<br />
<br />
<br />
<p><font SIZE="1">
<?php
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
helpbutton("text", get_string("helptext"), "moodle", true, true);
}
?>
</font></p>
</td>
<td>
<?php if (isset($err["questiontext"])) {
formerr($err["questiontext"]);
echo "<br />";
}
if (empty($question->questiontext)) {
$question->questiontext = get_string("randomsamatchintro", "quiz");
}
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
if ($usehtmleditor) { /// Trying this out for a while
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';
} else {
echo "<div align=right>";
print_string("formattexttype");
echo ":&nbsp;";
if (!$question->questiontextformat) {
$question->questiontextformat = FORMAT_MOODLE;
}
choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");
helpbutton("textformat", get_string("helpformatting"));
echo "</div>";
}
?>
</td>
</tr>
<TR valign=top>
<TD align=right><P><B><?php print_string("randomsamatchnumber", "quiz") ?>:</B></P></TD>
<TD>
<?php
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="<?php p($question->id) ?>">
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">
<INPUT type="submit" value="<?php print_string("savechanges") ?>">
</CENTER>
</FORM>
<?php
if ($usehtmleditor) {
print_richedit_javascript("theform", "questiontext", "no");
}
?>