From 27987cbb7804984aa57c17c7880723d169e971d3 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 25 Apr 2007 18:20:04 +0000 Subject: [PATCH] Eliminate support for old-style question editing forms. --- question/type/editquestionend.html | 27 ------ question/type/editquestionstart.html | 122 --------------------------- question/type/questiontype.php | 52 ------------ 3 files changed, 201 deletions(-) delete mode 100644 question/type/editquestionend.html delete mode 100644 question/type/editquestionstart.html diff --git a/question/type/editquestionend.html b/question/type/editquestionend.html deleted file mode 100644 index 22300c9c6c..0000000000 --- a/question/type/editquestionend.html +++ /dev/null @@ -1,27 +0,0 @@ - - - value="" /> - id) { - ?> - value="" /> - - " /> - - - - - - - - - - - diff --git a/question/type/editquestionstart.html b/question/type/editquestionstart.html deleted file mode 100644 index 7e348a21ae..0000000000 --- a/question/type/editquestionstart.html +++ /dev/null @@ -1,122 +0,0 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/question/type/questiontype.php b/question/type/questiontype.php index bbf7b474ee..0c66b6b53e 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -1324,58 +1324,6 @@ class default_questiontype { echo "\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. * -- 2.39.5
: - id, true, true, $question->category); ?> -
: - " /> - -
: -


- '; - if ($usehtmleditor) { - helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); - } else { - helpbutton("text", get_string("helptext"), "moodle", true, true); - } - ?> -
- "; - } - print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext); - if ($usehtmleditor) { - echo ''; - } else { - echo "
"; - 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 "
"; - } - ?> -
: - image", get_string("none"),"",""); - } - ?> -
: - " /> - - -
: - " /> - - -
: -


- -
- "; - } - print_textarea(false, 10, 60, 630, 200, "generalfeedback", $question->generalfeedback); - ?> -