mirror of
https://github.com/moodle/moodle.git
synced 2025-02-26 21:13:33 +01:00
185 lines
5.9 KiB
HTML
185 lines
5.9 KiB
HTML
<!-- define a new instance of lesson -->
|
|
<!-- It is used from /course/mod.php. The whole instance is available as $form. -->
|
|
<?php
|
|
|
|
require_once("$CFG->dirroot/mod/lesson/lib.php"); // for parameter array
|
|
$nohtmleditorneeded = true;
|
|
|
|
// set the defaults
|
|
if (empty($form->name)) {
|
|
$form->name = "";
|
|
}
|
|
if (!isset($form->grade)) {
|
|
$form->grade = 0;
|
|
}
|
|
if (!isset($form->usemaxgrade)) {
|
|
$form->usemaxgrade = 0;
|
|
}
|
|
if (!isset($form->maxanswers)) {
|
|
$form->maxanswers = 4;
|
|
}
|
|
if (!isset($form->maxattempts)) {
|
|
$form->maxattempts = 5;
|
|
}
|
|
if (!isset($form->nextpagedefault)) {
|
|
$form->nextpagedefault = 0;
|
|
}
|
|
if (!isset($form->minquestions)) {
|
|
$form->minquestions = 0;
|
|
}
|
|
if (!isset($form->maxpages)) {
|
|
$form->maxpages = 0;
|
|
}
|
|
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("maximumnumberofanswersbranches", "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("maximumnumberofanswersbranches", "lesson"), "lesson");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><p><b><?php print_string("maximumnumberofattempts", "lesson") ?>:</b></p></td>
|
|
<td>
|
|
<?php
|
|
unset($numbers);
|
|
for ($i=10; $i>0; $i--) {
|
|
$numbers[$i] = $i;
|
|
}
|
|
choose_from_menu($numbers, "maxattempts", "$form->maxattempts", "");
|
|
helpbutton("maxattempts", get_string("maximumnumberofattempts", "lesson"), "lesson");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="right"><p><b><?php print_string("actionaftercorrectanswer", "lesson") ?>:</b></p></td>
|
|
<td>
|
|
<?php
|
|
choose_from_menu($LESSON_NEXTPAGE_ACTION, "nextpagedefault", $form->nextpagedefault, "");
|
|
helpbutton("nextpageaction", get_string("actionaftercorrectanswer", "lesson"), "lesson");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><p><b><?php print_string("minimumnumberofquestions", "lesson") ?>:</b></p></td>
|
|
<td>
|
|
<?php
|
|
unset($numbers);
|
|
for ($i=100; $i>=0; $i--) {
|
|
$numbers[$i] = $i;
|
|
}
|
|
choose_from_menu($numbers, "minquestions", "$form->minquestions", "");
|
|
helpbutton("minquestions", get_string("minimumnumberofquestions", "lesson"), "lesson");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><p><b><?php print_string("numberofpagestoshow", "lesson") ?>:</b></p></td>
|
|
<td>
|
|
<?php
|
|
unset($numbers);
|
|
for ($i=100; $i>=0; $i--) {
|
|
$numbers[$i] = $i;
|
|
}
|
|
choose_from_menu($numbers, "maxpages", "$form->maxpages", "");
|
|
helpbutton("maxpages", get_string("numberofpagestoshow", "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", $course->student), "lesson");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="right"><p><b><?php print_string("handlingofretakes", "lesson") ?>:</b></p></td>
|
|
<td>
|
|
<?php
|
|
$options[0] = get_string("usemean", "lesson"); $options[1] = get_string("usemaximum", "lesson");
|
|
choose_from_menu($options, "usemaxgrade", $form->usemaxgrade, "");
|
|
helpbutton("handlingofretakes", get_string("handlingofretakes", "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>
|