2002-10-16 05:31:56 +00:00
|
|
|
<?
|
|
|
|
if ($usehtmleditor = can_use_richtext_editor()) {
|
|
|
|
$defaultformat = FORMAT_HTML;
|
|
|
|
$onsubmit = "onsubmit=\"copyrichtext(document.form.description);\"";
|
|
|
|
} else {
|
|
|
|
$defaultformat = FORMAT_MOODLE;
|
|
|
|
$onsubmit = "";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
|
2002-08-01 03:49:01 +00:00
|
|
|
<table cellpadding=5>
|
|
|
|
<tr valign=top>
|
2002-08-17 08:59:12 +00:00
|
|
|
<td align=right><P><B><? print_string("assignmentname", "assignment") ?>:</B></P></TD>
|
2002-08-01 03:49:01 +00:00
|
|
|
<td>
|
2002-10-16 05:31:56 +00:00
|
|
|
<input type="text" name="name" size=60 value="<? p($form->name) ?>">
|
2002-08-01 03:49:01 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign=top>
|
2002-08-17 08:59:12 +00:00
|
|
|
<td align=right><P><B><? print_string("description", "assignment") ?>:</B></P></TD>
|
2002-08-01 03:49:01 +00:00
|
|
|
<td>
|
2002-10-16 05:31:56 +00:00
|
|
|
<?
|
|
|
|
print_textarea($usehtmleditor, 20, 60, 595, 400, "description", $form->description);
|
|
|
|
|
|
|
|
if ($usehtmleditor) {
|
|
|
|
helpbutton("richtext", get_string("helprichtext"));
|
|
|
|
} else {
|
|
|
|
helpbutton("text", get_string("helptext"));
|
|
|
|
}
|
2002-11-06 08:12:06 +00:00
|
|
|
echo "<P align=right>";
|
2002-10-16 05:31:56 +00:00
|
|
|
print_string("formattexttype");
|
|
|
|
echo ": ";
|
|
|
|
if (!$form->format) {
|
|
|
|
$form->format = $defaultformat;
|
|
|
|
}
|
|
|
|
choose_from_menu(format_text_menu(), "format", $form->format, "");
|
2002-10-18 09:38:58 +00:00
|
|
|
helpbutton("textformat", get_string("formattexttype"));
|
2002-10-16 05:31:56 +00:00
|
|
|
echo "</P>";
|
|
|
|
?>
|
2002-08-01 03:49:01 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2002-08-04 16:19:37 +00:00
|
|
|
<tr valign=top>
|
2002-08-17 08:59:12 +00:00
|
|
|
<td align=right><P><B><? print_string("assignmenttype", "assignment") ?>:</B></P></TD>
|
2002-08-04 16:19:37 +00:00
|
|
|
<td>
|
2002-11-06 08:12:06 +00:00
|
|
|
<?PHP
|
|
|
|
require("$CFG->dirroot/mod/assignment/lib.php");
|
|
|
|
asort($ASSIGNMENT_TYPE);
|
|
|
|
choose_from_menu($ASSIGNMENT_TYPE, "type", $form->type, "");
|
|
|
|
helpbutton("assignmenttype", get_string("assignmenttype", "assignment"), "assignment");
|
|
|
|
?>
|
2002-08-04 16:19:37 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2002-11-15 03:32:30 +00:00
|
|
|
<tr>
|
|
|
|
<td align=right><P><B><? print_string("allowresubmit", "assignment") ?>:</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", "assignment"), "assignment");
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2002-08-04 16:19:37 +00:00
|
|
|
<tr valign=top>
|
2002-10-04 02:55:27 +00:00
|
|
|
<td align=right><P><B><? print_string("maximumgrade") ?>:</B></P></TD>
|
2002-08-04 16:19:37 +00:00
|
|
|
<td>
|
|
|
|
<?
|
|
|
|
for ($i=100; $i>=0; $i--) {
|
|
|
|
$grades[$i] = $i;
|
|
|
|
}
|
2002-11-06 08:12:06 +00:00
|
|
|
choose_from_menu($grades, "grade", "$form->grade", "");
|
2002-08-04 16:19:37 +00:00
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign=top>
|
2002-08-17 08:59:12 +00:00
|
|
|
<td align=right><P><B><? print_string("maximumsize", "assignment") ?>:</B></P></TD>
|
2002-08-04 16:19:37 +00:00
|
|
|
<td>
|
|
|
|
<?
|
2002-11-28 02:41:56 +00:00
|
|
|
$sizelist = array("10Kb", "50Kb", "100Kb", "500Kb", "1Mb", "2Mb", "5Mb", "10Mb", "20Mb", "50Mb");
|
|
|
|
$maxsize = get_max_upload_file_size();
|
2002-12-07 04:00:05 +00:00
|
|
|
$sizeinlist = false;
|
2002-11-28 02:41:56 +00:00
|
|
|
foreach ($sizelist as $size) {
|
|
|
|
$sizebytes = get_real_size($size);
|
|
|
|
if ($sizebytes < $maxsize) {
|
|
|
|
$filesize[$sizebytes] = $size;
|
|
|
|
}
|
2002-12-07 04:00:05 +00:00
|
|
|
if ($form->maxbytes == $sizebytes) {
|
|
|
|
$sizeinlist = true;
|
|
|
|
}
|
2002-11-28 02:41:56 +00:00
|
|
|
}
|
|
|
|
$filesize[$maxsize] = display_size($maxsize);
|
2002-12-07 04:00:05 +00:00
|
|
|
if (!$sizeinlist) {
|
2002-11-28 02:41:56 +00:00
|
|
|
$form->maxbytes = get_real_size("500K");
|
2002-08-04 16:19:37 +00:00
|
|
|
}
|
2002-11-28 02:41:56 +00:00
|
|
|
ksort($filesize, SORT_NUMERIC);
|
2002-08-04 16:19:37 +00:00
|
|
|
choose_from_menu($filesize, "maxbytes", "$form->maxbytes");
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2002-08-01 03:49:01 +00:00
|
|
|
<tr valign=top>
|
2002-08-17 08:59:12 +00:00
|
|
|
<td align=right><P><B><? print_string("duedate", "assignment") ?>:</B></td>
|
2002-08-01 03:49:01 +00:00
|
|
|
<td><?
|
2002-08-04 16:19:37 +00:00
|
|
|
print_date_selector("dueday", "duemonth", "dueyear", $form->timedue);
|
|
|
|
echo " - ";
|
|
|
|
print_time_selector("duehour", "dueminute", $form->timedue);
|
2002-08-01 03:49:01 +00:00
|
|
|
formerr($err["duedate"]);
|
|
|
|
?></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2002-10-16 05:31:56 +00:00
|
|
|
<BR>
|
2002-08-01 03:49:01 +00:00
|
|
|
<CENTER>
|
|
|
|
<input type="hidden" name=course value="<? p($form->course) ?>">
|
|
|
|
<input type="hidden" name=coursemodule value="<? p($form->coursemodule) ?>">
|
|
|
|
<input type="hidden" name=section value="<? p($form->section) ?>">
|
|
|
|
<input type="hidden" name=module value="<? p($form->module) ?>">
|
|
|
|
<input type="hidden" name=modulename value="<? p($form->modulename) ?>">
|
|
|
|
<input type="hidden" name=instance value="<? p($form->instance) ?>">
|
|
|
|
<input type="hidden" name=mode value="<? p($form->mode) ?>">
|
2002-08-17 08:59:12 +00:00
|
|
|
<input type="submit" value="<? print_string("savechanges") ?>">
|
2002-10-16 04:51:55 +00:00
|
|
|
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
|
2002-08-01 03:49:01 +00:00
|
|
|
</CENTER>
|
|
|
|
</FORM>
|
2002-10-16 05:31:56 +00:00
|
|
|
|
|
|
|
<?
|
|
|
|
if ($usehtmleditor) {
|
|
|
|
print_richedit_javascript("form", "description", "no");
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|