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
|
<?php
// ...and fill the form if needed
if (empty($form->name)) {
$form->name = "";
}
if (empty($form->description)) {
$form->description = "";
}
if (empty($form->format)) {
$form->format = "";
}
if (!isset($form->grade)) {
$form->grade = 100;
}
if (!isset($form->nelements)) {
$form->nelements = 1;
}
if (empty($form->resubmit)) {
$form->resubmit = "";
}
if (!isset($form->ntassessments)) {
$form->ntassessments = 0;
}
if (!isset($form->nsassessments)) {
$form->nsassessments = 0;
}
if (empty($form->includeself)) {
$form->includeself = "";
}
if (empty($form->agreeassessments)) {
$form->agreeassessments = "";
}
if (empty($form->hidegrades)) {
$form->hidegrades = "";
}
if (empty($form->maxbytes)) {
$form->maxbytes = "";
}
if (empty($form->deadline)) {
$form->deadline = "";
}
?>
<form name="form" method="post" action="mod.php">
<table cellpadding=5>
<tr valign=top>
<td align=right><P><B><?php print_string("title", "workshop") ?>:</B></P></TD>
<td>
<input type="text" name="name" size=60 value="<?php p($form->name) ?>">
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("description", "workshop") ?>:</b></p>
<font size="1">
<?php
helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
echo "<br />";
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
helpbutton("text", get_string("helptext"), "moodle", true, true);
echo "<br />";
emoticonhelpbutton("form", "description", "moodle", true, true);
echo "<br />";
}
?>
<br />
</font>
<td>
<?php
print_textarea($usehtmleditor, 20, 60, 595, 400, "description", $form->description);
if ($usehtmleditor) {
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
} else {
echo '<p align="right">';
helpbutton("textformat", get_string("formattexttype"));
print_string("formattexttype");
echo ': ';
if (!$form->format) {
$form->format = $defaultformat;
}
choose_from_menu(format_text_menu(), "format", $form->format, "");
echo '</p>';
}
?>
</td>
</tr>
<tr valign=top>
<td align=right><P><B><?php print_string("maximumgrade") ?>:</B></P></TD>
<td>
<?php
for ($i=100; $i>=0; $i--) {
$grades[$i] = $i;
}
choose_from_menu($grades, "grade", "$form->grade", "");
?>
</td>
</tr>
<tr valign=top>
<td align=right><P><B><?php print_string("gradingstrategy", "workshop") ?>:</B></P></TD>
<td>
<?PHP
require("$CFG->dirroot/mod/workshop/lib.php");
if (!isset($form->gradingstrategy)) {
$form->gradingstrategy = 1; // default
}
choose_from_menu($WORKSHOP_TYPE, "gradingstrategy", $form->gradingstrategy, "");
helpbutton("gradingstrategy", get_string("gradingstrategy", "workshop"), "workshop");
?>
</td>
</tr>
<tr valign=top>
<td align=right><P><B><?php print_string("numberofassessmentelements", "workshop") ?>:</B></P></TD>
<td valign="middle">
<?php
for ($i=20; $i>=0; $i--) {
$numbers[$i] = $i;
}
choose_from_menu($numbers, "nelements", "$form->nelements", "");
helpbutton("nelements", get_string("numberofassessmentelements", "workshop"), "workshop");
?>
</td>
</tr>
<tr>
<td align=right><P><B><?php print_string("allowresubmit", "workshop") ?>:</B></P></TD>
<td>
<?PHP
$options[0] = get_string("no"); $options[1] = get_string("yes");
choose_from_menu($options, "resubmit", $form->resubmit, "");
helpbutton("resubmit", get_string("allowresubmit", "workshop"), "workshop");
?>
</td>
</tr>
<tr valign=top>
<td align=right><P><B><?php print_string("numberofassessmentsofteachersexamples", "workshop") ?>:</B></P></TD>
<td>
<?PHP
for ($i=20; $i>=0; $i--) {
$numbers[$i] = $i;
}
choose_from_menu($numbers, "ntassessments", $form->ntassessments, "");
helpbutton("nassessmentsofteachersexamples", get_string("numberofassessmentsofteachersexamples", "workshop"), "workshop");
?>
</td>
</tr>
<tr valign=top>
<td align=right><P><B><?php print_string("numberofassessmentsofstudentsubmissions", "workshop") ?>:</B></P></TD>
<td>
<?PHP
for ($i=20; $i>=0; $i--) {
$numbers[$i] = $i;
}
choose_from_menu($numbers, "nsassessments", $form->nsassessments, "");
helpbutton("nassessmentsofstudentsubmissions", get_string("numberofassessmentsofstudentsubmissions", "workshop"), "workshop");
?>
</td>
</tr>
<tr>
<td align=right><P><B><?php print_string("selfassessment", "workshop") ?>:</B></P></TD>
<td>
<?PHP
$options[0] = get_string("no"); $options[1] = get_string("yes");
choose_from_menu($options, "includeself", $form->includeself, "");
helpbutton("selfassessment", get_string("selfassessment", "workshop"), "workshop");
?>
</td>
</tr>
<tr>
<td align=right><P><B><?php print_string("assessmentsmustbeagreed", "workshop") ?>:</B></P></TD>
<td>
<?PHP
$options[0] = get_string("no"); $options[1] = get_string("yes");
choose_from_menu($options, "agreeassessments", $form->agreeassessments, "");
helpbutton("agreeassessments", get_string("assessmentsmustbeagreed", "workshop"), "workshop");
?>
</td>
</tr>
<tr>
<td align=right><P><B><?php print_string("hidegradesbeforeagreement", "workshop") ?>:</B></P></TD>
<td>
<?PHP
$options[0] = get_string("no"); $options[1] = get_string("yes");
choose_from_menu($options, "hidegrades", $form->hidegrades, "");
helpbutton("showinggrades", get_string("hidegradesbeforeagreement", "workshop"), "workshop");
?>
</td>
</tr>
<tr valign=top>
<td align=right><P><B><?php print_string("maximumsize", "workshop") ?>:</B></P></TD>
<td>
<?php
$sizelist = array("10Kb", "50Kb", "100Kb", "500Kb", "1Mb", "2Mb", "5Mb", "10Mb", "20Mb", "50Mb");
$maxsize = get_max_upload_file_size();
$sizeinlist = false;
foreach ($sizelist as $size) {
$sizebytes = get_real_size($size);
if ($sizebytes < $maxsize) {
$filesize[$sizebytes] = $size;
}
if ($form->maxbytes == $sizebytes) {
$sizeinlist = true;
}
}
$filesize[$maxsize] = display_size($maxsize);
if (!$sizeinlist) {
$form->maxbytes = get_real_size("500K");
}
ksort($filesize, SORT_NUMERIC);
choose_from_menu($filesize, "maxbytes", "$form->maxbytes", "");
?>
</td>
</tr>
<tr valign=top>
<td align=right><P><B><?php print_string("deadline", "workshop") ?>:</B></td>
<td><?php
print_date_selector("deadlineday", "deadlinemonth", "deadlineyear", $form->deadline);
echo " - ";
print_time_selector("deadlinehour", "deadlineminute", $form->deadline);
?></td>
</tr>
</table>
<BR>
<CENTER>
<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="submit" value="<?php print_string("savechanges") ?>">
<input type="submit" name=cancel value="<?php print_string("cancel") ?>">
<p>
<p><?PHP notify(get_string("noteonassessmentelements", "workshop")); ?>
</CENTER>
</FORM>
|