mirror of
https://github.com/moodle/moodle.git
synced 2025-01-20 15:08:32 +01:00
48e535bc35
The visibility of coursemodules is now always set through the function set_coursemodule_visible() in order to make sure that the associated events get updated in the calendar appropriately. If moving a coursemodule to a hidden section then the module is set to hidden as well and its events are hidden in the calendar. If deleting a coursemodule its events are deleted from the calendar. The function choose_from_menu() has an extra optional argument $disabled which, when set to true, will disable the menu. For the sake of consistency the function set_groupmode_for_module has been renamed to set_coursemodule_groupmode and the functions show_course_module() and hide_course_module() have been combined to set_coursemodule_visible().
144 lines
4.9 KiB
HTML
144 lines
4.9 KiB
HTML
<?php
|
|
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 = '';
|
|
}
|
|
if (empty($form->emailteachers)) {
|
|
$form->emailteachers = '';
|
|
}
|
|
?>
|
|
|
|
<form name="form" method="post" action="mod.php">
|
|
<table cellpadding="5">
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('assignmentname', 'assignment') ?>:</b></td>
|
|
<td>
|
|
<input type="text" name="name" size="60" value="<?php p($form->name) ?>" alt="<?php print_string('assignmentname', 'assignment') ?>" />
|
|
</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string('description', 'assignment') ?>:</b><br /><br />
|
|
<?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");
|
|
}
|
|
?>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
print_textarea($usehtmleditor, 20, 60, 680, 400, "description", $form->description);
|
|
|
|
if ($usehtmleditor) {
|
|
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
|
|
} else {
|
|
echo '<div 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 '</div>';
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("assignmenttype", "assignment") ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
require_once("$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"><b><?php print_string("allowresubmit", "assignment") ?>:</b></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>
|
|
<td align="right"><b><?php print_string("emailteachers", "assignment") ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
|
choose_from_menu($options, "emailteachers", $form->emailteachers, "");
|
|
helpbutton("emailteachers", get_string("emailteachers", "assignment"), "assignment");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("grade") ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
print_grade_menu($course->id, "grade", "$form->grade");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("maximumsize", "assignment") ?>:</b></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"><b><?php print_string("duedate", "assignment") ?>:</b></td>
|
|
<td><?php
|
|
print_date_selector("dueday", "duemonth", "dueyear", $form->timedue);
|
|
echo " - ";
|
|
print_time_selector("duehour", "dueminute", $form->timedue);
|
|
?></td>
|
|
</tr>
|
|
<?php print_standard_coursemodule_settings($form); ?>
|
|
</table>
|
|
<br />
|
|
<center>
|
|
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
|
|
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
|
|
<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>
|