Skip to content

Commit

Permalink
Question text now goes through the (appropriate) formatted, and the e…
Browse files Browse the repository at this point in the history
…xample

CSS is added in.
  • Loading branch information
thepurpleblob committed Apr 20, 2005
1 parent 974a8e8 commit f3bd87c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions mod/quiz/format/xhtml/format.php
Expand Up @@ -29,9 +29,12 @@ function writequestion( $question ) {

// add header
$expout .= "<h3>$question->name</h3>\n";

// add question text
$expout .= "<p class=\"questiontext\">$question->questiontext</p>\n";

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

// selection depends on question type
switch($question->qtype) {
Expand Down Expand Up @@ -100,11 +103,18 @@ function writequestion( $question ) {
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/mod/quiz/format/xhtml/xhtml.css" );
$css = implode( ' ',$css_lines );

$xp = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n";
$xp .= " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
$xp .= "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
$xp .= "<head>\n";
$xp .= "<title>Moodle Quiz XHTML Export</title>\n";
$xp .= $css;
$xp .= "</head>\n";
$xp .= "<body>\n";
$xp .= "<form action=\"...REPLACE ME...\" method=\"post\">\n\n";
Expand Down

0 comments on commit f3bd87c

Please sign in to comment.