]> git.mjollnir.org Git - moodle.git/commitdiff
question.php now uses sesskey. This means that all question type plug-ins will have...
authorgustav_delius <gustav_delius>
Sat, 22 Jan 2005 20:08:45 +0000 (20:08 +0000)
committergustav_delius <gustav_delius>
Sat, 22 Jan 2005 20:08:45 +0000 (20:08 +0000)
12 files changed:
mod/quiz/question.php
mod/quiz/questiontypes/calculated/calculated.html
mod/quiz/questiontypes/datasetdependent/questiondatasets.html
mod/quiz/questiontypes/description/description.html
mod/quiz/questiontypes/match/match.html
mod/quiz/questiontypes/multianswer/multianswer.html
mod/quiz/questiontypes/multichoice/multichoice.html
mod/quiz/questiontypes/numerical/numerical.html
mod/quiz/questiontypes/random/random.html
mod/quiz/questiontypes/randomsamatch/randomsamatch.html
mod/quiz/questiontypes/shortanswer/shortanswer.html
mod/quiz/questiontypes/truefalse/truefalse.html

index 17bceee787a225dca5ba5d38e23ae7fe606e2733..a8dc109f3df548b7a2ca481c60c57b6ed78a96ef 100644 (file)
@@ -5,12 +5,12 @@
     require_once("locallib.php");
     require_once("../../files/mimetypes.php");
 
-    optional_variable($id);        // question id
+    $id = optional_param('id');        // question id
 
-    optional_variable($qtype);
-    optional_variable($category);
+    $qtype = optional_param('qtype');
+    $category = optional_param('category');
     
