From bfbe9c52c1bbd79fc23cd5212fe1d8279041db20 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Thu, 9 Aug 2007 14:11:08 +0000 Subject: [PATCH] Added hooks to qtype import/export --- question/format/gift/format.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/question/format/gift/format.php b/question/format/gift/format.php index 309888d2eaf..87257e7ce67 100755 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -259,6 +259,10 @@ class qformat_gift extends qformat_default { } if (!isset($question->qtype)) { + // try for plugins + if ($question = $this->try_importing_using_qtypes( $lines, $question, $answertext )) { + return $question; + } $giftqtypenotset = get_string('giftqtypenotset','quiz'); $this->error( $giftqtypenotset, $text ); return false; @@ -628,7 +632,13 @@ function writequestion( $question ) { $expout .= "// CLOZE type is not supported\n"; break; default: - notify("No handler for qtype $question->qtype for GIFT export" ); + // check for plugins + if ($out = $this->try_exporting_using_qtypes( $question->qtype, $question )) { + $expout .= $out; + } + else { + notify("No handler for qtype '$question->qtype' for GIFT export" ); + } } // add empty line to delimit questions $expout .= "\n";