You are here

function qformat_xhtml::presave_process in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/question/format/xhtml/format.php \qformat_xhtml::presave_process()

Enable any processing to be done on the content just prior to the file being saved default is to do nothing

Parameters

string output text:

string processed output text:

Overrides qformat_default::presave_process

File

includes/moodle/question/format/xhtml/format.php, line 119

Class

qformat_xhtml
@package questionbank @subpackage importexport

Code

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 = "<!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 .= "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\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";
  $xp .= $content;
  $xp .= "<p class=\"submit\">\n";
  $xp .= "  <input type=\"submit\" />\n";
  $xp .= "</p>\n";
  $xp .= "</form>\n";
  $xp .= "</body>\n";
  $xp .= "</html>\n";
  return $xp;
}