]> git.mjollnir.org Git - moodle.git/commitdiff
Eliminate support for old-style question editing forms.
authortjhunt <tjhunt>
Wed, 25 Apr 2007 18:20:04 +0000 (18:20 +0000)
committertjhunt <tjhunt>
Wed, 25 Apr 2007 18:20:04 +0000 (18:20 +0000)
question/type/editquestionend.html [deleted file]
question/type/editquestionstart.html [deleted file]
question/type/questiontype.php

diff --git a/question/type/editquestionend.html b/question/type/editquestionend.html
deleted file mode 100644 (file)
index 22300c9..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-  <tr valign="top">
-    <td colspan="2" align="center">
-      <input type="submit" <?php echo $submitscript ?> value="<?php print_string('savechanges') ?>" />
-      <?php
-      if ($question->id) {
-        ?>
-        <input type="submit" name="makecopy" <?php echo $submitscript ?> value="<?php print_string("makecopy", "quiz") ?>" /> 
-        <?php
-      }
-      ?>
-      <input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
-      <input type="hidden" name="sesskey" value="<?php p($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="inpopup" value="<?php echo optional_param('inpopup', 0, PARAM_INT) ?>" />
-      <?php
-      echo $hiddenfields;
-      
-      // The following hidden field indicates that the versioning code should be turned on, i.e.,
-      // that old versions should be kept if necessary
-      ?>
-      <input type="hidden" name="versioning" value="on" />
-    </td>
-  </tr>
-</table>
-</center>
-</form>
diff --git a/question/type/editquestionstart.html b/question/type/editquestionstart.html
deleted file mode 100644 (file)
index 7e348a2..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-<form id="theform" method="post" action="question.php">
-<div class="boxaligncenter">
-<table cellpadding="5">
-
-  <tr valign="top">
-    <td align="right"><b><?php print_string("category", "quiz") ?>:</b></td>
-    <td align="left">
-      <?php question_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 align="left">
-      <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 />
-      <?php
-      helpbutton("questiontext", get_string("questiontext", "quiz"), "quiz", true, true);
-      echo '<br />';
-      if ($usehtmleditor) {
-        helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
-      } else {
-        helpbutton("text", get_string("helptext"), "moodle", true, true);
-      }
-      ?>
-    </td>
-    <td align="left">
-      <?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>
-  
-  <?php 
-  if (!in_array('image', $hidefields)) {
-    ?>
-    <tr valign="top">
-      <td align="right"><b><?php print_string("imagedisplay", "quiz") ?>:</b></td>
-      <td align="left">
-        <?php
-        if (empty($images)) {
-          print_string("noimagesyet");
-        } else {
-          choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
-        }
-        ?>
-      </td>
-    </tr>
-    <?php 
-  }
-  
-  if (!in_array('defaultgrade', $hidefields)) {
-    ?>
-    <tr valign="top">
-      <td align="right"><b><?php print_string("defaultgrade", "quiz") ?>:</b></td>
-      <td align="left">
-        <input type="text" name="defaultgrade" size="3" value="<?php p($question->defaultgrade) ?>" alt="<?php print_string("defaultgrade", "quiz") ?>" />
-
-        <?php if (isset($err["defaultgrade"])) formerr($err["defaultgrade"]); ?>
-      </td>
-    </tr>
-    <?php 
-  }
-  
-  if (!in_array('penalty', $hidefields)) {
-    ?>
-    <tr valign="top">
-      <td align="right"><b><?php print_string("penaltyfactor", "quiz") ?>:</b></td>
-      <td align="left">
-        <input type="text" name="penalty" size="3" value="<?php p($question->penalty) ?>" alt="<?php print_string("penaltyfactor", "quiz") ?>" />
-        <?php helpbutton('penalty', get_string('penalty', 'quiz'), 'quiz'); ?>
-        <?php if (isset($err["penalty"])) formerr($err["penalty"]); ?>
-      </td>
-    </tr>
-    <?php 
-  }
-  ?>
-
-  <tr valign="top">
-    <td align="right"><b><?php print_string("generalfeedback", "quiz") ?>:</b>
-      <br /><br /><br />
-      <?php
-      helpbutton("generalfeedback", get_string("generalfeedback", "quiz"), "quiz", true, true);
-      ?>
-    </td>
-    <td align="left">
-      <?php
-      if (isset($err["generalfeedback"])) {
-        formerr($err["generalfeedback"]);
-        echo "<br />";
-      }
-      print_textarea(false, 10, 60, 630, 200, "generalfeedback", $question->generalfeedback);
-      ?>
-    </td>
-  </tr>
-  
-  <tr valign="top">
-    <td colspan="2">&nbsp;</td>
-  </tr>
\ No newline at end of file
index bbf7b474eecafd5225e6d722a2a6f1d2a00138b4..0c66b6b53e8aafbe5172837f564b201a461e81e5 100644 (file)
@@ -1324,58 +1324,6 @@ class default_questiontype {
         echo "</td></tr>\n";
     }
 
-    /**
-     * Print the start of the question editing form, including the question category,
-     * questionname, questiontext, image, defaultgrade, penalty and generalfeedback fields.
-     *
-     * Three of the fields, image, defaultgrade, penalty, are optional, and
-     * can be removed from the from using the $hidefields argument.
-     *
-     * @param object $question The question object that the form we are printing is for.
-     * @param array $err Array of optional error messages to display by each field.
-     *          Used when the form is being redisplayed after validation failed.
-     * @param object $course The course object for the course this question belongs to.
-     * @param boolean $usehtmleditor Whether the html editor should be used.
-     * @param array $hidefields An array which may contain the strings,
-     *          'image', 'defaultgrade' or 'penalty' to remove the corresponding field.
-     */
-    function print_question_form_start($question, $err, $course, $usehtmleditor, $hidefields = array()) {
-        global $CFG;
-
-        // If you edit this function, you also need to edit random/editquestion.html.
-
-        if (!in_array('image', $hidefields)) {
-            make_upload_directory("$course->id");    // Just in case
-            $coursefiles = get_directory_list("$CFG->dataroot/$course->id", $CFG->moddata);
-            foreach ($coursefiles as $filename) {
-                if (mimeinfo("icon", $filename) == "image.gif") {
-                    $images["$filename"] = $filename;
-                }
-            }
-        }
-
-        include('editquestionstart.html');
-    }
-
-    /**
-     * Print the end of the question editing form, including the submit, copy,
-     * and cancel button, and the standard hidden fields like the sesskey and
-     * the question type.
-     *
-     * @param object $question The question object that the form we are printing is for.
-     * @param string $submitscript Extra attributes, for example 'onsubmit="myfunction"',
-     *          that is added to the HTML of the submit button.
-     * @param string $hiddenfields Extra hidden fields (actually any HTML)
-     *          to be added at the end of the form.
-     */
-    function print_question_form_end($question, $submitscript = '', $hiddenfields = '') {
-        global $USER;
-
-        // If you edit this function, you also need to edit random/editquestion.html.
-
-        include('editquestionend.html');
-    }
-
     /**
      * Call format_text from weblib.php with the options appropriate to question types.
      *