Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / mod / workshop / mod.html
blob6d012a410bdb2d720f111fa00c115ace4a4b1ef8
1 <?php
2 require_once("$CFG->dirroot/mod/workshop/lib.php"); // for parameter arrays
3 require_once("$CFG->dirroot/mod/workshop/locallib.php"); // for parameter arrays
5 // ...and fill the form if needed
6 if (empty($form->name)) {
7 $form->name = "";
9 if (empty($form->description)) {
10 $form->description = "";
12 if (empty($form->format)) {
13 $form->format = "";
15 if (!isset($form->gradinggrade)) {
16 $form->gradinggrade = 100;
18 if (!isset($form->grade)) {
19 $form->grade = 100;
21 if (!isset($form->gradingstrategy)) {
22 $form->gradingstrategy = 1; // default is accumulative
24 if (!isset($form->nelements)) {
25 $form->nelements = 1;
27 if (!isset($form->nattachments)) {
28 $form->nattachments = 0;
30 if (empty($form->resubmit)) {
31 $form->resubmit = "";
33 if (!isset($form->ntassessments)) {
34 $form->ntassessments = 0;
36 if (!isset($form->assessmentcomps)) {
37 $form->assessmentcomps = 2;
39 if (!isset($form->nsassessments)) {
40 $form->nsassessments = 0;
42 if (!isset($form->teacherweight)) {
43 $form->teacherweight = 1;
45 if (!isset($form->overallocation)) {
46 $form->overallocation = 0;
48 if (empty($form->includeself)) {
49 $form->includeself = "";
51 if (empty($form->agreeassessments)) {
52 $form->agreeassessments = "";
54 if (empty($form->hidegrades)) {
55 $form->hidegrades = "";
57 if (empty($form->showleaguetable)) {
58 $form->showleaguetable = 0;
60 if (empty($form->anonymous)) {
61 $form->anonymous = 0;
63 if (empty($form->usepassword)) {
64 $form->usepassword = 0;
66 if (empty($form->maxbytes)) {
67 $form->maxbytes = "";
69 if (empty($form->submissionstart)) {
70 $form->submissionstart = time();
72 if (empty($form->assessmentstart)) {
73 $form->assessmentstart = time();
75 if (empty($form->submissionend)) {
76 $form->submissionend = time();
78 if (empty($form->assessmentend)) {
79 $form->assessmentend = time();
81 if (empty($form->releasegrades)) {
82 $form->releasegrades = time();
86 <form id="form" method="post" action="mod.php">
87 <table cellpadding="5">
88 <tr valign="top">
89 <td align="right"><b><?php print_string("title", "workshop") ?>:</b></td>
90 <td>
91 <input type="text" name="name" size="60" value="<?php p($form->name) ?>" alt="<?php print_string("title", "workshop") ?>" />
92 </td>
93 </tr>
94 <tr valign="top">
95 <td align="right"><b><?php print_string("description", "workshop") ?>:</b><br />
96 <?php
97 helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
98 echo "<br />";
99 if ($usehtmleditor) {
100 helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
101 } else {
102 helpbutton("text", get_string("helptext"), "moodle", true, true);
103 echo "<br />";
104 emoticonhelpbutton("form", "description", "moodle", true, true);
105 echo "<br />";
108 <br />
109 </td>
110 <td>
111 <?php
112 print_textarea($usehtmleditor, 20, 60, 595, 400, "description", $form->description);
114 if ($usehtmleditor) {
115 echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
116 } else {
117 echo '<p style="text-align:right">';
118 helpbutton("textformat", get_string("formattexttype"));
119 print_string("formattexttype");
120 echo ':&nbsp;';
121 if (!$form->format) {
122 $form->format = $defaultformat;
124 choose_from_menu(format_text_menu(), "format", $form->format, "");
125 echo '</p>';
128 </td>
129 </tr>
131 <tr valign="top">
132 <td align="right"><b><?php print_string("gradeforassessments", "workshop") ?>:</b></td>
133 <td>
134 <?php
135 for ($i=100; $i>=0; $i--) {
136 $grades[$i] = $i;
138 choose_from_menu($grades, "gradinggrade", "$form->gradinggrade", "");
139 helpbutton("gradinggrade", get_string("gradeforassessments", "workshop"), "workshop");
141 </td>
142 </tr>
144 <tr valign="top">
145 <td align="right"><b><?php print_string("gradeforsubmission", "workshop") ?>:</b></td>
146 <td>
147 <?php
148 choose_from_menu($grades, "grade", "$form->grade", "");
149 helpbutton("grade", get_string("gradeforsubmission", "workshop"), "workshop");
151 </td>
152 </tr>
154 <tr valign="top">
155 <td align="right"><b><?php print_string("gradingstrategy", "workshop") ?>:</b></td>
156 <td>
157 <?php
158 choose_from_menu($WORKSHOP_TYPE, "gradingstrategy", $form->gradingstrategy, "");
159 helpbutton("gradingstrategy", get_string("gradingstrategy", "workshop"), "workshop");
161 </td>
162 </tr>
164 <tr valign="top">
165 <td align="right"><b><?php print_string("numberofassessmentelements", "workshop") ?>:</b></td>
166 <td valign="middle">
167 <?php
168 for ($i=20; $i>=0; $i--) {
169 $numbers[$i] = $i;
171 choose_from_menu($numbers, "nelements", "$form->nelements", "");
172 helpbutton("nelements", get_string("numberofassessmentelements", "workshop"), "workshop");
174 </td>
175 </tr>
177 <tr valign="top">
178 <td align="right"><b><?php print_string("numberofattachments", "workshop") ?>:</b></td>
179 <td valign="middle">
180 <?php
181 unset($numbers);
182 for ($i=5; $i>=0; $i--) {
183 $numbers[$i] = $i;
185 choose_from_menu($numbers, "nattachments", "$form->nattachments", "");
186 helpbutton("nattachments", get_string("numberofattachments", "workshop"), "workshop");
188 </td>
189 </tr>
191 <tr>
192 <td align="right"><b><?php print_string("allowresubmit", "workshop") ?>:</b></td>
193 <td>
194 <?php
195 $options[0] = get_string("no"); $options[1] = get_string("yes");
196 choose_from_menu($options, "resubmit", $form->resubmit, "");
197 helpbutton("resubmit", get_string("allowresubmit", "workshop"), "workshop");
199 </td>
200 </tr>
202 <tr valign="top">
203 <td align="right"><b><?php print_string("numberofassessmentsofteachersexamples", "workshop") ?>:</b></td>
204 <td>
205 <?php
206 unset($numbers);
207 for ($i=20; $i>=0; $i--) {
208 $numbers[$i] = $i;
210 choose_from_menu($numbers, "ntassessments", $form->ntassessments, "");
211 helpbutton("nassessmentsofteachersexamples", get_string("numberofassessmentsofteachersexamples", "workshop"), "workshop");
213 </td>
214 </tr>
216 <tr>
217 <td align="right"><b><?php print_string("comparisonofassessments", "workshop") ?>:</b></td>
218 <td>
219 <?php
220 // set up comparison names
221 foreach ($WORKSHOP_ASSESSMENT_COMPS as $KEY => $COMPARISON) {
222 $COMPARISONS[] = $COMPARISON['name'];
224 choose_from_menu($COMPARISONS, "assessmentcomps", $form->assessmentcomps, "");
225 helpbutton("comparisonofassessments", get_string("comparisonofassessments", "workshop"), "workshop");
227 </td>
228 </tr>
230 <tr valign="top">
231 <td align="right"><b><?php print_string("numberofassessmentsofstudentsubmissions", "workshop") ?>:</b></td>
232 <td>
233 <?php
234 unset($numbers);
235 for ($i=20; $i>=0; $i--) {
236 $numbers[$i] = $i;
238 choose_from_menu($numbers, "nsassessments", $form->nsassessments, "");
239 helpbutton("nassessmentsofstudentsubmissions", get_string("numberofassessmentsofstudentsubmissions", "workshop"), "workshop");
241 </td>
242 </tr>
244 <tr valign="top">
245 <td align="right"><b><?php print_string("weightforteacherassessments", "workshop") ?>:</b></td>
246 <td>
247 <?php
248 unset($numbers);
249 for ($i=10; $i>=0; $i--) {
250 $numbers[$i] = $i;
252 choose_from_menu($numbers, "teacherweight", $form->teacherweight, "");
253 helpbutton("teacherweight", get_string("weightforteacherassessments", "workshop"), "workshop");
255 </td>
256 </tr>
258 <tr valign="top">
259 <td align="right"><b><?php print_string("overallocation", "workshop") ?>:</b></td>
260 <td>
261 <?php
262 unset($numbers);
263 for ($i=2; $i>=0; $i--) {
264 $numbers[$i] = $i;
266 choose_from_menu($numbers, "overallocation", "$form->overallocation", "");
267 helpbutton("overallocation", get_string("overallocation", "workshop"), "workshop");
269 </td>
270 </tr>
272 <tr>
273 <td align="right"><b><?php print_string("selfassessment", "workshop") ?>:</b></td>
274 <td>
275 <?php
276 $options[0] = get_string("no"); $options[1] = get_string("yes");
277 choose_from_menu($options, "includeself", $form->includeself, "");
278 helpbutton("selfassessment", get_string("selfassessment", "workshop"), "workshop");
280 </td>
281 </tr>
283 <tr>
284 <td align="right"><b><?php print_string("assessmentsmustbeagreed", "workshop") ?>:</b></td>
285 <td>
286 <?php
287 choose_from_menu($options, "agreeassessments", $form->agreeassessments, "");
288 helpbutton("agreeassessments", get_string("assessmentsmustbeagreed", "workshop"), "workshop");
290 </td>
291 </tr>
293 <tr>
294 <td align="right"><b><?php print_string("hidegradesbeforeagreement", "workshop") ?>:</b></td>
295 <td>
296 <?php
297 choose_from_menu($options, "hidegrades", $form->hidegrades, "");
298 helpbutton("showinggrades", get_string("hidegradesbeforeagreement", "workshop"), "workshop");
300 </td>
301 </tr>
303 <tr>
304 <td align="right"><b><?php print_string("leaguetable", "workshop"); ?>:</b></td>
305 <td>
306 <?php
307 unset($numbers);
308 $numbers[22] = '100';
309 $numbers[21] = 50;
310 for ($i=20; $i>=0; $i--) {
311 $numbers[$i] = $i;
313 choose_from_menu($numbers, "showleaguetable", $form->showleaguetable, "");
314 helpbutton("leaguetable", get_string("leaguetable", "workshop"), "workshop");
316 </td>
317 </tr>
319 <tr>
320 <td align="right"><b><?php print_string("hidenamesfromstudents", "workshop", $course->students) ?>:</b></td>
321 <td>
322 <?php
323 choose_from_menu($options, "anonymous", $form->anonymous, "");
324 helpbutton("anonymous", get_string("hidenamesfromstudents", "workshop", $course->students), "workshop");
326 </td>
327 </tr>
329 <tr>
330 <td align="right"><b><?php print_string("usepassword", "workshop"); ?>:</b></td>
331 <td>
332 <?php
333 $options[0] = get_string("no"); $options[1] = get_string("yes");
334 choose_from_menu($options, "usepassword", $form->usepassword, "");
335 helpbutton("password", get_string("usepassword", "workshop"), "workshop");
337 </td>
338 </tr>
340 <tr>
341 <td align="right"><b><?php print_string("password"); ?>:</b></td>
342 <td>
343 <input type="text" name="password" size="10" value="" alt="<?php print_string("password"); ?>" /> <?php echo " (".get_string("leavetokeep").")"; ?>
344 <?php helpbutton("password", get_string("password"), "workshop"); ?>
345 </td>
346 </tr>
348 <tr valign="top">
349 <td align="right"><b><?php print_string("maximumsize", "workshop") ?>:</b></td>
350 <td>
351 <?php
352 $choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
353 choose_from_menu($choices, "maxbytes", "$form->maxbytes","" );
355 </td>
356 </tr>
358 <tr valign="top">
359 <td align="right"><b><?php print_string("submissionstart", "workshop") ?>:</b></td>
360 <td><?php
361 print_date_selector("submissionstartday", "submissionstartmonth", "submissionstartyear", $form->submissionstart);
362 echo "&nbsp;-&nbsp;";
363 print_time_selector("submissionstarthour", "submissionstartminute", $form->submissionstart);
364 helpbutton("submissionstart", get_string("submissionstart", "workshop"), "workshop");
365 ?></td>
366 </tr>
368 <tr valign="top">
369 <td align="right"><b><?php print_string("assessmentstart", "workshop") ?>:</b></td>
370 <td><?php
371 print_date_selector("assessmentstartday", "assessmentstartmonth", "assessmentstartyear", $form->assessmentstart);
372 echo "&nbsp;-&nbsp;";
373 print_time_selector("assessmentstarthour", "assessmentstartminute", $form->assessmentstart);
374 helpbutton("assessmentstart", get_string("assessmentstart", "workshop"), "workshop");
375 ?></td>
376 </tr>
378 <tr valign="top">
379 <td align="right"><b><?php print_string("submissionend", "workshop") ?>:</b></td>
380 <td><?php
381 print_date_selector("submissionendday", "submissionendmonth", "submissionendyear", $form->submissionend);
382 echo "&nbsp;-&nbsp;";
383 print_time_selector("submissionendhour", "submissionendminute", $form->submissionend);
384 helpbutton("submissionend", get_string("submissionend", "workshop"), "workshop");
385 ?></td>
386 </tr>
388 <tr valign="top">
389 <td align="right"><b><?php print_string("assessmentend", "workshop") ?>:</b></td>
390 <td><?php
391 print_date_selector("assessmentendday", "assessmentendmonth", "assessmentendyear", $form->assessmentend);
392 echo "&nbsp;-&nbsp;";
393 print_time_selector("assessmentendhour", "assessmentendminute", $form->assessmentend);
394 helpbutton("assessmentend", get_string("assessmentend", "workshop"), "workshop");
395 ?></td>
396 </tr>
397 <tr valign="top">
398 <td align="right"><b><?php print_string("releaseteachergrades", "workshop") ?>:</b></td>
399 <td><?php
400 print_date_selector("releaseday", "releasemonth", "releaseyear", $form->releasegrades);
401 echo "&nbsp;-&nbsp;";
402 print_time_selector("releasehour", "releaseminute", $form->releasegrades);
403 helpbutton("releasegrades", get_string("releaseteachergrades", "workshop"), "workshop");
404 ?></td>
405 </tr>
406 <?php
407 $features = new stdClass;
408 $features->groupings = true;
409 print_standard_coursemodule_settings($form, $features);
411 </table>
412 <br />
413 <div class="boxaligncenter">
414 <input type="hidden" name="course" value="<?php p($form->course) ?>" />
415 <input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
416 <input type="hidden" name="coursemodule" value="<?php p($form->coursemodule) ?>" />
417 <input type="hidden" name="section" value="<?php p($form->section) ?>" />
418 <input type="hidden" name="module" value="<?php p($form->module) ?>" />
419 <input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" />
420 <input type="hidden" name="instance" value="<?php p($form->instance) ?>" />
421 <input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
422 <input type="submit" value="<?php print_string("savechanges") ?>" />
423 <input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
424 </div>
425 </form>