From 92b904642a1b1724bef0edfe9dfd5c02d2fb6937 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 11 Apr 2007 21:19:48 +0000 Subject: [PATCH] MDL-9244 - If a question type provides both an old style editquestion.php and a new style moodle form, then use the moodle form. It was doing the opposite, which broke things for people who upgraded by untarring a new distribution over their old one. --- question/question.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/question/question.php b/question/question.php index 61615236abf..29cd6bc0e93 100644 --- a/question/question.php +++ b/question/question.php @@ -21,6 +21,7 @@ require_once(dirname(__FILE__) . '/../config.php'); require_once('editlib.php'); // NOTE - is this correct? This is just about editing screens? require_once($CFG->libdir . '/filelib.php'); + require_once($CFG->libdir . '/formslib.php'); $id = optional_param('id', 0, PARAM_INT); // question id @@ -88,7 +89,7 @@ error("Could not find question type: '$qtype'"); } - if (!file_exists("type/$qtype/editquestion.php")) { + if ($QTYPES[$question->qtype]->create_editing_form('question2.php', $question, $category->course) !== null) { redirect(str_ireplace('question.php', 'question2.php', me())); }