adding some strings
[moodle-linuxchix.git] / mod / quiz / config.html
blobaed19c2dccc3ef7e70b2c68e7683466e9a9b3c12
1 <?php // $Id$
2 require_once($CFG->dirroot . '/mod/quiz/locallib.php');
4 if (!isset($form->timeopen)) {
5 $form->timeopen = "";
7 if (!isset($form->timeclose)) {
8 $form->timeclose = "";
10 if (!isset($form->attempts)) {
11 $form->attempts = $CFG->quiz_attempts;
13 if (!isset($form->attemptonlast)) {
14 $form->attemptonlast = $CFG->quiz_attemptonlast;
16 if (!isset($form->grademethod)) {
17 $form->grademethod = $CFG->quiz_grademethod;
19 if (!isset($form->decimalpoints)) {
20 $form->decimalpoints = $CFG->quiz_decimalpoints;
22 if (!isset($form->review)) {
23 $form->review = $CFG->quiz_review;
25 if (!isset($form->questionsperpage)) {
26 $form->questionsperpage = $CFG->quiz_questionsperpage;
28 if (!isset($form->shufflequestions)) {
29 $form->shufflequestions = $CFG->quiz_shufflequestions;
31 if (!isset($form->shuffleanswers)) {
32 $form->shuffleanswers = $CFG->quiz_shuffleanswers;
34 if (!isset($form->grade)) {
35 $form->grade = $CFG->quiz_maximumgrade;
37 if (!isset($form->questions)) {
38 $form->questions = "";
40 if (!isset($form->password)) {
41 $form->password = $CFG->quiz_password;
43 if (!isset($form->subnet)) {
44 $form->subnet = $CFG->quiz_subnet;
46 if (!isset($form->timelimit)) {
47 $form->timelimit = $CFG->quiz_timelimit;
49 if (!isset($form->popup)) {
50 $form->popup = $CFG->quiz_popup;
52 if (!isset($form->optionflags)) {
53 $form->optionflags = $CFG->quiz_optionflags;
55 if (!isset($form->penaltyscheme)) {
56 $form->penaltyscheme = $CFG->quiz_penaltyscheme;
58 if (!isset($form->maximumgrade)) {
59 $form->maximumgrade = $CFG->quiz_maximumgrade;
61 //enforced delay attempt between quiz
62 if (!isset($form->delay1)) {
63 $form->delay1 = $CFG->quiz_delay1;
65 if (!isset($form->delay2)) {
66 $form->delay2 = $CFG->quiz_delay2;
68 //enforced time delay between quiz attempts add-on
69 $timedelayoptions = array();
70 $timedelayoptions[0] = get_string('none');
71 $timedelayoptions[1800] = get_string('numminutes', '', 30);
72 $timedelayoptions[3600] = get_string('numminutes', '', 60);
73 for($i=2; $i<=23; $i++) {
74 $seconds = $i*3600;
75 $timedelayoptions[$seconds] = get_string('numhours', '', $i);
77 $timedelayoptions[86400] = get_string('numhours', '', 24);
78 for($i=2; $i<=7; $i++) {
79 $seconds = $i*86400;
80 $timedelayoptions[$seconds] = get_string('numdays', '', $i);
84 <script type="text/javascript">
85 //<![CDATA[
86 var timelimititems = ['timelimit'];
87 //]]>
88 </script>
90 <form method="post" action="module.php" id="form">
91 <div>
92 <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
94 <!-- Table of default values -->
96 <?php
97 // the following are used for drop-down menus
99 $yesnooptions = array();
100 $yesnooptions[0] = get_string("no");
101 $yesnooptions[1] = get_string("yes");
103 $attemptoptions = array();
104 $attemptoptions[0] = get_string("attemptsunlimited", "quiz");
105 $attemptoptions[1] = "1 ".moodle_strtolower(get_string("attempt", "quiz"));
106 for ($i=2;$i<=6;$i++) {
107 $attemptoptions[$i] = "$i ".moodle_strtolower(get_string("attempts", "quiz"));
112 <table cellpadding="9" cellspacing="0">
114 <tr valign="top">
115 <th align="right" scope="col">&nbsp;</th>
116 <th align="left" scope="col">
117 <?php print_string('sitedefault'); ?>
118 </th>
119 <th align="center" scope="col">
120 <?php print_string('advancedsettings'); helpbutton("advancedsettings"); ?>
121 </th>
122 </tr>
124 <tr valign="top">
125 <td align="right"><b><?php print_string("timelimit", "quiz") ?>:</b></td>
126 <td>
127 <input name="timelimitenable" type="checkbox" value="1" alt="<?php print_string('timelimit', 'quiz') ?>" onclick="return lockoptions('form', 'timelimitenable', timelimititems)" <?php if ($form->timelimit) echo 'checked="checked"' ?> />
128 <input type="text" name="timelimit" size="3" value="<?php p($form->timelimit ? $form->timelimit : '') ?>" />
129 <?php
130 print_string('minutes');
131 helpbutton("timelimit", get_string("quiztimer","quiz"), "quiz");
133 <input type="hidden" name="htimelimit" value="0" />
134 </td>
135 <td align="center">
136 <input type="hidden" name="fix_timelimit" value="0" />
137 <input type="checkbox" name="fix_timelimit" value="1" <?php echo $CFG->quiz_fix_timelimit ? 'checked="checked"' : ''; ?> />
138 </td>
139 </tr>
141 <tr valign="top">
142 <td align="right"><b><?php print_string('questionsperpage', 'quiz') ?>:</b></td>
143 <td>
144 <?php
145 $perpage= array();
146 for ($i=0; $i<=50; ++$i) {
147 $perpage[$i] = $i;
149 $perpage[0] = get_string('allinone', 'quiz');
151 choose_from_menu($perpage, 'questionsperpage', $form->questionsperpage, '');
152 helpbutton('questionsperpage', get_string('questionsperpage'), 'quiz');
154 </td>
155 <td align="center">
156 <input type="hidden" name="fix_questionsperpage" value="0" />
157 <input type="checkbox" name="fix_questionsperpage" value="1" <?php echo $CFG->quiz_fix_questionsperpage ? 'checked="checked"' : ''; ?> />
158 </td>
159 </tr>
161 <tr valign="top">
162 <td align="right"><b><?php print_string("shufflequestions", "quiz") ?>:</b></td>
163 <td>
164 <?php
165 choose_from_menu ($yesnooptions, "shufflequestions", $form->shufflequestions, "", "", "");
166 helpbutton("shufflequestions", get_string("shufflequestions","quiz"), "quiz");
168 </td>
169 <td align="center">
170 <input type="hidden" name="fix_shufflequestions" value="0" />
171 <input type="checkbox" name="fix_shufflequestions" value="1" <?php echo $CFG->quiz_fix_shufflequestions ? 'checked="checked"' : ''; ?> />
172 </td>
173 </tr>
175 <tr valign="top">
176 <td align="right"><b><?php print_string("shufflewithin", "quiz") ?>:</b></td>
177 <td>
178 <?php
179 choose_from_menu ($yesnooptions, "shuffleanswers", $form->shuffleanswers, "", "", "");
180 helpbutton("shufflewithin", get_string("shufflewithin","quiz"), "quiz");
182 </td>
183 <td align="center">
184 <input type="hidden" name="fix_shuffleanswers" value="0" />
185 <input type="checkbox" name="fix_shuffleanswers" value="1" <?php echo $CFG->quiz_fix_shuffleanswers ? 'checked="checked"' : ''; ?> />
186 </td>
187 </tr>
189 <tr valign="top">
190 <td align="right"><b><?php print_string("attemptsallowed", "quiz") ?>:</b></td>
191 <td>
192 <?php
193 unset($options);
194 $options[0] = get_string("attemptsunlimited", "quiz");
195 $options[1] = "1 ".strtolower(get_string("attempt", "quiz"));
196 for ($i=2;$i<=6;$i++) {
197 $options[$i] = "$i ".strtolower(get_string("attempts", "quiz"));
199 choose_from_menu ($options, "attempts", $form->attempts, "", "", "");
200 helpbutton("attempts", get_string("attemptsallowed","quiz"), "quiz");
202 </td>
203 <td align="center">
204 <input type="hidden" name="fix_attempts" value="0" />
205 <input type="checkbox" name="fix_attempts" value="1" <?php echo $CFG->quiz_fix_attempts ? 'checked="checked"' : ''; ?> />
206 </td>
207 </tr>
209 <tr valign="top">
210 <td align="right"><b><?php print_string("eachattemptbuildsonthelast", "quiz") ?>:</b></td>
211 <td>
212 <?php
213 choose_from_menu ($yesnooptions, "attemptonlast", $form->attemptonlast, "", "", "");
214 helpbutton("repeatattempts", get_string("eachattemptbuildsonthelast", "quiz"), "quiz");
216 </td>
217 <td align="center">
218 <input type="hidden" name="fix_attemptonlast" value="0" />
219 <input type="checkbox" name="fix_attemptonlast" value="1" <?php echo $CFG->quiz_fix_attemptonlast ? 'checked="checked"' : ''; ?> />
220 </td>
221 </tr>
223 <tr valign="top">
224 <td align="right"><b><?php print_string("grademethod", "quiz") ?>:</b></td>
225 <td>
226 <?php
227 choose_from_menu ($QUIZ_GRADE_METHOD, "grademethod", $form->grademethod, "", "", "");
228 helpbutton("grademethod", get_string("grademethod","quiz"), "quiz");
230 </td>
231 <td align="center">
232 <input type="hidden" name="fix_grademethod" value="0" />
233 <input type="checkbox" name="fix_grademethod" value="1" <?php echo $CFG->quiz_fix_grademethod ? 'checked="checked"' : ''; ?> />
234 </td>
235 </tr>
237 <tr valign="top">
238 <td align="right"><b><?php print_string("adaptive", "quiz") ?>:</b></td>
239 <td>
240 <?php
241 choose_from_menu($yesnooptions, "adaptive", ($CFG->quiz_optionflags & QUESTION_ADAPTIVE) ? 1 : 0, "");
242 helpbutton("adaptive", get_string("adaptive","quiz"), "quiz");
244 </td>
245 <td align="center">
246 <input type="hidden" name="fix_adaptive" value="0" />
247 <input type="checkbox" name="fix_adaptive" value="1" <?php echo $CFG->quiz_fix_adaptive ? 'checked="checked"' : ''; ?> />
248 </td>
249 </tr>
251 <tr valign="top">
252 <td align="right"><b><?php print_string("penaltyscheme", "quiz") ?>:</b></td>
253 <td>
254 <?php
255 choose_from_menu($yesnooptions, "penaltyscheme", "$form->penaltyscheme", "");
256 helpbutton("penaltyscheme", get_string("penaltyscheme","quiz"), "quiz");
258 </td>
259 <td align="center">
260 <input type="hidden" name="fix_penaltyscheme" value="0" />
261 <input type="checkbox" name="fix_penaltyscheme" value="1" <?php echo $CFG->quiz_fix_penaltyscheme ? 'checked="checked"' : ''; ?> />
262 </td>
263 </tr>
265 <tr valign="top">
266 <td align="right"><b><?php print_string("decimaldigits", "quiz") ?>:</b></td>
267 <td>
268 <?php
269 unset($options);
270 $options[0] = '0';
271 $options[1] = '1';
272 $options[2] = '2';
273 $options[3] = '3';
274 choose_from_menu ($options, "decimalpoints", $form->decimalpoints, "", "", "");
275 helpbutton("decimalpoints", get_string("decimaldigits","quiz"), "quiz");
277 </td>
278 <td align="center">
279 <input type="hidden" name="fix_decimalpoints" value="0" />
280 <input type="checkbox" name="fix_decimalpoints" value="1" <?php echo $CFG->quiz_fix_decimalpoints ? 'checked="checked"' : ''; ?> />
281 </td>
282 </tr>
285 <tr valign="top">
286 <?php include($CFG->dirroot . '/mod/quiz/reviewoptions.html'); ?>
287 <td align="center">
288 <input type="hidden" name="fix_review" value="0" />
289 <input type="checkbox" name="fix_review" value="1" <?php echo $CFG->quiz_fix_review ? 'checked="checked"' : ''; ?> />
290 </td>
291 </tr>
293 <tr valign="top">
294 <td align="right"><b><?php print_string("popup", "quiz") ?>:</b></td>
295 <td>
296 <?php
297 choose_from_menu ($yesnooptions, "popup", $form->popup, "", "", "");
298 helpbutton("popup", get_string("popup","quiz"), "quiz");
300 </td>
301 <td align="center">
302 <input type="hidden" name="fix_popup" value="0" />
303 <input type="checkbox" name="fix_popup" value="1" <?php echo $CFG->quiz_fix_popup ? 'checked="checked"' : ''; ?> />
304 </td>
305 </tr>
307 <tr valign="top">
308 <td align="right"><b><?php print_string('delay1', 'quiz') ?>:</b></td>
309 <td align="left">
310 <?php
311 choose_from_menu($timedelayoptions, 'delay1', $form->delay1, "", "", "" );
312 helpbutton('timedelay1', get_string('delay1','quiz'), 'quiz');
314 </td>
315 <td align="center">
316 <input type="hidden" name="fix_delay1" value="0" />
317 <input type="checkbox" name="fix_delay1" value="1" <?php echo $CFG->quiz_fix_delay1 ? 'checked="checked"' : ''; ?> />
318 </td>
319 </tr>
321 <tr valign="top">
322 <td align="right"><b><?php print_string('delay2', 'quiz') ?>:</b></td>
323 <td align="left">
324 <?php
325 choose_from_menu($timedelayoptions, 'delay2', $form->delay2, "", "", "");
326 helpbutton('timedelay2', get_string('delay2','quiz'), 'quiz');
328 </td>
329 <td align="center">
330 <input type="hidden" name="fix_delay2" value="0" />
331 <input type="checkbox" name="fix_delay2" value="1" <?php echo $CFG->quiz_fix_delay2 ? 'checked="checked"' : ''; ?> />
332 </td>
333 </tr>
335 <tr valign="top">
336 <td align="right"><b><?php print_string("requirepassword", "quiz") ?>:</b></td>
337 <td>
338 <input type="text" name="password" size="20" value="<?php p($form->password) ?>" />
339 <?php helpbutton("requirepassword", get_string("requirepassword", "quiz"), "quiz"); ?>
340 </td>
341 <td align="center">
342 <input type="hidden" name="fix_password" value="0" />
343 <input type="checkbox" name="fix_password" value="1" <?php echo $CFG->quiz_fix_password ? 'checked="checked"' : ''; ?> />
344 </td>
345 </tr>
347 <tr valign="top">
348 <td align="right"><b><?php print_string("requiresubnet", "quiz") ?>:</b></td>
349 <td>
350 <input type="text" name="subnet" size="20" value="<?php p($form->subnet) ?>" />
351 <?php helpbutton("requiresubnet", get_string("requiresubnet", "quiz"), "quiz"); ?>
352 </td>
353 <td align="center">
354 <input type="hidden" name="fix_subnet" value="0" />
355 <input type="checkbox" name="fix_subnet" value="1" <?php echo $CFG->quiz_fix_subnet ? 'checked="checked"' : ''; ?> />
356 </td>
357 </tr>
360 <tr valign="top">
361 <td align="right"><b><?php print_string("maximumgrade") ?>:</b></td>
362 <td>
363 <?php
364 unset($grades);
365 for ($i=100; $i>=1; $i--) {
366 $grades[$i] = $i;
368 $grades[0] = get_string("nograde");
369 choose_from_menu ($grades, "maximumgrade", $form->maximumgrade, "", "", "");
370 helpbutton("maxgrade", get_string("maximumgrade"), "quiz");
372 </td>
373 <!-- Can't hide this setting, it always shows up on edit.php
374 <td align="center">
375 <input type="hidden" name="fix_maximumgrade" value="0" />
376 <input type="checkbox" name="fix_maximumgrade" value="1" <?php echo $CFG->quiz_fix_maximumgrade ? 'checked="checked"' : ''; ?> />
377 </td>
379 </tr>
381 <tr>
382 <td colspan="3" align="center">
383 <input type="hidden" name="module" value="quiz" />
384 <input type="submit" value="<?php print_string("savechanges") ?>" />
385 </td>
386 </tr>
388 </table>
389 </div>
390 </form>
392 <script type="text/javascript">
393 <?php
394 if (!$form->timelimit) echo "lockoptions('form','timelimitenable', timelimititems);";
396 </script>