-    optional_variable($copy, false); // true if a copy of the question should be created
+    $copy = optional_param('copy', false); // true if a copy of the question should be created
 
     if ($id) {
         if (! $question = get_record("quiz_questions", "id", $id)) {
@@ -70,8 +70,8 @@
                  "<a href=\"$CFG->wwwroot/mod/quiz/index.php?id=$course->id\">$strquizzes</a>".
                   " -> ".$strediting);
 
-    if (isset($delete)) {
-        if (isset($confirm)) {
+    if (isset($_REQUEST['delete'])) {
+        if (isset($confirm) and confirm_sesskey()) {
             if ($confirm == md5($delete)) {
                 if (!delete_records("quiz_questions", "id", $question->id)) {
                     error("An error occurred trying to delete question (id $question->id)");
         }
     }
 
-    if ($form = data_submitted()) {
+    if ($form = data_submitted() and confirm_sesskey()) {
         $question = $QUIZ_QTYPES[$qtype]->save_question($question, $form, $course);
     } 
 
index 397b690e56dce1ac0e7d94836b1822e70f2b3143..01b22ef894d83eb59c7fc2f528175b9a37674c7d 100644 (file)
@@ -147,6 +147,7 @@ for ($i=1; $i<count($units); $i++) {
 ?>
 </table>
 
+<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <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") ?>" />
index f9a19d107515676bbb168957174e350de1eb97ca..952295903bb5dded924fd4b05745f7cde47c95f4 100644 (file)
@@ -29,6 +29,7 @@
     <td/>
     <td/>
     <td>
+        <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
         <input type="hidden" name="name"               value="<?php  p($question->name) ?>" />
         <input type="hidden" name="questiontext"       value="<?php  p($question->questiontext) ?>" />
         <input type="hidden" name="questiontextformat" value="<?php  p($question->questiontextformat) ?>" />
index 8bc406257edb7b06bfd1565fb928469073d12423..40ffee3d09334a5f043937e8a915b55cbfefe0da 100644 (file)
 <form name="theform" method="post" action="question.php">
-
 <center>
-
 <table cellpadding="5">
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("category", "quiz") ?>:</b></td>
-
     <td>
-
     <?php   quiz_category_select_menu($course->id, true, true, $question->category); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("questionname", "quiz") ?>:</b></td>
-
     <td>
-
         <input type="text" name="name" size="40" value="<?php  p($question->name) ?>" alt="<?php  print_string("questionname", "quiz") ?>" />
-
         <?php  if (isset($err["name"])) formerr($err["name"]); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("question", "quiz") ?>:</b>
-
     <br />
-
     <br />
-
     <br />
-
     <font size="1">
-
     <?php
-
            if ($usehtmleditor) {
-
                helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
-
            } else {
-
                helpbutton("text", get_string("helptext"), "moodle", true, true);
-
            }
-
     ?>
-
     </font>
-
     </td>
-
     <td>
-
         <?php  if (isset($err["questiontext"])) {
-
                formerr($err["questiontext"]); 
-
                echo "<br />";
-
            }
-
-
-
            print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
-
-
-
            if ($usehtmleditor) {
-
                echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
-
            } else {
-
                echo "<div align=\"right\">";
-
                print_string("formattexttype");
-
                echo ":&nbsp;";
-
                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"><b><?php  print_string("imagedisplay", "quiz") ?>:</b></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="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <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="0" />
-
 <input type="submit" value="<?php  print_string("savechanges") ?>" />
-
-
-
 </center>
-
 </form>
-
index bc2de4d3aa14e4381a48ca4318f182a440227356..0e9f8e329dd3ee8b64fc24bde2454067ba890e93 100644 (file)
 <form name="theform" method="post" action="question.php">
-
 <center>
-
 <table cellpadding="5">
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("category", "quiz") ?>:</b></td>
-
     <td>
-
     <?php   quiz_category_select_menu($course->id, true, true, $question->category); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("questionname", "quiz") ?>:</b></td>
-
     <td>
-
         <input type="text" name="name" size="40" value="<?php  p($question->name) ?>" alt="<?php  print_string("questionname", "quiz") ?>" />
-
         <?php  if (isset($err["name"])) formerr($err["name"]); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("question", "quiz") ?>:</b>
-
     <br />
-
     <br />
-
     <br />
-
     <font size="1">
-
     <?php
-
            if ($usehtmleditor) {
-
                helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
-
            } else {
-
                helpbutton("text", get_string("helptext"), "moodle", true, true);
-
            }
-
     ?>
-
     </font>
-
     </td>
-
     <td>
-
         <?php  if (isset($err["questiontext"])) {
-
                formerr($err["questiontext"]); 
-
                echo "<br />";
-
            }
-
-
-
            print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
-
-
-
            if ($usehtmleditor) { 
-
                echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
-
            } else {
-
                echo "<div align=\"right\">";
-
                print_string("formattexttype");
-
                echo ":&nbsp;";
-
                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"><b><?php  print_string("imagedisplay", "quiz") ?>:</b></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"><b><?php  print_string("choices", "quiz") ?></b>:</td>
-
     <td><?php  print_string("filloutthreequestions", "quiz") ?>
-
     </td>
-
 </tr>
-
-
-
 <?php 
-
     for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
-
 ?>
-
-
-
 <tr valign="top">
-
     <td align="right"><b><?php  echo get_string("question", "quiz")." $i";  ?> :</b></td>
-
     <td>
-
         <textarea name="subquestions[]" rows="5" cols="50"><?php  p($subquestions[$i-1]) ?></textarea>
-
         <br />
-
         <?php  echo get_string("matchanswer", "quiz")." $i";  ?>&nbsp;&nbsp;
-
         <input type="text" name="subanswers[]" size="50" value="<?php  p($subanswers[$i-1]) ?>" alt="<?php  echo get_string("matchanswer", "quiz")." $i";  ?>" />
-
     </td>
-
 </tr>
-
-
-
 <?php
-
     }
-
 ?>
-
-
-
 </table>
-
-
-
+<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <input type="hidden" name="id" value="<?php  p($question->id) ?>" />
-
 <input type="hidden" name="qtype" value="<?php  p($question->qtype) ?>" />
-
 <input type="submit" value="<?php  print_string("savechanges") ?>" />
-
-
-
 </center>
-
 </form>
-
index 1935a76a1ef953162953a5ac40846fa7100165e3..8f892e47056cd92caf1a2046d169069b4ffe00f7 100644 (file)
 <form name="theform" method="post"  action="question.php">
-
 <center>
-
 <table cellpadding="5">
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("category", "quiz") ?>:</b></td>
-
     <td>
-
     <?php   quiz_category_select_menu($course->id, true, true, $question->category); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("questionname", "quiz") ?>:</b></td>
-
     <td>
-
         <input type="text" name="name" size="40" value="<?php  p($question->name) ?>" alt="<?php  print_string("questionname", "quiz") ?>" />
-
         <?php  if (isset($err["name"])) formerr($err["name"]); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("question", "quiz") ?>:</b></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"><b><?php  print_string("imagedisplay", "quiz") ?>:</b></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="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <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>
index 5095ee72d69cdca2273653385933347be7b23c58..42858f1f8efed09d151a15178e466e2a47fe0633 100644 (file)
 ?>
 
 </table>
+<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <input type="hidden" name="id" value="<?php  p($question->id) ?>" />
 <input type="hidden" name="qtype" value="<?php  p($question->qtype) ?>" />
 <input type="submit" value="<?php  print_string("savechanges") ?>" />
index 92f0d420322c6a860ca87f7c0835bfe6fa28c191..8fce32ed7c743510da98b36f987600a9cfb46220 100644 (file)
@@ -135,6 +135,7 @@ for ($i=1; $i<count($units); $i++) {
 ?>
 </table>
 
+<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <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") ?>" />
index 36d529d46300f739bebb71d18bf624d7fe45358f..be8e851bed217cbfd2cca2155f4a9b5bd4e86aef 100644 (file)
@@ -1,75 +1,37 @@
 <center>
-
 <form name="theform" method="post" action="question.php">
-
-
-
 <table cellpadding="5">
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("category", "quiz") ?>:</b></td>
-
     <td>
-
     <?php   quiz_category_select_menu($course->id, true, true, $question->category); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("questionname", "quiz") ?>:</b></td>
-
     <td>
-
         <?php  if (empty($question->name)) {
-
                $question->name = get_string("random", "quiz");
-
            } ?>
-
         <input type="text" name="name" size="40" value="<?php  p($question->name) ?>" alt="<?php  print_string("questionname", "quiz") ?>" />
-
         <?php  if (isset($err["name"])) formerr($err["name"]); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("recurse", "quiz") ?>:</b></td>
-
     <td>
         <?php  if (!isset($question->questiontext)) {
-
             $question->questiontext = "0";
-
         } ?>
-
         <input type="hidden" name="questiontext" value="0" />
         <input type="checkbox" name="questiontext" value="1" <?php echo ($question->questiontext == "1") ? 'checked="checked"' : '' ?> />
-
     </td>
-
 </tr>
-
 </table>
-
+<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <input type="hidden" name="questiontextformat" value="0" />
-
-
 <input type="hidden" name="id" value="<?php  p($question->id) ?>" />
-
 <input type="hidden" name="qtype" value="<?php  p($question->qtype) ?>" />
-
 <input type="submit" value="<?php  print_string("savechanges") ?>" />
-
 </form>
-
 </center>
-
-
-
index bd5c6f51ef8b7912ebc5ff1df690d01e6cd53afd..a2659fff9cb17e6fa74591468e418ae7e4716033 100644 (file)
 <form name="theform" method="post" 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 echo $categories[$question->category]; ?>
-
     <input type="hidden" name="category" value="<?php echo "$question->category"; ?>" />
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><p><b><?php  print_string("questionname", "quiz") ?>:</b></p></td>
-
     <td>
-
         <?php
-
            if (empty($question->name)) {
-
                $question->name =  get_string("randomsamatch", "quiz");
-
            }
-
         ?>
-
         <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("introduction", "quiz") ?>:</b></p>
-
     <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 />";
-
            }
-
-
-
            if (empty($question->questiontext)) {
-
                $question->questiontext =  get_string("randomsamatchintro", "quiz");
-
            }
-
            print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
-
-
-
            if ($usehtmleditor) {
-
                echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
-
            } else {
-
                echo '<div align="right">';
-
                print_string("formattexttype");
-
                echo ":&nbsp;";
-
                if (!$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("randomsamatchnumber", "quiz") ?>:</b></p></td>
-
     <td>
-
     <?php 
-
         if ($numberavailable < 2) {
-
             echo get_string('createfirst', 'quiz');
-
             $maxrandom=2;
-
         } else if ($numberavailable < 6) {
-
             $maxrandom = $numberavailable;
-
         } else {
-
             $maxrandom = QUIZ_MAX_NUMBER_ANSWERS;
-
         }
-
-
-
         for ($i=2;$i<=$maxrandom;$i++) {
-
             $menu[$i] = $i;
-
         }
-
         choose_from_menu($menu, "choose", "$options->choose", "");
-
         unset($menu);
-
      ?>
-
     </td>
-
 </tr>
-
 </table>
-
-
-
+<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <input type="hidden" name="id" value="<?php  p($question->id) ?>" />
-
 <input type="hidden" name="qtype" value="<?php  p($question->qtype) ?>" />
-
 <input type="submit" value="<?php  print_string("savechanges") ?>" />
-
-
-
 </center>
-
 </form>
-
index 5b218e292508b18b993c5038e23bc282ac8ec486..9a1e872fa3dfcff5e8fdc24556d5cff998e43423 100644 (file)
 <form name="theform" method="post" action="question.php">
-
 <center>
-
 <table cellpadding="5">
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("category", "quiz") ?>:</b></td>
-
     <td>
-
     <?php   quiz_category_select_menu($course->id, true, true, $question->category); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("questionname", "quiz") ?>:</b></td>
-
     <td>
-
         <input type="text" name="name" size="50" value="<?php  p($question->name) ?>" alt="<?php  print_string("questionname", "quiz") ?>" />
-
         <?php  if (isset($err["name"])) formerr($err["name"]); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("question", "quiz") ?>:</b>
-
     <br />
-
     <br />
-
     <br />
-
     <font size="1">
-
     <?php
-
            if ($usehtmleditor) {
-
                helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
-
            } else {
-
                helpbutton("text", get_string("helptext"), "moodle", true, true);
-
            }
-
     ?>
-
     </font>
-
     </td>
-
     <td>
-
         <?php  if (isset($err["questiontext"])) {
-
                formerr($err["questiontext"]); 
-
                echo "<br />";
-
            }
-
-
-
            print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
-
-
-
            if ($usehtmleditor) {
-
                echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
-
            } else {
-
                echo "<div align=\"right\">";
-
                print_string("formattexttype");
-
                echo ":&nbsp;";
-
                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"><b><?php  print_string("imagedisplay", "quiz") ?>:</b></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"><b><?php  print_string("casesensitive", "quiz") ?>:</b></td>
-
     <td>
-
     <?php 
-
         unset($menu);
-
         $menu[0] = get_string("caseno", "quiz");
-
         $menu[1] = get_string("caseyes", "quiz");
-
         choose_from_menu($menu, "usecase", "$options->usecase", "");
-
      ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("correctanswers", "quiz") ?></b>:</td>
-
     <td>
-
         <?php  print_string("filloutoneanswer", "quiz") ?>
-
     </td>
-
-
 </tr>
-
-
 <?php 
-
     for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
-
 ?>
-
-
-
 <tr valign="top">
-
     <td align="right"><b><?php  echo get_string("answer", "quiz")." $i";  ?>:</b></td>
-
     <td>
-
         <input type="text" name="answer[]" size="50" value="<?php  p($answers[$i-1]->answer) ?>" alt="<?php  echo get_string("answer", "quiz")." $i";  ?>" />&nbsp;&nbsp;
-
         <?php  print_string("grade");
-
            echo ":&nbsp;";
-
            choose_from_menu($gradeoptions, "fraction[]", $answers[$i-1]->fraction,""); ?>
-
         <br />
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("feedback", "quiz") ?>:</b></td>
-
     <td>
-
         <textarea name="feedback[]" rows="2" cols="50"><?php  p($answers[$i-1]->feedback) ?></textarea>
-
     </td>
-
 </tr>
-
-
-
 <tr valign="top">
-
     <td colspan="2">&nbsp;</td>
-
 </tr>
-
-
-
 <?php
-
     }
-
 ?>
-
-
-
 </table>
-
-
-
+<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <input type="hidden" name="id" value="<?php  p($question->id) ?>" />
-
 <input type="hidden" name="qtype" value="<?php  p($question->qtype) ?>" />
-
 <input type="submit" value="<?php  print_string("savechanges") ?>" />
-
-
-
 </center>
-
 </form>
-
index 1125e63ea124b2ddfb227747c752a906cfe6d90f..7af55213ddcb3936eb8d30fd3d4d2264b8956d5a 100644 (file)
 <form name="theform" method="post" action="question.php">
-
 <center>
-
 <table cellpadding="5">
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("category", "quiz") ?>:</b></td>
-
     <td>
-
     <?php   quiz_category_select_menu($course->id, true, true, $question->category); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("questionname", "quiz") ?>:</b></td>
-
     <td>
-
         <input type="text" name="name" size="50" value="<?php  p($question->name) ?>" alt="<?php  print_string("questionname", "quiz") ?>"/>
-
         <?php  if (isset($err["name"])) formerr($err["name"]); ?>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("question", "quiz") ?>:</b>
-
     <br />
-
     <br />
-
     <br />
-
     <font size="1">
-
     <?php
-
            if ($usehtmleditor) {
-
                helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
-
            } else {
-
                helpbutton("text", get_string("helptext"), "moodle", true, true);
-
            }
-
     ?>
-
     </font>
-
     </td>
-
     <td>
-
         <?php  if (isset($err["questiontext"])) {
-
                formerr($err["questiontext"]); 
-
                echo "<br />";
-
            }
-
-
-
            print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
-
-
-
            if ($usehtmleditor) { 
-
                echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
-
            } else {
-
                echo "<div align=\"right\">";
-
                print_string("formattexttype");
-
                echo ":&nbsp;";
-
                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"><b><?php  print_string("imagedisplay", "quiz") ?>:</b></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"><b><?php  print_string("correctanswer", "quiz") ?>:</b></td>
-
     <td>
-
         <?php  $menu[0] = get_string("false", "quiz");
-
            $menu[1] = get_string("true", "quiz");
-
            choose_from_menu($menu, "answer", "$question->answer", ""); ?>
-
         <br />
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("feedback", "quiz") ?> (<?php  print_string("true", "quiz") ?>):</b></td>
-
     <td>
-
         <textarea name="feedbacktrue" rows="2" cols="50" wrap="virtual"><?php  p($true->feedback) ?></textarea>
-
     </td>
-
 </tr>
-
 <tr valign="top">
-
     <td align="right"><b><?php  print_string("feedback", "quiz") ?> (<?php  print_string("false", "quiz") ?>):</b></td>
-
     <td>
-
         <textarea name="feedbackfalse" rows="2" cols="50"><?php  p($false->feedback) ?></textarea>
-
     </td>
-
 </tr>
-
 </table>
-
-
-
+<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey; ?>" />
 <input type="hidden" name="id" value="<?php  p($question->id) ?>" />
-
 <input type="hidden" name="qtype" value="<?php  p($question->qtype) ?>" />
-
 <input type="submit" value="<?php  print_string("savechanges") ?>" />
-
-
-
 </center>
-
 </form>
-