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
)) {
9 if (empty($form->description
)) {
10 $form->description
= "";
12 if (empty($form->format
)) {
15 if (!isset($form->gradinggrade
)) {
16 $form->gradinggrade
= 100;
18 if (!isset($form->grade
)) {
21 if (!isset($form->gradingstrategy
)) {
22 $form->gradingstrategy
= 1; // default is accumulative
24 if (!isset($form->nelements
)) {
27 if (!isset($form->nattachments
)) {
28 $form->nattachments
= 0;
30 if (empty($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
)) {
63 if (empty($form->usepassword
)) {
64 $form->usepassword
= 0;
66 if (empty($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">
89 <td align=
"right"><b><?php print_string("title", "workshop") ?>:
</b></td>
91 <input type=
"text" name=
"name" size=
"60" value=
"<?php p($form->name) ?>" alt
="<?php print_string("title
", "workshop
") ?>" />
95 <td align
="right"><b
><?php
print_string("description", "workshop") ?>:
</b><br />
97 helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
100 helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
102 helpbutton("text", get_string("helptext"), "moodle", true, true);
104 emoticonhelpbutton("form", "description", "moodle", true, true);
112 print_textarea($usehtmleditor, 20, 60, 595, 400, "description", $form->description
);
114 if ($usehtmleditor) {
115 echo '<input type="hidden" name="format" value="'.FORMAT_HTML
.'" />';
117 echo '<p style="text-align:right">';
118 helpbutton("textformat", get_string("formattexttype"));
119 print_string("formattexttype");
121 if (!$form->format
) {
122 $form->format
= $defaultformat;
124 choose_from_menu(format_text_menu(), "format", $form->format
, "");
132 <td align=
"right"><b><?php print_string("gradeforassessments", "workshop") ?>:
</b></td>
135 for ($i=100; $i>=0; $i--) {
138 choose_from_menu($grades, "gradinggrade", "$form->gradinggrade", "");
139 helpbutton("gradinggrade", get_string("gradeforassessments", "workshop"), "workshop");
145 <td align=
"right"><b><?php print_string("gradeforsubmission", "workshop") ?>:
</b></td>
148 choose_from_menu($grades, "grade", "$form->grade", "");
149 helpbutton("grade", get_string("gradeforsubmission", "workshop"), "workshop");
155 <td align=
"right"><b><?php print_string("gradingstrategy", "workshop") ?>:
</b></td>
158 choose_from_menu($WORKSHOP_TYPE, "gradingstrategy", $form->gradingstrategy
, "");
159 helpbutton("gradingstrategy", get_string("gradingstrategy", "workshop"), "workshop");
165 <td align=
"right"><b><?php print_string("numberofassessmentelements", "workshop") ?>:
</b></td>
168 for ($i=20; $i>=0; $i--) {
171 choose_from_menu($numbers, "nelements", "$form->nelements", "");
172 helpbutton("nelements", get_string("numberofassessmentelements", "workshop"), "workshop");
178 <td align=
"right"><b><?php print_string("numberofattachments", "workshop") ?>:
</b></td>
182 for ($i=5; $i>=0; $i--) {
185 choose_from_menu($numbers, "nattachments", "$form->nattachments", "");
186 helpbutton("nattachments", get_string("numberofattachments", "workshop"), "workshop");
192 <td align=
"right"><b><?php print_string("allowresubmit", "workshop") ?>:
</b></td>
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");
203 <td align=
"right"><b><?php print_string("numberofassessmentsofteachersexamples", "workshop") ?>:
</b></td>
207 for ($i=20; $i>=0; $i--) {
210 choose_from_menu($numbers, "ntassessments", $form->ntassessments
, "");
211 helpbutton("nassessmentsofteachersexamples", get_string("numberofassessmentsofteachersexamples", "workshop"), "workshop");
217 <td align=
"right"><b><?php print_string("comparisonofassessments", "workshop") ?>:
</b></td>
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");
231 <td align=
"right"><b><?php print_string("numberofassessmentsofstudentsubmissions", "workshop") ?>:
</b></td>
235 for ($i=20; $i>=0; $i--) {
238 choose_from_menu($numbers, "nsassessments", $form->nsassessments
, "");
239 helpbutton("nassessmentsofstudentsubmissions", get_string("numberofassessmentsofstudentsubmissions", "workshop"), "workshop");
245 <td align=
"right"><b><?php print_string("weightforteacherassessments", "workshop") ?>:
</b></td>
249 for ($i=10; $i>=0; $i--) {
252 choose_from_menu($numbers, "teacherweight", $form->teacherweight
, "");
253 helpbutton("teacherweight", get_string("weightforteacherassessments", "workshop"), "workshop");
259 <td align=
"right"><b><?php print_string("overallocation", "workshop") ?>:
</b></td>
263 for ($i=2; $i>=0; $i--) {
266 choose_from_menu($numbers, "overallocation", "$form->overallocation", "");
267 helpbutton("overallocation", get_string("overallocation", "workshop"), "workshop");
273 <td align=
"right"><b><?php print_string("selfassessment", "workshop") ?>:
</b></td>
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");
284 <td align=
"right"><b><?php print_string("assessmentsmustbeagreed", "workshop") ?>:
</b></td>
287 choose_from_menu($options, "agreeassessments", $form->agreeassessments
, "");
288 helpbutton("agreeassessments", get_string("assessmentsmustbeagreed", "workshop"), "workshop");
294 <td align=
"right"><b><?php print_string("hidegradesbeforeagreement", "workshop") ?>:
</b></td>
297 choose_from_menu($options, "hidegrades", $form->hidegrades
, "");
298 helpbutton("showinggrades", get_string("hidegradesbeforeagreement", "workshop"), "workshop");
304 <td align=
"right"><b><?php print_string("leaguetable", "workshop"); ?>:
</b></td>
308 $numbers[22] = '100';
310 for ($i=20; $i>=0; $i--) {
313 choose_from_menu($numbers, "showleaguetable", $form->showleaguetable
, "");
314 helpbutton("leaguetable", get_string("leaguetable", "workshop"), "workshop");
320 <td align=
"right"><b><?php print_string("hidenamesfromstudents", "workshop", $course->students
) ?>:
</b></td>
323 choose_from_menu($options, "anonymous", $form->anonymous
, "");
324 helpbutton("anonymous", get_string("hidenamesfromstudents", "workshop", $course->students
), "workshop");
330 <td align=
"right"><b><?php print_string("usepassword", "workshop"); ?>:
</b></td>
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");
341 <td align=
"right"><b><?php print_string("password"); ?>:
</b></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"); ?>
349 <td align=
"right"><b><?php print_string("maximumsize", "workshop") ?>:
</b></td>
352 $choices = get_max_upload_sizes($CFG->maxbytes
, $course->maxbytes
);
353 choose_from_menu($choices, "maxbytes", "$form->maxbytes","" );
359 <td align=
"right"><b><?php print_string("submissionstart", "workshop") ?>:
</b></td>
361 print_date_selector("submissionstartday", "submissionstartmonth", "submissionstartyear", $form->submissionstart
);
362 echo " - ";
363 print_time_selector("submissionstarthour", "submissionstartminute", $form->submissionstart
);
364 helpbutton("submissionstart", get_string("submissionstart", "workshop"), "workshop");
369 <td align=
"right"><b><?php print_string("assessmentstart", "workshop") ?>:
</b></td>
371 print_date_selector("assessmentstartday", "assessmentstartmonth", "assessmentstartyear", $form->assessmentstart
);
372 echo " - ";
373 print_time_selector("assessmentstarthour", "assessmentstartminute", $form->assessmentstart
);
374 helpbutton("assessmentstart", get_string("assessmentstart", "workshop"), "workshop");
379 <td align=
"right"><b><?php print_string("submissionend", "workshop") ?>:
</b></td>
381 print_date_selector("submissionendday", "submissionendmonth", "submissionendyear", $form->submissionend
);
382 echo " - ";
383 print_time_selector("submissionendhour", "submissionendminute", $form->submissionend
);
384 helpbutton("submissionend", get_string("submissionend", "workshop"), "workshop");
389 <td align=
"right"><b><?php print_string("assessmentend", "workshop") ?>:
</b></td>
391 print_date_selector("assessmentendday", "assessmentendmonth", "assessmentendyear", $form->assessmentend
);
392 echo " - ";
393 print_time_selector("assessmentendhour", "assessmentendminute", $form->assessmentend
);
394 helpbutton("assessmentend", get_string("assessmentend", "workshop"), "workshop");
398 <td align=
"right"><b><?php print_string("releaseteachergrades", "workshop") ?>:
</b></td>
400 print_date_selector("releaseday", "releasemonth", "releaseyear", $form->releasegrades
);
401 echo " - ";
402 print_time_selector("releasehour", "releaseminute", $form->releasegrades
);
403 helpbutton("releasegrades", get_string("releaseteachergrades", "workshop"), "workshop");
406 <?php print_standard_coursemodule_settings($form); ?>
409 <div class=
"boxaligncenter">
410 <input type=
"hidden" name=
"course" value=
"<?php p($form->course) ?>" />
411 <input type
="hidden" name
="sesskey" value
="<?php p($form->sesskey) ?>" />
412 <input type
="hidden" name
="coursemodule" value
="<?php p($form->coursemodule) ?>" />
413 <input type
="hidden" name
="section" value
="<?php p($form->section) ?>" />
414 <input type
="hidden" name
="module" value
="<?php p($form->module) ?>" />
415 <input type
="hidden" name
="modulename" value
="<?php p($form->modulename) ?>" />
416 <input type
="hidden" name
="instance" value
="<?php p($form->instance) ?>" />
417 <input type
="hidden" name
="mode" value
="<?php p($form->mode) ?>" />
418 <input type
="submit" value
="<?php print_string("savechanges
") ?>" />
419 <input type
="submit" name
="cancel" value
="<?php print_string("cancel
") ?>" />