mirror of
https://github.com/moodle/moodle.git
synced 2025-02-15 21:36:58 +01:00
The most notable one is the new online assignment type, which is a good example of how little code really needs to be written to make new assignment types now.
139 lines
4.4 KiB
HTML
139 lines
4.4 KiB
HTML
<?php
|
|
require_once("$CFG->dirroot/mod/assignment/lib.php");
|
|
|
|
if (empty($form->name)) {
|
|
$form->name = "";
|
|
}
|
|
if (empty($form->description)) {
|
|
$form->description = "";
|
|
}
|
|
if (empty($form->format)) {
|
|
$form->format = "";
|
|
}
|
|
if (empty($form->assignmenttype)) {
|
|
$form->assignmenttype = "uploadsingle";
|
|
}
|
|
if (empty($form->resubmit)) {
|
|
$form->resubmit = "";
|
|
}
|
|
if (!isset($form->grade)) {
|
|
$form->grade = 100;
|
|
}
|
|
if (!isset($form->timedue)) {
|
|
$form->timedue = time()+7*24*3600;
|
|
}
|
|
if (!isset($form->timeavailable)) {
|
|
$form->timeavailable = time();
|
|
}
|
|
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" action="../mod/assignment/details.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) ?>">
|
|
</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("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("availabledate","assignment") ?>:</b></td>
|
|
<td><?php
|
|
print_date_selector("availableday", "availablemonth", "availableyear", $form->timeavailable);
|
|
echo " - ";
|
|
print_time_selector("availablehour", "availableminute", $form->timeavailable);
|
|
?></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>
|
|
|
|
<tr valign="top">
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("assignmenttype", "assignment") ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
$ASSIGNMENT_TYPES = assignment_types();
|
|
choose_from_menu($ASSIGNMENT_TYPES, "assignmenttype", $form->assignmenttype, "");
|
|
helpbutton("assignment/types", get_string("assignmenttype", "assignment"), "moodle");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
<br />
|
|
<center>
|
|
<!-- <input type="hidden" name=grade value="<?php p($form->grade) ?>" /> -->
|
|
<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('next') ?> »" />
|
|
<input type="submit" name=cancel value="<?php print_string('cancel') ?>" />
|
|
</center>
|
|
</form>
|