mirror of
https://github.com/moodle/moodle.git
synced 2025-02-02 06:10:08 +01:00
bbcbc0fecc
Still needs PostgreSQL support and wider testing
102 lines
3.3 KiB
HTML
102 lines
3.3 KiB
HTML
<!-- define a new instance of lesson -->
|
|
<!-- It is used from /course/mod.php. The whole instance is available as $form. -->
|
|
<?php
|
|
// set the defaults
|
|
if (empty($form->name)) {
|
|
$form->name = "";
|
|
}
|
|
if (!isset($form->grade)) {
|
|
$form->grade = 0;
|
|
}
|
|
if (!isset($form->maxanswers)) {
|
|
$form->maxanswers = 4;
|
|
}
|
|
if (!isset($form->retake)) {
|
|
$form->retake = 1;
|
|
}
|
|
if (!isset($form->available)) {
|
|
$form->available = 0;
|
|
}
|
|
if (!isset($form->deadline)) {
|
|
$form->deadline = 0;
|
|
}
|
|
?>
|
|
|
|
<FORM name="form" method="post" action="<?php echo $ME ?>">
|
|
<CENTER>
|
|
<TABLE cellpadding=5>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><?php print_string("name") ?>:</B></P></TD>
|
|
<TD>
|
|
<INPUT type="text" name="name" size=30 value="<?php p($form->name) ?>">
|
|
</TD>
|
|
</TR>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><?php print_string("maximumgrade") ?>:</B></P></TD>
|
|
<td>
|
|
<?php
|
|
for ($i=100; $i>=0; $i--) {
|
|
$grades[$i] = $i;
|
|
}
|
|
choose_from_menu($grades, "grade", "$form->grade", "");
|
|
helpbutton("grade", get_string("maximumgrade", "lesson"), "lesson");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><?php print_string("maximumnumberofanswers", "lesson") ?>:</B></P></TD>
|
|
<td>
|
|
<?php
|
|
for ($i=10; $i>1; $i--) {
|
|
$numbers[$i] = $i;
|
|
}
|
|
choose_from_menu($numbers, "maxanswers", "$form->maxanswers", "");
|
|
helpbutton("maxanswers", get_string("maximumnumberofanswers", "lesson"), "lesson");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align=right><P><B><?php print_string("canretake", "lesson", $course->student) ?>:</B></P></TD>
|
|
<td>
|
|
<?PHP
|
|
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
|
choose_from_menu($options, "retake", $form->retake, "");
|
|
helpbutton("retake", get_string("canretake", "lesson"), "lesson");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><?php print_string("available", "lesson") ?>:</B></td>
|
|
<td><?php
|
|
print_date_selector("availableday", "availablemonth", "availableyear", $form->available);
|
|
echo " - ";
|
|
print_time_selector("availablehour", "availableminute", $form->available);
|
|
?></td>
|
|
</tr>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><?php print_string("deadline", "lesson") ?>:</B></td>
|
|
<td><?php
|
|
print_date_selector("deadlineday", "deadlinemonth", "deadlineyear", $form->deadline);
|
|
echo " - ";
|
|
print_time_selector("deadlinehour", "deadlineminute", $form->deadline);
|
|
?></td>
|
|
</tr>
|
|
|
|
</TABLE>
|
|
<!-- These hidden variables are always the same -->
|
|
<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") ?>">
|
|
</CENTER>
|
|
</FORM>
|