Moodle  2.2.1
http://www.collinsharper.com
moodle1_qtype_handler Class Reference
Inheritance diagram for moodle1_qtype_handler:
Collaboration diagram for moodle1_qtype_handler:

Public Member Functions

 get_question_subpaths ()
 process_question (array $data, array $raw)
 __construct (moodle1_question_bank_handler $qbankhandler, $qtype)
 implementation details follow //////////////////////////////////////////
 get_paths ()
 use_xml_writer (xml_writer $xmlwriter)

Protected Member Functions

 write_answers (array $answers, $qtype)
 write_numerical_units (array $numericalunits)
 write_numerical_options (array $numericaloption)
 get_default_numerical_options ($oldquestiontextformat, $units)
 write_dataset_definitions (array $datasetdefinitions)
 open_xml_writer ()
 close_xml_writer ()

Protected Attributes

 $qbankhandler

Detailed Description

Base class for all question type handlers

Definition at line 1699 of file handlerlib.php.


Constructor & Destructor Documentation

__construct ( moodle1_question_bank_handler qbankhandler,
qtype 
)

implementation details follow //////////////////////////////////////////

Definition at line 1841 of file handlerlib.php.

Here is the call graph for this function:


Member Function Documentation

close_xml_writer ( ) [final, protected]

Question type handlers cannot close the xml_writer

Reimplemented from moodle1_xml_handler.

Definition at line 1864 of file handlerlib.php.

get_default_numerical_options ( oldquestiontextformat,
units 
) [protected]

Returns default numerical_option structure

This structure is not present in moodle.xml, we create a new artificial one here.

See also:
write_numerical_options()
Parameters:
int$oldquestiontextformat
Returns:
array

Definition at line 1784 of file handlerlib.php.

Here is the caller graph for this function:

get_paths ( ) [final]
See also:
self::get_question_subpaths()

Definition at line 1850 of file handlerlib.php.

Returns the list of paths within one <QUESTION> that this qtype needs to have included in the grouped question structure

Returns:
array of strings

Reimplemented in moodle1_qtype_calculated_handler, moodle1_qtype_essay_handler, moodle1_qtype_match_handler, moodle1_qtype_multianswer_handler, moodle1_qtype_multichoice_handler, moodle1_qtype_numerical_handler, moodle1_qtype_shortanswer_handler, and moodle1_qtype_truefalse_handler.

Definition at line 1710 of file handlerlib.php.

open_xml_writer ( ) [final, protected]

Question type handlers cannot open the xml_writer

Definition at line 1857 of file handlerlib.php.

process_question ( array data,
array raw 
)

Gives the qtype handler a chance to write converted data into questions.xml

Parameters:
array$datagrouped question data
array$rawgrouped raw QUESTION data

Reimplemented in moodle1_qtype_multianswer_handler, moodle1_qtype_calculated_handler, moodle1_qtype_numerical_handler, moodle1_qtype_match_handler, moodle1_qtype_multichoice_handler, moodle1_qtype_shortanswer_handler, moodle1_qtype_truefalse_handler, and moodle1_qtype_essay_handler.

Definition at line 1720 of file handlerlib.php.

use_xml_writer ( xml_writer xmlwriter)

Provides a xml_writer instance to this qtype converter

Parameters:
xml_writer$xmlwriter

Definition at line 1873 of file handlerlib.php.

write_answers ( array answers,
qtype 
) [protected]

Converts the answers and writes them into the questions.xml

The structure "answers" is used by several qtypes. It contains data from {question_answers} table.

Parameters:
array$answersas parsed by the grouped parser in moodle.xml
string$qtypecontaining the answers

Definition at line 1731 of file handlerlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_dataset_definitions ( array datasetdefinitions) [protected]

Writes the dataset_definitions structure

Parameters:
array$datasetdefinitionsarray of dataset_definition structures

Definition at line 1818 of file handlerlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_numerical_options ( array numericaloption) [protected]

Writes the numerical_options structure

See also:
get_default_numerical_options()
Parameters:
array$numericaloption

Definition at line 1766 of file handlerlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

write_numerical_units ( array numericalunits) [protected]

Writes the grouped numerical_units structure

Parameters:
array$numericalunits

Definition at line 1748 of file handlerlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$qbankhandler [protected]

Definition at line 1702 of file handlerlib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations