2003-09-09 12:34:51 +00:00
|
|
|
<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">
|
2003-02-24 10:37:56 +00:00
|
|
|
<CENTER>
|
|
|
|
<TABLE cellpadding=5>
|
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
|
2003-02-24 10:37:56 +00:00
|
|
|
<TD>
|
|
|
|
<?PHP echo $categories[$question->category]; ?>
|
|
|
|
<input type="hidden" name="category" value="<?PHP echo "$question->category"; ?>">
|
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
|
2003-02-24 10:37:56 +00:00
|
|
|
<TD>
|
|
|
|
<?PHP
|
|
|
|
if (empty($question->name)) {
|
2003-03-30 16:46:50 +00:00
|
|
|
$question->name = get_string("randomsamatch", "quiz");
|
2003-02-24 10:37:56 +00:00
|
|
|
}
|
|
|
|
?>
|
2003-09-09 12:34:51 +00:00
|
|
|
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>">
|
|
|
|
<?php if (isset($err["name"])) formerr($err["name"]); ?>
|
2003-02-24 10:37:56 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("introduction", "quiz") ?>:</B></P></TD>
|
2003-02-24 10:37:56 +00:00
|
|
|
<TD>
|
2003-09-09 12:34:51 +00:00
|
|
|
<?php if (isset($err["questiontext"])) {
|
2003-02-24 10:37:56 +00:00
|
|
|
formerr($err["questiontext"]);
|
|
|
|
echo "<BR \>";
|
|
|
|
}
|
|
|
|
if (empty($question->questiontext)) {
|
2003-03-30 16:46:50 +00:00
|
|
|
$question->questiontext = get_string("randomsamatchintro", "quiz");
|
2003-02-24 10:37:56 +00:00
|
|
|
}
|
2003-06-13 16:16:16 +00:00
|
|
|
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
|
2003-02-24 10:37:56 +00:00
|
|
|
if ($usehtmleditor) {
|
|
|
|
helpbutton("richtext", get_string("helprichtext"), "moodle");
|
|
|
|
} else {
|
|
|
|
helpbutton("text", get_string("helptext"), "moodle");
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("randomsamatchnumber", "quiz") ?>:</B></P></TD>
|
2003-02-24 10:37:56 +00:00
|
|
|
<TD>
|
2003-09-09 12:34:51 +00:00
|
|
|
<?php
|
2003-02-24 10:37:56 +00:00
|
|
|
if ($numberavailable < 2) {
|
|
|
|
echo "ERROR";
|
2003-03-30 16:51:24 +00:00
|
|
|
$maxrandom=2;
|
2003-02-24 10:37:56 +00:00
|
|
|
} else if ($numberavailable < 6) {
|
|
|
|
$maxrandom = $numberavailable;
|
|
|
|
} else {
|
2003-03-30 16:46:50 +00:00
|
|
|
$maxrandom = QUIZ_MAX_NUMBER_ANSWERS;
|
2003-02-24 10:37:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for ($i=2;$i<=$maxrandom;$i++) {
|
|
|
|
$menu[$i] = $i;
|
|
|
|
}
|
|
|
|
choose_from_menu($menu, "choose", "$options->choose", "");
|
|
|
|
unset($menu);
|
|
|
|
?>
|
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
</TABLE>
|
|
|
|
|
2003-09-09 12:34:51 +00:00
|
|
|
<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") ?>">
|
2003-02-24 10:37:56 +00:00
|
|
|
|
|
|
|
</CENTER>
|
|
|
|
</FORM>
|
2003-09-09 12:34:51 +00:00
|
|
|
<?php
|
2003-02-24 10:37:56 +00:00
|
|
|
if ($usehtmleditor) {
|
|
|
|
print_richedit_javascript("theform", "questiontext", "no");
|
|
|
|
}
|
|
|
|
?>
|