1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
<form name="theform" method="post" action="question.php">
<center>
<table cellpadding="5">
<tr valign="top">
<td align="right"><b><?php print_string("category", "quiz") ?>:</b></td>
<td align="left">
<?php question_category_select_menu($course->id, true, true, $question->category); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("questionname", "quiz") ?>:</b></td>
<td align="left">
<input type="text" name="name" size="50" value="<?php p($question->name) ?>" alt="<?php print_string("questionname", "quiz") ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("question", "quiz") ?>:</b>
<br />
<br />
<br />
<font size="1">
<?php
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
helpbutton("text", get_string("helptext"), "moodle", true, true);
}
?>
</font>
</td>
<td align="left">
<?php if (isset($err["questiontext"])) {
formerr($err["questiontext"]);
echo "<br />";
}
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
if ($usehtmleditor) {
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
} else {
echo "<div align=\"right\">";
print_string("formattexttype");
echo ": ";
if (!isset($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"><b><?php print_string("imagedisplay", "quiz") ?>:</b></td>
<td align="left">
<?php if (empty($images)) {
print_string("noimagesyet");
} else {
choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
}
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("casesensitive", "quiz") ?>:</b></td>
<td align="left">
<?php
unset($menu);
$menu[0] = get_string("caseno", "quiz");
$menu[1] = get_string("caseyes", "quiz");
choose_from_menu($menu, "usecase", "$options->usecase", "");
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("defaultgrade", "quiz") ?>:</b></td>
<td align="left">
<input type="text" name="defaultgrade" size="3" value="<?php p($question->defaultgrade) ?>" alt="<?php print_string("defaultgrade", "quiz") ?>" />
<?php if (isset($err["defaultgrade"])) formerr($err["defaultgrade"]); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("penaltyfactor", "quiz") ?>:</b></td>
<td align="left">
<input type="text" name="penalty" size="3" value="<?php p($question->penalty) ?>" alt="<?php print_string("penaltyfactor", "quiz") ?>" />
<?php helpbutton('penalty', get_string('penalty', 'quiz'), 'quiz'); ?>
<?php if (isset($err["penalty"])) formerr($err["penalty"]); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("correctanswers", "quiz") ?></b>:</td>
<td align="left">
<?php print_string("filloutoneanswer", "quiz") ?>
</td>
</tr>
<?php
for ($i=1; $i<=count($answers); $i++) {
?>
<tr valign="top">
<td align="right"><b><?php echo get_string("answer", "quiz")." $i"; ?>:</b></td>
<td align="left">
<?php
if ($answers[$i-1]->answer === '') {
$answertext = '';
$fractionval = 0;
$feedbacktext = '';
} else {
$answertext = $answers[$i-1]->answer;
$fractionval = $answers[$i-1]->fraction;
$feedbacktext = $answers[$i-1]->feedback;
}
?>
<input type="text" name="answer[]" size="50" value="<?php p($answertext) ?>" alt="<?php echo get_string("answer", "quiz")." $i"; ?>" />
<?php print_string("grade");
echo ": ";
choose_from_menu($gradeoptions, "fraction[]", $fractionval,""); ?>
<br />
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("feedback", "quiz") ?>:</b></td>
<td align="left">
<textarea name="feedback[]" rows="2" cols="50"><?php p($feedbacktext) ?></textarea>
</td>
</tr>
<tr valign="top">
<td colspan="2"> </td>
</tr>
<?php
}
?>
<?php
$QTYPES[$question->qtype]->print_replacement_options($question, $course, $contextquiz);
$QTYPES[$question->qtype]->print_question_form_end($question);
?>
</table>
</center>
</form>
|