+++ /dev/null
-<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">\r
-<CENTER>\r
-<TABLE cellpadding=5>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>">\r
- <?php if (isset($err["name"])) formerr($err["name"]); ?>\r
- </TD>\r
-</TR>\r
-<tr valign=top>\r
- <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>\r
- <br />\r
- <br />\r
- <br />\r
- <p><font SIZE="1">\r
- <?php\r
- if ($usehtmleditor) {\r
- helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);\r
- } else {\r
- helpbutton("text", get_string("helptext"), "moodle", true, true);\r
- }\r
- ?>\r
- </font></p>\r
- </td>\r
- <td>\r
- <?php if (isset($err["questiontext"])) {\r
- formerr($err["questiontext"]); \r
- echo "<br />";\r
- }\r
-\r
- print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);\r
-\r
- if ($usehtmleditor) { /// Trying this out for a while\r
- echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';\r
- } else {\r
- echo "<div align=right>";\r
- print_string("formattexttype");\r
- echo ": ";\r
- if (!isset($question->questiontextformat)) {\r
- $question->questiontextformat = FORMAT_MOODLE;\r
- }\r
- choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");\r
- helpbutton("textformat", get_string("helpformatting"));\r
- echo "</div>";\r
- }\r
- ?>\r
- </td>\r
-</tr>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php if (empty($images)) {\r
- print_string("noimagesyet");\r
- } else {\r
- choose_from_menu($images, "image", "$question->image", get_string("none"),"","");\r
- }\r
- ?>\r
- </TD>\r
-</TR>\r
-</TABLE>\r
-\r
-<INPUT type="hidden" name=id value="<?php p($question->id) ?>">\r
-<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">\r
-<INPUT type="hidden" name=defaultgrade value="0">\r
-<INPUT type="submit" value="<?php print_string("savechanges") ?>">\r
-\r
-</CENTER>\r
-</FORM>\r
-<?php \r
- if ($usehtmleditor) { \r
- print_richedit_javascript("theform", "questiontext", "no");\r
- }\r
-?>\r
+++ /dev/null
-<?PHP // $Id$
-
- require_once("../../config.php");
- require_once("lib.php");
- require_once("format.php");
- require_once("format/multianswer/format.php");
- require_once("../../files/mimetypes.php");
-
- if ($form = data_submitted("nomatch")) {
-
- // Standard checks
- if (! $category = get_record("quiz_categories", "id", $form->category)) {
- error("This question doesn't belong to a valid category!");
- }
- if (! $course = get_record("course", "id", $category->course)) {
- error("This question category doesn't belong to a valid course!");
- }
- require_login($course->id);
- if (!isteacher($course->id)) {
- error("You can't modify these questions!");
- }
-
- $question = extractMultiAnswerQuestion($form->questiontext);
- $question->id = $form->id;
- $question->qtype = $form->qtype;
- $question->name = $form->name;
- $question->category = $form->category;
-
- if (empty($form->image)) {
- $question->image = "";
- } else {
- $question->image = $form->image;
- }
-
- // Formcheck
- $err = array();
- if (empty($question->name)) {
- $err["name"] = get_string("missingname", "quiz");
- }
- if (empty($question->questiontext)) {
- $err["questiontext"] = get_string("missingquestiontext", "quiz");
- }
- if ($err) { // Formcheck failed
- $category = $form->category;
- notify(get_string("someerrorswerefound"));
- unset($_POST);
- require('question.php');
- exit;
-
- } else {
-
- if (!empty($question->id)) { // Question already exists
- if (!update_record("quiz_questions", $question)) {
- error("Could not update question!");
- }
- } else { // Question is a new one
- $question->stamp = make_unique_id_code(); // Set the unique code (not to be changed)
- if (!$question->id = insert_record("quiz_questions", $question)) {
- error("Could not insert new question!");
- }
- }
-
- // Now to save all the answers and type-specific options
- $result = quiz_save_question_options($question);
-
- if (!empty($result->error)) {
- error($result->error);
- }
-
- if (!empty($result->notice)) {
- notice_yesno($result->notice, "question.php?id=$question->id", "edit.php");
- print_footer($course);
- exit;
- }
-
- redirect("edit.php");
- }
-
- } else if ($question->questiontext and $question->id) {
- $answers = quiz_get_answers($question);
-
- foreach ($answers as $multianswer) {
- $parsableanswerdef = '{' . $multianswer->norm . ':';
- switch ($multianswer->answertype) {
- case MULTICHOICE:
- $parsableanswerdef .= 'MULTICHOICE:';
- break;
- case SHORTANSWER:
- $parsableanswerdef .= 'SHORTANSWER:';
- break;
- case NUMERICAL:
- $parsableanswerdef .= 'NUMERICAL:';
- break;
- default:
- error("answertype $multianswer->answertype not recognized");
- }
- $separator= '';
- foreach ($multianswer->subanswers as $subanswer) {
- $parsableanswerdef .= $separator
- . '%' . round(100*$subanswer->fraction) . '%';
- $parsableanswerdef .= $subanswer->answer;
- if (isset($subanswer->min) && isset($subanswer->max)
- and $subanswer->min || $subanswer->max) {
- // Special for numerical answers:
- $errormargin = $subanswer->answer - $subanswer->min;
- $parsableanswerdef .= ":$errormargin";
- }
- if ($subanswer->feedback) {
- $parsableanswerdef .= "#$subanswer->feedback";
- }
- $separator = '~';
- }
- $parsableanswerdef .= '}';
- $question->questiontext = str_replace
- ("{#$multianswer->positionkey}", $parsableanswerdef,
- $question->questiontext);
- }
- }
-
-
-?>
-
-<FORM name="theform" method="post" <?php echo $onsubmit ?> action="editmultianswer.php">
-
-<CENTER>
-
-<TABLE cellpadding=5>
-
-<TR valign=top>
-
- <TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
-
- <TD>
-
- <?php quiz_category_select_menu($course->id, true, true, $question->category ); ?>
-
- </TD>
-
-</TR>
-
-<TR valign=top>
-
- <TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
-
- <TD>
-
- <INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>">
-
- <?php if (isset($err["name"])) formerr($err["name"]); ?>
-
- </TD>
-
-</TR>
-
-<TR valign=top>
-
- <TD align=right><P><B><?php print_string("question", "quiz") ?>:</B></P></TD>
-
- <TD>
-
- <?php if (isset($err["questiontext"])) {
-
- formerr($err["questiontext"]);
-
- echo "<BR />";
-
- }
-
- print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
-
- if ($usehtmleditor) {
-
- helpbutton("richtext", get_string("helprichtext"), "moodle");
-
- } else {
-
- helpbutton("text", get_string("helptext"), "moodle");
-
- }
-
- ?>
-
- </TD>
-
-</TR>
-
-<TR valign=top>
-
- <TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
-
- <TD>
-
- <?php if (empty($images)) {
-
- print_string("noimagesyet");
-
- } else {
-
- choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
-
- }
-
- ?>
-
- </TD>
-
-</TR>
-
-</TABLE>
-
-
-
-<INPUT type="hidden" name=id value="<?php p($question->id) ?>">
-
-<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">
-
-<INPUT type="hidden" name=defaultgrade value="<?php p($question->defaultgrade) ?>">
-
-<INPUT type="submit" value="<?php print_string("savechanges") ?>">
-
-
-
-</CENTER>
-
-</FORM>
-
-<?php
-
- if ($usehtmleditor) {
-
- print_richedit_javascript("theform", "questiontext", "no");
-
- }
-
-?>
-
+++ /dev/null
-<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">\r
-<CENTER>\r
-<TABLE cellpadding=5>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>">\r
- <?php if (isset($err["name"])) formerr($err["name"]); ?>\r
- </TD>\r
-</TR>\r
-<tr valign=top>\r
- <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>\r
- <br />\r
- <br />\r
- <br />\r
- <p><font SIZE="1">\r
- <?php\r
- if ($usehtmleditor) {\r
- helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);\r
- } else {\r
- helpbutton("text", get_string("helptext"), "moodle", true, true);\r
- }\r
- ?>\r
- </font></p>\r
- </td>\r
- <td>\r
- <?php if (isset($err["questiontext"])) {\r
- formerr($err["questiontext"]); \r
- echo "<br />";\r
- }\r
-\r
- print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);\r
-\r
- if ($usehtmleditor) { /// Trying this out for a while\r
- echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';\r
- } else {\r
- echo "<div align=right>";\r
- print_string("formattexttype");\r
- echo ": ";\r
- if (!isset($question->questiontextformat)) {\r
- $question->questiontextformat = FORMAT_MOODLE;\r
- }\r
- choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");\r
- helpbutton("textformat", get_string("helpformatting"));\r
- echo "</div>";\r
- }\r
- ?>\r
- </td>\r
-</tr>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php if (empty($images)) {\r
- print_string("noimagesyet");\r
- } else {\r
- choose_from_menu($images, "image", "$question->image", get_string("none"),"","");\r
- }\r
- ?>\r
- </TD>\r
-</TR>\r
-\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("choices", "quiz") ?></B>:</P></TD>\r
- <TD><P><?php print_string("filloutthreequestions", "quiz") ?></P>\r
- </TD>\r
-</TR>\r
-\r
-<?PHP \r
- for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {\r
-?>\r
-\r
-<TR valign=top>\r
- <TD align=right><P><B><?php echo get_string("question", "quiz")." $i"; ?> :</B></P></TD>\r
- <TD>\r
- <textarea name="subquestions[]" rows=5 cols=50><?php p($subquestions[$i-1]) ?></textarea>\r
- <br />\r
- <?php echo get_string("matchanswer", "quiz")." $i"; ?> \r
- <INPUT type="text" name="subanswers[]" size=50 value="<?php p($subanswers[$i-1]) ?>">\r
- </TD>\r
-</TR>\r
-\r
-<?PHP\r
- }\r
-?>\r
-\r
-</TABLE>\r
-\r
-<INPUT type="hidden" name=id value="<?php p($question->id) ?>">\r
-<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">\r
-<INPUT type="submit" value="<?php print_string("savechanges") ?>">\r
-\r
-</CENTER>\r
-</FORM>\r
-<?php \r
- if ($usehtmleditor) { \r
- print_richedit_javascript("theform", "questiontext", "no");\r
- }\r
-?>\r
+++ /dev/null
-<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">\r
-<CENTER>\r
-<TABLE cellpadding=5>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>">\r
- <?php if (isset($err["name"])) formerr($err["name"]); ?>\r
- </TD>\r
-</TR>\r
-<tr valign=top>\r
- <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>\r
- <br />\r
- <br />\r
- <br />\r
- <p><font SIZE="1">\r
- <?php\r
- if ($usehtmleditor) {\r
- helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);\r
- } else {\r
- helpbutton("text", get_string("helptext"), "moodle", true, true);\r
- }\r
- ?>\r
- </font></p>\r
- </td>\r
- <td>\r
- <?php if (isset($err["questiontext"])) {\r
- formerr($err["questiontext"]); \r
- echo "<br />";\r
- }\r
-\r
- print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);\r
-\r
- if ($usehtmleditor) { /// Trying this out for a while\r
- echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';\r
- } else {\r
- echo "<div align=right>";\r
- print_string("formattexttype");\r
- echo ": ";\r
- if (!isset($question->questiontextformat)) {\r
- $question->questiontextformat = FORMAT_MOODLE;\r
- }\r
- choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");\r
- helpbutton("textformat", get_string("helpformatting"));\r
- echo "</div>";\r
- }\r
- ?>\r
- </td>\r
-</tr>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php if (empty($images)) {\r
- print_string("noimagesyet");\r
- } else {\r
- choose_from_menu($images, "image", "$question->image", get_string("none"),"","");\r
- }\r
- ?>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("answerhowmany", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php \r
- $menu[0] = get_string("answersingleno", "quiz");\r
- $menu[1] = get_string("answersingleyes", "quiz");\r
- choose_from_menu($menu, "single", "$options->single", "");\r
- unset($menu);\r
- ?>\r
- </TD>\r
-</TR>\r
-\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("choices", "quiz") ?></B>:</P></TD>\r
- <TD><P><?php print_string("fillouttwochoices", "quiz") ?></P>\r
- </TD>\r
-</TR>\r
-\r
-<?PHP \r
- for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {\r
-?>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php echo get_string("choice", "quiz")." $i"; ?>:</B></P></TD>\r
- <TD>\r
- <INPUT type="text" name="answer[]" size=50 maxlength=255 value="<?php p($answers[$i-1]->answer) ?>"> \r
- <?php print_string("grade");\r
- echo ": ";\r
- choose_from_menu($gradeoptionsfull, "fraction[]", $answers[$i-1]->fraction, ""); ?>\r
- <BR>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>\r
- </TD>\r
-</TR>\r
-\r
-<TR valign=top>\r
- <TD colspan=2> </TD>\r
-</TR>\r
-\r
-<?php\r
- } /// End of loop, printing answers\r
-?>\r
-</TABLE>\r
-\r
-<INPUT type="hidden" name=id value="<?php p($question->id) ?>">\r
-<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">\r
-<INPUT type="submit" value="<?php print_string("savechanges") ?>">\r
-\r
-</CENTER>\r
-</FORM>\r
-<?php \r
- if ($usehtmleditor) { \r
- print_richedit_javascript("theform", "questiontext", "no");\r
- }\r
-?>\r
+++ /dev/null
-<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">
-<CENTER>
-<TABLE cellpadding=5>
-<TR valign=top>
- <TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
- <TD>
- <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
- </TD>
-</TR>
-<TR valign=top>
- <TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
- <TD>
- <INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>">
- <?php if (isset($err["name"])) formerr($err["name"]); ?>
- </TD>
-</TR>
-<tr valign=top>
- <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
- <br />
- <br />
- <br />
- <p><font SIZE="1">
- <?php
- if ($usehtmleditor) {
- helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
- } else {
- helpbutton("text", get_string("helptext"), "moodle", true, true);
- }
- ?>
- </font></p>
- </td>
- <td>
- <?php if (isset($err["questiontext"])) {
- formerr($err["questiontext"]);
- echo "<br />";
- }
-
- print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
-
- if ($usehtmleditor) { /// Trying this out for a while
- echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';
- } else {
- echo "<div align=right>";
- print_string("formattexttype");
- echo ": ";
- if (!isset($question->questiontextformat)) {
- $question->questiontextformat = FORMAT_MOODLE;
- }
- choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");
- helpbutton("textformat", get_string("helpformatting"));
- echo "</div>";
- }
- ?>
- </td>
-</tr>
-<TR valign=top>
- <TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
- <TD>
- <?php if (empty($images)) {
- print_string("noimagesyet");
- } else {
- choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
- }
- ?>
- </TD>
-</TR>
-
-<TR valign=top>
- <TD align=right><P><B><?php print_string("correctanswer", "quiz") ?>:</B></P></TD>
- <?php
- // Even thou the rest of the module can handle up to six numerical answers,
- // this form will limit the number of numerical answers to one only.
- if (is_numeric($answers[0]->min) && is_numeric($answers[0]->answer)) {
- $acceptederror = (float)($answers[0]->answer)
- - (float)($answers[0]->min);
- } else {
- $acceptederror = "";
- }
- ?>
- <TD>
- <INPUT align="LEFT" type="text" id="correct0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>"/>
- </TD>
-</TR>
-<TR valign=top>
- <TD align=right><P><B><?php print_string("acceptederror", "quiz"); ?>:</B></P></TD>
- <TD>
- <INPUT align="LEFT" type="text" id="acceptederror0" name="acceptederror[]" size="15" value="<?php p($acceptederror) ?>" />±
- <!-- Values max and min will be determined when the form is submitted -->
- <INPUT type="HIDDEN" id="min0" name="min[]" value=""/>
- <INPUT type="HIDDEN" id="max0" name="max[]" value=""/>
- <INPUT type="HIDDEN" name="fraction[]" value="1"/>
- <BR/>
- </TD>
-</TR>
-<TR valign=top>
- <TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD>
- <TD>
- <textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[0]->feedback) ?></textarea>
- </TD>
-</TR>
-</TABLE>
-
-<INPUT type="hidden" name=id value="<?php p($question->id) ?>">
-<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">
-<INPUT type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>">
-</CENTER>
-</FORM>
-<SCRIPT language="JAVASCRIPT">
-function determineMinAndMax() {
- // This client-side script will determine the values for min and max
- // based on the input for answer and acceptederror.
- with(document.theform) {
- if (correct0.value=='') {
- alert('<?php print_string("missingcorrectanswer","quiz") ?>');
- return false;
- } else if (acceptederror0.value=='') {
- var correct= parseFloat(correct0.value);
- if (!isNaN(correct)) {
- min0.value= correct;
- max0.value= correct;
- }
- return true;
- } else if (isNaN(acceptederror0.value) || isNaN(correct0.value)) {
- alert('<?php print_string("answerswithacceptederrormarginmustbenumeric", "quiz") ?>');
- return false;
- } else {
- var correct= parseFloat(correct0.value);
- var error= Math.abs(acceptederror0.value);
- min0.value= correct-error;
- max0.value= correct+error;
- return true;
- }
- }
-}
-</SCRIPT>
-<?php
- if ($usehtmleditor) {
- print_richedit_javascript("theform", "questiontext", "no");
- }
-?>
-
+++ /dev/null
-<center>\r
-<form name="theform" method="post" action="question.php">\r
-\r
-<table cellpadding=5>\r
-<tr valign=top>\r
- <td align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>\r
- <td>\r
- <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>\r
- </td>\r
-</tr>\r
-<tr valign=top>\r
- <td align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>\r
- <td>\r
- <?php if (empty($question->name)) {\r
- $question->name = get_string("random", "quiz");\r
- } ?>\r
- <input type="text" name="name" size=40 value="<?php p($question->name) ?>">\r
- <?php if (isset($err["name"])) formerr($err["name"]); ?>\r
- </td>\r
-</tr>\r
-</table>\r
-\r
-<input type="hidden" name=questiontext value="---">\r
-\r
-<input type="hidden" name=id value="<?php p($question->id) ?>">\r
-<input type="hidden" name=qtype value="<?php p($question->qtype) ?>">\r
-<input type="submit" value="<?php print_string("savechanges") ?>">\r
-</form>\r
-</center>\r
-\r
+++ /dev/null
-<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">\r
-<CENTER>\r
-<TABLE cellpadding=5>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?PHP echo $categories[$question->category]; ?>\r
- <input type="hidden" name="category" value="<?PHP echo "$question->category"; ?>">\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?PHP\r
- if (empty($question->name)) {\r
- $question->name = get_string("randomsamatch", "quiz");\r
- }\r
- ?>\r
- <INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>">\r
- <?php if (isset($err["name"])) formerr($err["name"]); ?>\r
- </TD>\r
-</TR>\r
-<tr valign=top>\r
- <td align=right><p><b><?php print_string("introduction", "quiz") ?>:</b></p></td>\r
- <br />\r
- <br />\r
- <br />\r
- <p><font SIZE="1">\r
- <?php\r
- if ($usehtmleditor) {\r
- helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);\r
- } else {\r
- helpbutton("text", get_string("helptext"), "moodle", true, true);\r
- }\r
- ?>\r
- </font></p>\r
- </td>\r
- <td>\r
- <?php if (isset($err["questiontext"])) {\r
- formerr($err["questiontext"]); \r
- echo "<br />";\r
- }\r
-\r
- if (empty($question->questiontext)) {\r
- $question->questiontext = get_string("randomsamatchintro", "quiz");\r
- }\r
- print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);\r
-\r
- if ($usehtmleditor) { /// Trying this out for a while\r
- echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';\r
- } else {\r
- echo "<div align=right>";\r
- print_string("formattexttype");\r
- echo ": ";\r
- if (!$question->questiontextformat) {\r
- $question->questiontextformat = FORMAT_MOODLE;\r
- }\r
- choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");\r
- helpbutton("textformat", get_string("helpformatting"));\r
- echo "</div>";\r
- }\r
- ?>\r
- </td>\r
-</tr>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("randomsamatchnumber", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php \r
- if ($numberavailable < 2) {\r
- echo "ERROR";\r
- $maxrandom=2;\r
- } else if ($numberavailable < 6) {\r
- $maxrandom = $numberavailable;\r
- } else {\r
- $maxrandom = QUIZ_MAX_NUMBER_ANSWERS;\r
- }\r
-\r
- for ($i=2;$i<=$maxrandom;$i++) {\r
- $menu[$i] = $i;\r
- }\r
- choose_from_menu($menu, "choose", "$options->choose", "");\r
- unset($menu);\r
- ?>\r
- </TD>\r
-</TR>\r
-</TABLE>\r
-\r
-<INPUT type="hidden" name=id value="<?php p($question->id) ?>">\r
-<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">\r
-<INPUT type="submit" value="<?php print_string("savechanges") ?>">\r
-\r
-</CENTER>\r
-</FORM>\r
-<?php \r
- if ($usehtmleditor) { \r
- print_richedit_javascript("theform", "questiontext", "no");\r
- }\r
-?>\r
+++ /dev/null
-<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">\r
-<CENTER>\r
-<TABLE cellpadding=5>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php quiz_category_select_menu($course->id, true, true, $question->category); ?>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>">\r
- <?php if (isset($err["name"])) formerr($err["name"]); ?>\r
- </TD>\r
-</TR>\r
-<tr valign=top>\r
- <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>\r
- <br />\r
- <br />\r
- <br />\r
- <p><font SIZE="1">\r
- <?php\r
- if ($usehtmleditor) {\r
- helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);\r
- } else {\r
- helpbutton("text", get_string("helptext"), "moodle", true, true);\r
- }\r
- ?>\r
- </font></p>\r
- </td>\r
- <td>\r
- <?php if (isset($err["questiontext"])) {\r
- formerr($err["questiontext"]); \r
- echo "<br />";\r
- }\r
-\r
- print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);\r
-\r
- if ($usehtmleditor) { /// Trying this out for a while\r
- echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';\r
- } else {\r
- echo "<div align=right>";\r
- print_string("formattexttype");\r
- echo ": ";\r
- if (!isset($question->questiontextformat)) {\r
- $question->questiontextformat = FORMAT_MOODLE;\r
- }\r
- choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");\r
- helpbutton("textformat", get_string("helpformatting"));\r
- echo "</div>";\r
- }\r
- ?>\r
- </td>\r
-</tr>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php if (empty($images)) {\r
- print_string("noimagesyet");\r
- } else {\r
- choose_from_menu($images, "image", "$question->image", get_string("none"),"","");\r
- }\r
- ?>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("casesensitive", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php \r
- unset($menu);\r
- $menu[0] = get_string("caseno", "quiz");\r
- $menu[1] = get_string("caseyes", "quiz");\r
- choose_from_menu($menu, "usecase", "$options->usecase", "");\r
- ?>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("correctanswers", "quiz") ?></B>:</P></TD>\r
- <TD>\r
- <P><?php print_string("filloutoneanswer", "quiz") ?></P>\r
- </TD>\r
-\r
-\r
-<?PHP \r
- for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {\r
-?>\r
-\r
-<TR valign=top>\r
- <TD align=right><P><B><?php echo get_string("answer", "quiz")." $i"; ?>:</B></P></TD>\r
- <TD>\r
- <INPUT type="text" name="answer[]" size=50 value="<?php p($answers[$i-1]->answer) ?>"> \r
- <?php print_string("grade");\r
- echo ": ";\r
- choose_from_menu($gradeoptions, "fraction[]", $answers[$i-1]->fraction,""); ?>\r
- <BR>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>\r
- </TD>\r
-</TR>\r
-\r
-<TR valign=top>\r
- <TD colspan=2> </TD>\r
-</TR>\r
-\r
-<?PHP\r
- }\r
-?>\r
-\r
-</TABLE>\r
-\r
-<INPUT type="hidden" name=id value="<?php p($question->id) ?>">\r
-<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">\r
-<INPUT type="submit" value="<?php print_string("savechanges") ?>">\r
-\r
-</CENTER>\r
-</FORM>\r
-<?php \r
- if ($usehtmleditor) { \r
- print_richedit_javascript("theform", "questiontext", "no");\r
- }\r
-?>\r
+++ /dev/null
-<FORM name="theform" method="post" <?php echo $onsubmit ?> action="question.php">\r
-<CENTER>\r
-<TABLE cellpadding=5>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php \r
- quiz_category_select_menu($course->id, true, true, $question->category);\r
- ?>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>">\r
- <?php if (isset($err["name"])) formerr($err["name"]); ?>\r
- </TD>\r
-</TR>\r
-<tr valign=top>\r
- <td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>\r
- <br />\r
- <br />\r
- <br />\r
- <p><font SIZE="1">\r
- <?php\r
- if ($usehtmleditor) {\r
- helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);\r
- } else {\r
- helpbutton("text", get_string("helptext"), "moodle", true, true);\r
- }\r
- ?>\r
- </font></p>\r
- </td>\r
- <td>\r
- <?php if (isset($err["questiontext"])) {\r
- formerr($err["questiontext"]); \r
- echo "<br />";\r
- }\r
-\r
- print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);\r
-\r
- if ($usehtmleditor) { /// Trying this out for a while\r
- echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'">';\r
- } else {\r
- echo "<div align=right>";\r
- print_string("formattexttype");\r
- echo ": ";\r
- if (!isset($question->questiontextformat)) {\r
- $question->questiontextformat = FORMAT_MOODLE;\r
- }\r
- choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");\r
- helpbutton("textformat", get_string("helpformatting"));\r
- echo "</div>";\r
- }\r
- ?>\r
- </td>\r
-</tr>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php if (empty($images)) {\r
- print_string("noimagesyet");\r
- } else {\r
- choose_from_menu($images, "image", "$question->image", get_string("none"),"","");\r
- }\r
- ?>\r
- </TD>\r
-</TR>\r
-\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("correctanswer", "quiz") ?>:</B></P></TD>\r
- <TD>\r
- <?php $menu[0] = get_string("false", "quiz");\r
- $menu[1] = get_string("true", "quiz");\r
- choose_from_menu($menu, "answer", "$question->answer", ""); ?>\r
- <BR>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("feedback", "quiz") ?> (<?php print_string("true", "quiz") ?>):</B></P></TD>\r
- <TD>\r
- <textarea name="feedbacktrue" rows=2 cols=50 wrap="virtual"><?php p($true->feedback) ?></textarea>\r
- </TD>\r
-</TR>\r
-<TR valign=top>\r
- <TD align=right><P><B><?php print_string("feedback", "quiz") ?> (<?php print_string("false", "quiz") ?>):</B></P></TD>\r
- <TD>\r
- <textarea name="feedbackfalse" rows=2 cols=50 wrap="virtual"><?php p($false->feedback) ?></textarea>\r
- </TD>\r
-</TR>\r
-</TABLE>\r
-\r
-<INPUT type="hidden" name=id value="<?php p($question->id) ?>">\r
-<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>">\r
-<INPUT type="submit" value="<?php print_string("savechanges") ?>">\r
-\r
-</CENTER>\r
-</FORM>\r
-<?php \r
- if ($usehtmleditor) { \r
- print_richedit_javascript("theform", "questiontext", "no");\r
- }\r
-?>\r