Permalink
Browse files

Added remaining question types for export

  • Loading branch information...
1 parent 4c2a04e commit 1218d4702efc06e2e458f9c131cc8a6396a0832f thepurpleblob committed Jun 30, 2004
Showing with 14 additions and 4 deletions.
  1. +14 −4 mod/quiz/format/gift/format.php
@@ -453,14 +453,14 @@ function writequestion( $question ) {
$answertext = 'FALSE';
$feedback = $question->trueanswer->feedback;
}
- $expout .= $question->questiontext."{".$answertext;
+ $expout .= "::".$question->name."::".$question->questiontext."{".$answertext;
if ($feedback!="") {
$expout .= "#".$feedback;
}
$expout .= "}\n";
break;
case MULTICHOICE:
- $expout .= $question->questiontext."{\n";
+ $expout .= "::".$question->name."::".$question->questiontext."{\n";
foreach($question->answers as $answer) {
if ($answer->fraction==1) {
$answertext = '=';
@@ -477,18 +477,28 @@ function writequestion( $question ) {
$expout .= "}\n";
break;
case SHORTANSWER:
- $expout .= $question->questiontext."{\n";
+ $expout .= "::".$question->name."::".$question->questiontext."{\n";
foreach($question->answers as $answer) {
$weight = 100 * $answer->fraction;
$expout .= "\t=%".$weight."%".$answer->answer."#".$answer->feedback."\n";
}
$expout .= "}\n";
break;
case NUMERICAL:
- $expout .= $question->questiontext."{\n";
+ $expout .= "::".$question->name."::".$question->questiontext."{\n";
$expout .= "\t#".$question->min."..".$question->max."#".$question->answer->feedback."\n";
$expout .= "}\n";
break;
+ case MATCH:
+ $expout .= "::".$question->name."::".$question->questiontext."{\n";
+ foreach($question->subquestions as $subquestion) {
+ $expout .= "\t=".$subquestion->questiontext." -> ".$subquestion->answertext."\n";
+ }
+ $expout .= "}\n";
+ break;
+ case DESCRIPTION:
+ $expout .= "// DESCRIPTION type is not supported\n";
+ break;
default:
error( "No handler for qtype $question->qtype for GIFT export" );
}

0 comments on commit 1218d47

Please sign in to comment.