moodle/mod/assignment/mod.html
moodler 4909e17632 These changes implement some better controls for controlling uploads.
1) There is a new site-wide configuration variable called maxbytes,
   which provides an upper filesize limit for all (student) uploads.

2) There is a new course-level variable called maxbytes, which further
   limits uploads within a course.

3) There is a new maxbytes field for forums, which further restricts
   the size allowed in a particular forum.  There is also a new config
   variable in the module configuration to specify a default size
   to use when defining a new forum.

4) Assignments already had a limit, but this is now aware of the other
   limits, and like forums there is now a settable default value.

5) Finally, the sizes of files (Gb, Mb, Kb, bytes) is now translatable
   in the language packs.
2003-10-06 18:02:35 +00:00

142 lines
4.5 KiB
HTML

<?php
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 = $CFG->assignment_maxbytes;
}
if (empty($form->timedue)) {
$form->timedue = "";
}
?>
<form name="form" method="post" <?php echo $onsubmit ?> action="mod.php">
<table cellpadding=5>
<tr valign=top>
<td align=right><p><b><?php print_string("assignmentname", "assignment") ?>:</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", "assignment") ?>:</b></p>
<font size="1">
<?php
helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
echo "<br />";
helpbutton("questions", get_string("helpquestions"), "moodle", true, true);
echo "<br />";
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
emoticonhelpbutton("form", "description");
}
?>
<br />
</font>
</td>
<td>
<?php
print_textarea($usehtmleditor, 20, 60, 680, 400, "description", $form->description);
echo "<p align=right>";
helpbutton("textformat", get_string("formattexttype"));
print_string("formattexttype");
echo ":&nbsp;";
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("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><?php 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><?php print_string("grade") ?>:</b></p></td>
<td>
<?php
print_grade_menu($course->id, "grade", "$form->grade");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("maximumsize", "assignment") ?>:</b></p></td>
<td><?php
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
choose_from_menu ($choices, "maxbytes", $form->maxbytes, "");
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("duedate", "assignment") ?>:</b></td>
<td><?php
print_date_selector("dueday", "duemonth", "dueyear", $form->timedue);
echo "&nbsp;-&nbsp;";
print_time_selector("duehour", "dueminute", $form->timedue);
?></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") ?>">
</center>
</form>
<?php
if ($usehtmleditor) {
print_richedit_javascript("form", "description", "yes");
}
?>