moodle/mod/exercise/mod.html
gustav_delius 48e535bc35 Activities can now be hidden/shown from the activity editing page. Also for modules that know about groups the groupmode can be set from there. See bug 2533. This required adding to the mod.html files calls to new functions print_visible_setting() and print_groupmode_setting() which are combined in print_standard_coursemodule_settings().
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().
2005-02-12 21:41:22 +00:00

233 lines
7.7 KiB
HTML

<?php
require("$CFG->dirroot/mod/exercise/lib.php"); // for parameter arrays
// ...and fill the form if needed
if (empty($form->name)) {
$form->name = "";
}
if (!isset($form->gradingstrategy)) {
$form->gradingstrategy = 1;
}
if (empty($form->usemaximum)) {
$form->usemaximum = 0;
}
if (!isset($form->assessmentcomps)) {
$form->assessmentcomps = 2;
}
if (!isset($form->grade)) {
$form->grade = 100;
}
if (!isset($form->gradinggrade)) {
$form->gradinggrade = 100;
}
if (!isset($form->nelements)) {
$form->nelements = 1;
}
if (empty($form->maxbytes)) {
$form->maxbytes = "";
}
if (empty($form->deadline)) {
$form->deadline = "";
}
if (!isset($form->usepassword)) {
$form->usepassword = 0;
}
if (empty($form->showleaguetable)) {
$form->showleaguetable = "";
}
if (empty($form->anonymous)) {
$form->anonymous = 0;
}
$nohtmleditorneeded = true;
?>
<form name="form" method="post" action="mod.php">
<table cellpadding="5">
<tr valign="top">
<td align="right" width="50%"><b><?php print_string("title", "exercise") ?>:</b></td>
<td width="50%">
<input type="text" name="name" size="60" value="<?php p($form->name) ?>" alt="<?php print_string("title", "exercise") ?>"/>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("description", "exercise") ?>:</b></td>
<td>
<?php
echo get_string("descriptionofexercise", "exercise", $course->students);
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("gradeforstudentsassessment", "exercise", $course->student) ?>:</b></td>
<td>
<?php
for ($i=100; $i>=0; $i--) {
$grades[$i] = $i;
}
choose_from_menu($grades, "gradinggrade", "$form->gradinggrade", "");
helpbutton("gradinggrade", get_string("gradinggrade", "exercise"), "exercise");
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("gradeforsubmission", "exercise") ?>:</b></td>
<td>
<?php
choose_from_menu($grades, "grade", "$form->grade", "");
helpbutton("grade", get_string("gradeforsubmission", "exercise"), "exercise");
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("gradingstrategy", "exercise") ?>:</b></td>
<td>
<?php
choose_from_menu($EXERCISE_TYPE, "gradingstrategy", $form->gradingstrategy, "");
helpbutton("gradingstrategy", get_string("gradingstrategy", "exercise"), "exercise");
?>
</td>
</tr>
<tr>
<td align="right"><b><?php print_string("handlingofmultiplesubmissions", "exercise") ?>:</b></td>
<td>
<?php
$options[0] = get_string("usemean", "exercise"); $options[1] = get_string("usemaximum", "exercise");
choose_from_menu($options, "usemaximum", $form->usemaximum, "");
helpbutton("usemax", get_string("handlingofmultiplesubmissions", "exercise"), "exercise");
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("numberofassessmentelements", "exercise") ?>:</b></td>
<td valign="middle">
<?php
for ($i=20; $i>=0; $i--) {
$numbers[$i] = $i;
}
choose_from_menu($numbers, "nelements", "$form->nelements", "");
helpbutton("nelements", get_string("numberofassessmentelements", "exercise"), "exercise");
?>
</td>
</tr>
<tr>
<td align="right"><b><?php print_string("comparisonofassessments", "exercise") ?>:</b></td>
<td>
<?php
// set up comparison names
foreach ($EXERCISE_ASSESSMENT_COMPS as $KEY => $COMPARISON) {
$COMPARISONS[] = $COMPARISON['name'];
}
choose_from_menu($COMPARISONS, "assessmentcomps", $form->assessmentcomps, "");
helpbutton("comparisonofassessments", get_string("comparisonofassessments", "exercise"), "exercise");
?>
</td>
</tr>
<tr>
<td align="right"><b><?php print_string("usepassword", "exercise"); ?>:</b></td>
<td>
<?php
$options[0] = get_string("no"); $options[1] = get_string("yes");
choose_from_menu($options, "usepassword", $form->usepassword, "");
helpbutton("usepassword", get_string("usepassword", "exercise"), "exercise");
?>
</td>
</tr>
<tr>
<td align="right"><b><?php print_string("password"); ?>:</b></td>
<td>
<input type="text" name="password" size="10" value="" alt="<?php print_string("password"); ?>" /> <?php echo " (".get_string("leavetokeep").")"; ?>
<?php helpbutton("password", get_string("password"), "exercise"); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("maximumsize", "exercise") ?>:</b></td>
<td>
<?php
$sizelist = array("10Kb", "50Kb", "100Kb", "500Kb", "1Mb", "2Mb", "5Mb", "10Mb", "20Mb", "50Mb");
$maxsize = get_max_upload_file_size();
$sizeinlist = false;
foreach ($sizelist as $size) {
$sizebytes = get_real_size($size);
if ($sizebytes < $maxsize) {
$filesize[$sizebytes] = $size;
}
if ($form->maxbytes == $sizebytes) {
$sizeinlist = true;
}
}
$filesize[$maxsize] = display_size($maxsize);
if (!$sizeinlist) {
$form->maxbytes = get_real_size("500K");
}
ksort($filesize, SORT_NUMERIC);
choose_from_menu($filesize, "maxbytes", "$form->maxbytes", "");
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("deadline", "exercise") ?>:</b></td>
<td><?php
print_date_selector("deadlineday", "deadlinemonth", "deadlineyear", $form->deadline);
echo "&nbsp;-&nbsp;";
print_time_selector("deadlinehour", "deadlineminute", $form->deadline);
?></td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("numberofentriesinleaguetable", "exercise") ?>:</b></td>
<td><?php
unset($numbers);
$numbers[22] = 'All';
$numbers[21] = 50;
for ($i=20; $i>=0; $i--) {
$numbers[$i] = $i;
}
choose_from_menu($numbers, "showleaguetable", "$form->showleaguetable", "");
helpbutton("leaguetable", get_string("numberofentriesinleaguetable", "exercise"), "exercise");
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("hidenamesfromstudents", "exercise", $course->students) ?>:</b></td>
<td><?php
$options[0] = get_string("no"); $options[1] = get_string("yes");
choose_from_menu($options, "anonymous", $form->anonymous, "");
helpbutton("leaguetablenames", get_string("hidenamesfromstudents", "exercise", $course->students), "exercise");
?>
</td>
</tr>
<?php print_standard_coursemodule_settings($form); ?>
<tr>
<td colspan="2">
<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>
</td>
</tr>
</table>
</form>