mirror of
https://github.com/moodle/moodle.git
synced 2025-02-20 08:05:49 +01:00
176 lines
5.9 KiB
HTML
176 lines
5.9 KiB
HTML
<!-- This page defines the form to create or edit an instance of this module -->
|
|
<!-- It is used from /course/mod.php. The whole instance is available as $form. -->
|
|
|
|
<?PHP
|
|
require_once("$CFG->dirroot/mod/quiz/lib.php");
|
|
|
|
if (empty($form->name)) {
|
|
$form->name = "";
|
|
}
|
|
if (empty($form->intro)) {
|
|
$form->intro = "";
|
|
}
|
|
if (empty($form->timeopen)) {
|
|
$form->timeopen = "";
|
|
}
|
|
if (empty($form->timeclose)) {
|
|
$form->timeclose = "";
|
|
}
|
|
if (empty($form->attempts)) {
|
|
$form->attempts = "";
|
|
}
|
|
if (empty($form->grademethod)) {
|
|
$form->grademethod = "";
|
|
}
|
|
if (empty($form->feedback)) {
|
|
$form->feedback = "";
|
|
}
|
|
if (empty($form->correctanswers)) {
|
|
$form->correctanswers = "";
|
|
}
|
|
if (empty($form->review)) {
|
|
$form->review = "";
|
|
}
|
|
if (empty($form->grade)) {
|
|
$form->grade = "";
|
|
}
|
|
if (empty($form->questions)) {
|
|
$form->questions = "";
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
<FORM name="form" method="post" action="<?=$CFG->wwwroot?>/mod/quiz/edit.php">
|
|
<CENTER>
|
|
<TABLE cellpadding=5>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("name") ?>:</B></P></TD>
|
|
<TD>
|
|
<INPUT type="text" name="name" size=40 value="<? p($form->name) ?>">
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("introduction", "quiz") ?>:</B></P></TD>
|
|
<TD>
|
|
<textarea name="intro" rows=4 cols=50 wrap="virtual"><? p($form->intro) ?></textarea>
|
|
<? helpbutton("text", get_string("helptext")); ?>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("quizopen", "quiz") ?>:</B></P></TD>
|
|
<TD>
|
|
<?
|
|
if (!$form->timeopen and $course->format == "weeks") {
|
|
$form->timeopen = $course->startdate + (($form->section - 1) * 608400);
|
|
}
|
|
print_date_selector("openday", "openmonth", "openyear", $form->timeopen);
|
|
print_time_selector("openhour", "openminute", $form->timeopen);
|
|
helpbutton("timeopen", get_string("quizopen","quiz"), "quiz");
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("quizclose", "quiz") ?>:</B></P></TD>
|
|
<TD>
|
|
<?
|
|
if (!$form->timeclose and $course->format == "weeks") {
|
|
$form->timeclose = $course->startdate + (($form->section) * 608400);
|
|
}
|
|
print_date_selector("closeday", "closemonth", "closeyear", $form->timeclose);
|
|
print_time_selector("closehour", "closeminute", $form->timeclose);
|
|
helpbutton("timeopen", get_string("quizclose","quiz"), "quiz");
|
|
?>
|
|
</TD>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("attemptsallowed", "quiz") ?>:</B></P></TD>
|
|
<TD>
|
|
<?
|
|
$options = array();
|
|
$options[0] = get_string("attemptsunlimited", "quiz");
|
|
$options[1] = "1 ".strtolower(get_string("attempt", "quiz"));
|
|
for ($i=2;$i<=6;$i++) {
|
|
$options[$i] = "$i ".strtolower(get_string("attempts", "quiz"));
|
|
}
|
|
choose_from_menu($options, "attempts", "$form->attempts", "");
|
|
helpbutton("attempts", get_string("attemptsallowed","quiz"), "quiz");
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("grademethod", "quiz") ?>:</B></P></TD>
|
|
<TD>
|
|
<?
|
|
$options = array();
|
|
$options[1] = get_string("gradehighest", "quiz");
|
|
$options[2] = get_string("gradeaverage", "quiz");
|
|
$options[3] = get_string("attemptfirst", "quiz");
|
|
$options[4] = get_string("attemptlast", "quiz");
|
|
choose_from_menu($QUIZ_GRADE_METHOD, "grademethod", "$form->grademethod", "");
|
|
helpbutton("grademethod", get_string("grademethod","quiz"), "quiz");
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("showfeedback", "quiz") ?>:</B></P></TD>
|
|
<TD>
|
|
<?
|
|
$options = array();
|
|
$options[0] = get_string("no");
|
|
$options[1] = get_string("yes");
|
|
choose_from_menu($options, "feedback", "$form->feedback", "");
|
|
helpbutton("feedback", get_string("showfeedback","quiz"), "quiz");
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("showcorrectanswer", "quiz") ?>:</B></P></TD>
|
|
<TD>
|
|
<?
|
|
$options = array();
|
|
$options[0] = get_string("no");
|
|
$options[1] = get_string("yes");
|
|
choose_from_menu($options, "correctanswers", "$form->correctanswers", "");
|
|
helpbutton("correctanswers", get_string("showcorrectanswer","quiz"), "quiz");
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("allowreview", "quiz") ?>:</B></P></TD>
|
|
<TD>
|
|
<?
|
|
$options = array();
|
|
$options[0] = get_string("no");
|
|
$options[1] = get_string("yes");
|
|
choose_from_menu($options, "review", "$form->review", "");
|
|
helpbutton("review", get_string("allowreview","quiz"), "quiz");
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><? print_string("maximumgrade") ?>:</B></P></TD>
|
|
<TD>
|
|
<?
|
|
for ($i=100; $i>=1; $i--) {
|
|
$grades[$i] = $i;
|
|
}
|
|
choose_from_menu($grades, "grade", "$form->grade", "");
|
|
helpbutton("maxgrade", get_string("maximumgrade"), "quiz");
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
</TABLE>
|
|
<INPUT type="hidden" name=questions value="<? p($form->questions) ?>">
|
|
<!-- These hidden variables are always the same -->
|
|
<INPUT type="hidden" name=course value="<? p($form->course) ?>">
|
|
<INPUT type="hidden" name=coursemodule value="<? p($form->coursemodule) ?>">
|
|
<INPUT type="hidden" name=section value="<? p($form->section) ?>">
|
|
<INPUT type="hidden" name=module value="<? p($form->module) ?>">
|
|
<INPUT type="hidden" name=modulename value="<? p($form->modulename) ?>">
|
|
<INPUT type="hidden" name=instance value="<? p($form->instance) ?>">
|
|
<INPUT type="hidden" name=mode value="<? p($form->mode) ?>">
|
|
<input type="hidden" name=destination value="<?=$ME ?>">
|
|
<INPUT type="submit" value="<? print_string("continue") ?>">
|
|
</CENTER>
|
|
</FORM>
|