mirrored from git://git.moodle.org/moodle.git
/
mod.html
131 lines (129 loc) · 4.29 KB
/
mod.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?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 = "";
}
?>
<form name="form" method="post" 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);
if ($usehtmleditor) {
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
} else {
echo '<p 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 '</p>';
}
?>
</td>
</tr>
<tr valign="top">
<td align=right><p><b><?php print_string("assignmenttype", "assignment") ?>:</b></p></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><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 " - ";
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>