2003-09-09 12:34:51 +00:00
|
|
|
<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">
|
2002-10-14 15:57:33 +00:00
|
|
|
<CENTER>
|
|
|
|
<TABLE cellpadding=5>
|
2002-10-15 05:29:57 +00:00
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
|
2002-10-15 05:29:57 +00:00
|
|
|
<TD>
|
2003-09-09 12:34:51 +00:00
|
|
|
<?php choose_from_menu($categories, "category", "$question->category", ""); ?>
|
2002-10-15 05:29:57 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
2002-10-14 15:57:33 +00:00
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
|
2002-10-14 15:57:33 +00:00
|
|
|
<TD>
|
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"]); ?>
|
2002-10-14 15:57:33 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
2004-02-13 14:01:27 +00:00
|
|
|
<tr valign=top>
|
|
|
|
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
|
|
|
|
<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>
|
2003-09-09 12:34:51 +00:00
|
|
|
<?php if (isset($err["questiontext"])) {
|
2002-12-30 05:10:01 +00:00
|
|
|
formerr($err["questiontext"]);
|
2004-02-13 14:01:27 +00:00
|
|
|
echo "<br />";
|
2002-12-30 05:10:01 +00:00
|
|
|
}
|
2004-02-13 14:01:27 +00:00
|
|
|
|
2003-06-13 16:16:16 +00:00
|
|
|
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
|
2004-02-13 14:01:27 +00:00
|
|
|
|
|
|
|
if ($usehtmleditor) { /// Trying this out for a while
|
|
|
|
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';
|
2003-02-24 10:37:56 +00:00
|
|
|
} else {
|
2004-02-13 14:01:27 +00:00
|
|
|
echo "<div align=right>";
|
|
|
|
print_string("formattexttype");
|
|
|
|
echo ": ";
|
|
|
|
if (!$question->questiontextformat) {
|
|
|
|
$question->questiontextformat = FORMAT_MOODLE;
|
|
|
|
}
|
|
|
|
choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");
|
|
|
|
helpbutton("textformat", get_string("helpformatting"));
|
|
|
|
echo "</div>";
|
2003-02-24 10:37:56 +00:00
|
|
|
}
|
2002-12-30 05:10:01 +00:00
|
|
|
?>
|
2004-02-13 14:01:27 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2002-10-14 15:57:33 +00:00
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
|
2002-10-14 15:57:33 +00:00
|
|
|
<TD>
|
2003-09-09 12:34:51 +00:00
|
|
|
<?php if (empty($images)) {
|
2002-10-15 16:22:18 +00:00
|
|
|
print_string("noimagesyet");
|
|
|
|
} else {
|
|
|
|
choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
|
|
|
|
}
|
|
|
|
?>
|
2002-10-14 15:57:33 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("answerhowmany", "quiz") ?>:</B></P></TD>
|
2002-10-14 15:57:33 +00:00
|
|
|
<TD>
|
2003-09-09 12:34:51 +00:00
|
|
|
<?php
|
2002-10-15 10:04:28 +00:00
|
|
|
$menu[0] = get_string("answersingleno", "quiz");
|
|
|
|
$menu[1] = get_string("answersingleyes", "quiz");
|
|
|
|
choose_from_menu($menu, "single", "$options->single", "");
|
2002-12-30 05:10:01 +00:00
|
|
|
unset($menu);
|
2002-10-14 15:57:33 +00:00
|
|
|
?>
|
|
|
|
</TD>
|
|
|
|
</TR>
|
2002-10-15 05:29:57 +00:00
|
|
|
|
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("choices", "quiz") ?></B>:</P></TD>
|
|
|
|
<TD><P><?php print_string("fillouttwochoices", "quiz") ?></P>
|
2002-10-15 05:29:57 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
|
2004-01-10 07:39:19 +00:00
|
|
|
<?PHP
|
|
|
|
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
|
|
|
|
?>
|
2002-10-15 05:29:57 +00:00
|
|
|
<TR valign=top>
|
2004-01-10 07:39:19 +00:00
|
|
|
<TD align=right><P><B><?php echo get_string("choice", "quiz")." $i"; ?>:</B></P></TD>
|
2002-10-15 05:29:57 +00:00
|
|
|
<TD>
|
2004-01-10 07:39:19 +00:00
|
|
|
<INPUT type="text" name="answer[]" size=50 maxlength=255 value="<?php p($answers[$i-1]->answer) ?>">
|
2003-09-09 12:34:51 +00:00
|
|
|
<?php print_string("grade");
|
2002-10-15 05:29:57 +00:00
|
|
|
echo ": ";
|
2004-01-10 07:39:19 +00:00
|
|
|
choose_from_menu($gradeoptionsfull, "fraction[]", $answers[$i-1]->fraction, ""); ?>
|
2002-10-15 05:29:57 +00:00
|
|
|
<BR>
|
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
<TR valign=top>
|
2003-09-09 12:34:51 +00:00
|
|
|
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD>
|
2002-10-15 05:29:57 +00:00
|
|
|
<TD>
|
2004-01-10 07:39:19 +00:00
|
|
|
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>
|
2002-10-15 05:29:57 +00:00
|
|
|
</TD>
|
|
|
|
</TR>
|
|
|
|
|
|
|
|
<TR valign=top>
|
|
|
|
<TD colspan=2> </TD>
|
|
|
|
</TR>
|
|
|
|
|
2004-01-10 07:39:19 +00:00
|
|
|
<?php
|
|
|
|
} /// End of loop, printing answers
|
|
|
|
?>
|
2002-10-14 15:57:33 +00:00
|
|
|
</TABLE>
|
2002-10-15 05:29:57 +00:00
|
|
|
|
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") ?>">
|
2002-10-14 15:57:33 +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");
|
|
|
|
}
|
|
|
|
?>
|