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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
|
<!-- This page defines the form to create or edit an instance of this module -->
<!-- It is used from /course/mod.php. The whole instance is available as $form. -->
<?php
require_once("$CFG->dirroot/mod/quiz/lib.php");
if (!isset($form->name)) {
$form->name = "";
}
if (!isset($form->intro)) {
$form->intro = "";
}
if (!isset($form->timeopen)) {
$form->timeopen = "";
}
if (!isset($form->timeclose)) {
$form->timeclose = "";
}
if (!isset($form->attempts)) {
$form->attempts = 0;
}
if (!isset($form->attemptonlast)) {
$form->attemptonlast = 0;
}
if (!isset($form->grademethod)) {
$form->grademethod = "";
}
if (!isset($form->feedback)) {
$form->feedback = "";
}
if (!isset($form->correctanswers)) {
$form->correctanswers = "";
}
if (!isset($form->review)) {
$form->review = 0;
}
if (!isset($form->shufflequestions)) {
$form->shufflequestions = 0;
}
if (!isset($form->shuffleanswers)) {
$form->shuffleanswers = 1;
}
if (!isset($form->grade)) {
$form->grade = 0;
}
if (!isset($form->questions)) {
$form->questions = "";
}
if (!isset($form->password)) {
$form->password = "";
}
if (!isset($form->subnet)) {
$form->subnet = "";
}
if (!isset($form->timelimit)) {
$form->timelimit = 0;
}
?>
<form name="form" method="post" action="../mod/quiz/edit.php">
<center>
<table cellpadding=5>
<tr valign=top>
<td align=right><p><b><?php print_string("name") ?>:</b></p></td>
<td>
<input type="text" name="name" size=40 value="<?php p($form->name) ?>">
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("introduction", "quiz") ?>:</b></p>
<br />
<font size="1">
<?php
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
helpbutton("text", get_string("helptext"), "moodle", true, true);
echo '<br />';
emoticonhelpbutton("form", "description");
echo '<br />';
}
?>
<br />
</font>
</td>
<td>
<?php
print_textarea($usehtmleditor, 20, 50, 680, 400, "intro", $form->intro);
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("quizopen", "quiz") ?>:</b></p></td>
<td>
<?php
if (!$form->timeopen and $course->format == "weeks") {
$form->timeopen = $course->startdate + (($form->section - 1) * 608400);
}
print_date_selector("openday", "openmonth", "openyear", $form->timeopen);
print_time_selector("openhour", "openminute", $form->timeopen);
helpbutton("timeopen", get_string("quizopen","quiz"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("quizclose", "quiz") ?>:</b></p></td>
<td>
<?php
if (!$form->timeclose and $course->format == "weeks") {
$form->timeclose = $course->startdate + (($form->section) * 608400);
}
print_date_selector("closeday", "closemonth", "closeyear", $form->timeclose);
print_time_selector("closehour", "closeminute", $form->timeclose);
helpbutton("timeopen", get_string("quizclose","quiz"), "quiz");
?>
</td>
</tr>
<!-- BEGIN EDIT -->
<tr valign=top>
<td align=right><p><b><?php print_string("timelimit", "quiz") ?>:</b></p></td>
<td>
<?php
print_timer_selector($form->timelimit, get_string("minutes","quiz"));
helpbutton("timelimit", get_string("quiztimer","quiz"), "quiz");
?>
</td>
</tr>
<!-- END EDIT -->
<tr valign=top>
<td align=right><p><b><?php print_string("shufflequestions", "quiz") ?>:</b></p></td>
<td>
<?php
$options = array();
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu($options, "shufflequestions", "$form->shufflequestions", "");
helpbutton("shufflequestions", get_string("shufflequestions","quiz"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("shuffleanswers", "quiz") ?>:</b></p></td>
<td>
<?php
$options = array();
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu($options, "shuffleanswers", "$form->shuffleanswers", "");
helpbutton("shuffleanswers", get_string("shuffleanswers","quiz"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("attemptsallowed", "quiz") ?>:</b></p></td>
<td>
<?php
$options = array();
$options[0] = get_string("attemptsunlimited", "quiz");
$options[1] = "1 ".strtolower(get_string("attempt", "quiz"));
for ($i=2;$i<=6;$i++) {
$options[$i] = "$i ".strtolower(get_string("attempts", "quiz"));
}
choose_from_menu($options, "attempts", "$form->attempts", "");
helpbutton("attempts", get_string("attemptsallowed","quiz"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("eachattemptbuildsonthelast", "quiz") ?>:</b></p></td>
<td>
<?php
$options = array();
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu($options, "attemptonlast",
"$form->attemptonlast", "");
helpbutton("repeatattempts",
get_string("eachattemptbuildsonthelast", "quiz"),
"quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("grademethod", "quiz") ?>:</b></p></td>
<td>
<?php
$options = array();
$options[1] = get_string("gradehighest", "quiz");
$options[2] = get_string("gradeaverage", "quiz");
$options[3] = get_string("attemptfirst", "quiz");
$options[4] = get_string("attemptlast", "quiz");
choose_from_menu($QUIZ_GRADE_METHOD, "grademethod", "$form->grademethod", "");
helpbutton("grademethod", get_string("grademethod","quiz"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("showfeedback", "quiz") ?>:</b></p></td>
<td>
<?php
$options = array();
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu($options, "feedback", "$form->feedback", "");
helpbutton("feedback", get_string("showfeedback","quiz"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("showcorrectanswer", "quiz") ?>:</b></p></td>
<td>
<?php
$options = array();
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu($options, "correctanswers", "$form->correctanswers", "");
helpbutton("correctanswers", get_string("showcorrectanswer","quiz"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("allowreview", "quiz") ?>:</b></p></td>
<td>
<?php
$options = array();
$options[0] = get_string("no");
$options[1] = get_string("yes");
choose_from_menu($options, "review", "$form->review", "");
helpbutton("review", get_string("allowreview","quiz"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("maximumgrade") ?>:</b></p></td>
<td>
<?php
for ($i=100; $i>=1; $i--) {
$grades[$i] = $i;
}
$grades[0] = get_string("nograde");
choose_from_menu($grades, "grade", "$form->grade", "");
helpbutton("maxgrade", get_string("maximumgrade"), "quiz");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("requirepassword", "quiz") ?>:</b></p></td>
<td>
<input type="text" name="password" size=40 value="<?php p($form->password) ?>">
<?php helpbutton("requirepassword", get_string("requirepassword", "quiz"), "quiz"); ?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("requiresubnet", "quiz") ?>:</b></p></td>
<td>
<input type="text" name="subnet" size=40 value="<?php p($form->subnet) ?>">
<?php helpbutton("requiresubnet", get_string("requiresubnet", "quiz"), "quiz"); ?>
</td>
</tr>
</table>
<input type="hidden" name=questions value="<?php p($form->questions) ?>">
<!-- these hidden variables are always the same -->
<input type="hidden" name=course value="<?php p($form->course) ?>">
<input type="hidden" name=coursemodule value="<?php p($form->coursemodule) ?>">
<input type="hidden" name=section value="<?php p($form->section) ?>">
<input type="hidden" name=module value="<?php p($form->module) ?>">
<input type="hidden" name=modulename value="<?php p($form->modulename) ?>">
<input type="hidden" name=instance value="<?php p($form->instance) ?>">
<input type="hidden" name=mode value="<?php p($form->mode) ?>">
<input type="hidden" name=destination value="<?php echo "$CFG->wwwroot/course/mod.php" ?>">
<input type="submit" value="<?php print_string("continue") ?>">
</center>
</form>
|