diff --git a/question/type/ddmarker/imagetargetconverter.php b/question/type/ddmarker/imagetargetconverter.php index 55496749fb6..2a40c465419 100644 --- a/question/type/ddmarker/imagetargetconverter.php +++ b/question/type/ddmarker/imagetargetconverter.php @@ -28,6 +28,23 @@ require_once(dirname(__FILE__) . '/../../../config.php'); require_once($CFG->libdir . '/adminlib.php'); require_once($CFG->dirroot.'/question/type/ddmarker/questionlists.php'); +class qtype_ddmarker_question_converter_list extends qtype_ddmarker_question_list { + protected function new_list_item($record) { + return new qtype_ddmarker_question_converter_list_item($record, $this, $this->categorylist); + } +} +class qtype_ddmarker_question_converter_list_item extends qtype_ddmarker_question_list_item { + public function process($progresstrace = null, $depth = 0) { + $this->convert_question(); + parent::process($progresstrace, $depth);//outputs progress message + } + + protected function convert_question() { + $questionrec = $this->record; + + } +} + $categoryid = optional_param('categoryid', 0, PARAM_INT); $qcontextid = optional_param('contextid', 0, PARAM_INT); $confirm = optional_param('confirm', 0, PARAM_INT); @@ -73,7 +90,7 @@ foreach ($questions as $question) { $contextlist = new qtype_ddmarker_context_list(array_unique($contextids)); $categorylist = new qtype_ddmarker_category_list($contextids, $contextlist); -$questionlist = new qtype_ddmarker_question_list($questions, $categorylist); +$questionlist = new qtype_ddmarker_question_converter_list($questions, $categorylist); foreach ($questions as $question) { $questionlist->leaf_node($question->id, 1); diff --git a/question/type/ddmarker/questionlists.php b/question/type/ddmarker/questionlists.php index a92a1bb7ff8..6c40685693d 100644 --- a/question/type/ddmarker/questionlists.php +++ b/question/type/ddmarker/questionlists.php @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +defined('MOODLE_INTERNAL') || die(); + /** * These classes handle transforming arrays of records into a linked tree of contexts, categories and questions. *