Location: PHPKode > projects > Ps and Qs: Processing QTI using PHP > qti-eb/functionsfiles/generatetemplatefunctions.php

header("Content-type: text/plain");

TEMPLATE for a functions file which works with the event-based QTI parser.

The basic plan:
For EVERY possible element in the QTI file (whether you're interested in it or not)
you need to define three functions. For element 'foo' you ned to define:
qtiEbStartfoo($attrs, $context)


$possibletags = array(



foreach($possibletags as $v)
  echo "
// \"$v\":
function qtiEbStart$v(\$attrs, \$context)
  global \$functionsmemory;
function qtiEbData$v(\$context, \$data)
  global \$functionsmemory;
function qtiEbStop$v(\$context)
  global \$functionsmemory;
// ...end \"$v\"


Return current item: Ps and Qs: Processing QTI using PHP