157 lines
5.0 KiB
HTML
157 lines
5.0 KiB
HTML
<?
|
|
if ($usehtmleditor = can_use_richtext_editor()) {
|
|
$defaultformat = FORMAT_HTML;
|
|
$onsubmit = "onsubmit=\"copyrichtext(document.form.description);\"";
|
|
} else {
|
|
$defaultformat = FORMAT_MOODLE;
|
|
$onsubmit = "";
|
|
}
|
|
if (empty($form->name)) {
|
|
$form->name = "";
|
|
}
|
|
if (empty($form->description)) {
|
|
$form->description = "";
|
|
}
|
|
if (empty($form->format)) {
|
|
$form->format = "";
|
|
}
|
|
if (empty($form->type)) {
|
|
$form->type = "";
|
|
}
|
|
if (empty($form->resubmit)) {
|
|
$form->resubmit = "";
|
|
}
|
|
if (!isset($form->grade)) {
|
|
$form->grade = 100;
|
|
}
|
|
if (empty($form->maxbytes)) {
|
|
$form->maxbytes = "";
|
|
}
|
|
if (empty($form->timedue)) {
|
|
$form->timedue = "";
|
|
}
|
|
?>
|
|
|
|
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
|
|
<table cellpadding=5>
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("assignmentname", "assignment") ?>:</B></P></TD>
|
|
<td>
|
|
<input type="text" name="name" size=60 value="<? p($form->name) ?>">
|
|
</td>
|
|
</tr>
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("description", "assignment") ?>:</B></P>
|
|
<font SIZE="1">
|
|
<? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
|
|
<? helpbutton("questions", get_string("helpquestions"), "moodle", true, true) ?><br \>
|
|
<? if ($usehtmleditor) { ?>
|
|
<? helpbutton("richtext", get_string("helprichtext"), "moodle", true, true) ?>
|
|
<? } else { ?>
|
|
<? helpbutton("text", get_string("helptext"), "moodle", true, true) ?>
|
|
<? } ?><br \>
|
|
</font>
|
|
</td>
|
|
<td>
|
|
<?
|
|
print_textarea($usehtmleditor, 20, 60, 680, 400, "description", $form->description);
|
|
|
|
echo "<P align=right>";
|
|
print_string("formattexttype");
|
|
echo ": ";
|
|
if (!$form->format) {
|
|
$form->format = $defaultformat;
|
|
}
|
|
choose_from_menu(format_text_menu(), "format", $form->format, "");
|
|
helpbutton("textformat", get_string("formattexttype"));
|
|
echo "</P>";
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("assignmenttype", "assignment") ?>:</B></P></TD>
|
|
<td>
|
|
<?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");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<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>
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("maximumgrade") ?>:</B></P></TD>
|
|
<td>
|
|
<?
|
|
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><? print_string("maximumsize", "assignment") ?>:</B></P></TD>
|
|
<td>
|
|
<?
|
|
$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><? print_string("duedate", "assignment") ?>:</B></td>
|
|
<td><?
|
|
print_date_selector("dueday", "duemonth", "dueyear", $form->timedue);
|
|
echo " - ";
|
|
print_time_selector("duehour", "dueminute", $form->timedue);
|
|
?></td>
|
|
</tr>
|
|
</table>
|
|
<BR>
|
|
<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) ?>">
|
|
<input type="submit" value="<? print_string("savechanges") ?>">
|
|
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
|
|
</CENTER>
|
|
</FORM>
|
|
|
|
<?
|
|
if ($usehtmleditor) {
|
|
print_richedit_javascript("form", "description", "yes");
|
|
}
|
|
?>
|
|
|