Skip to content

Commit

Permalink
Added hooks to qtype import/export
Browse files Browse the repository at this point in the history
  • Loading branch information
thepurpleblob committed Aug 9, 2007
1 parent 2311afc commit 64de04f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion question/format/gift/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ function readquestion($lines) {
}

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;
Expand Down Expand Up @@ -631,7 +635,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";
Expand Down

0 comments on commit 64de04f

Please sign in to comment.