qtype=='category') { return ''; } // initial string; $expout = ""; $id = $question->id; // add comment and div tags $expout .= "\n"; $expout .= "
\n"; // add header $expout .= "

$question->name

\n"; // format and add question text $questiontext = $question->questiontext; $format = $question->questiontextformat; $formatted_text = format_text( $questiontext, $format ); $expout .= "

$formatted_text

\n"; // selection depends on question type switch($question->qtype) { case TRUEFALSE: $st_true = get_string( 'true','quiz' ); $st_false = get_string( 'false','quiz' ); $expout .= "\n"; break; case MULTICHOICE: $expout .= "\n"; break; case SHORTANSWER: $expout .= "\n"; break; case NUMERICAL: $expout .= "\n"; break; case MATCH: $expout .= "\n"; break; case DESCRIPTION: break; case MULTIANSWER: $expout .= "\n"; break; default: notify("No handler for qtype $question->qtype for GIFT export" ); } // close off div $expout .= "
\n\n\n"; return $expout; } function presave_process( $content ) { // override method to allow us to add xhtml headers and footers global $CFG; // get css bit $css_lines = file( "$CFG->dirroot/question/format/xhtml/xhtml.css" ); $css = implode( ' ',$css_lines ); $xp = "\n"; $xp .= "\n"; $xp .= "\n"; $xp .= "\n"; $xp .= "Moodle Quiz XHTML Export\n"; $xp .= $css; $xp .= "\n"; $xp .= "\n"; $xp .= "
\n\n"; $xp .= $content; $xp .= "

\n"; $xp .= " \n"; $xp .= "

\n"; $xp .= "
\n"; $xp .= "\n"; $xp .= "\n"; return $xp; } function export_file_extension() { return ".html"; } } ?>