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

Public Member Functions

 process_question_answer ($data)
 process_question_numerical_unit ($data)
 process_question_numerical_option ($data)
 process_question_dataset_definition ($data)
 process_question_dataset_item ($data)
 recode_response ($questionid, $sequencenumber, array $response)
 recode_legacy_state_answer ($state)

Static Public Member Functions

static define_plugin_decode_contents ()

Protected Member Functions

 add_question_question_answers (&$paths)
 add_question_numerical_units (&$paths)
 add_question_numerical_options (&$paths)
 add_question_datasets (&$paths)

Detailed Description

Class extending standard restore_plugin in order to implement some helper methods related with the questions (qtype plugin)

TODO: Finish phpdocs

Definition at line 31 of file restore_qtype_plugin.class.php.


Member Function Documentation

add_question_datasets ( &$  paths) [protected]

Add to $paths the restore_path_elements needed to handle question_datasets (defs and items) for a given question Used by various qtypes (calculated, numerical)

Definition at line 87 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

add_question_numerical_options ( &$  paths) [protected]

Add to $paths the restore_path_elements needed to handle question_numerical_options for a given question Used by various qtypes (calculated, numerical)

Definition at line 71 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

add_question_numerical_units ( &$  paths) [protected]

Add to $paths the restore_path_elements needed to handle question_numerical_units for a given question Used by various qtypes (calculated, numerical)

Definition at line 55 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

add_question_question_answers ( &$  paths) [protected]

Add to $paths the restore_path_elements needed to handle question_answers for a given question Used by various qtypes (calculated, essay, multianswer, multichoice, numerical, shortanswer, truefalse)

Definition at line 39 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static define_plugin_decode_contents ( ) [static]

Return the contents of the questions stuff that must be processed by the links decoder

Only common stuff to all plugins, in this case:

  • question: text and feedback
  • question_answers: text and feedbak

Note each qtype will have, if needed, its own define_decode_contents method

Reimplemented from restore_plugin.

Definition at line 346 of file restore_qtype_plugin.class.php.

Processes the answer element (question answers). Common for various qtypes. It handles both creation (if the question is being created) and mapping (if the question already existed and is being reused)

Definition at line 107 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Processes the dataset_definition element (question dataset definitions). Common for various qtypes. It handles both creation (if the question is being created) and mapping (if the question already existed and is being reused)

Definition at line 223 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Processes the dataset_item element (question dataset items). Common for various qtypes. It handles both creation (if the question is being created) and mapping (if the question already existed and is being reused)

Definition at line 287 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Processes the numerical_option element (question numerical options). Common for various qtypes. It handles both creation (if the question is being created) and mapping (if the question already existed and is being reused)

Definition at line 196 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Processes the numerical_unit element (question numerical units). Common for various qtypes. It handles both creation (if the question is being created) and mapping (if the question already existed and is being reused)

Definition at line 171 of file restore_qtype_plugin.class.php.

Here is the call graph for this function:

Decode legacy question_states.answer for this qtype. Used when restoring 2.0 attempt data.

Reimplemented in restore_qtype_match_plugin, restore_qtype_multianswer_plugin, restore_qtype_multichoice_plugin, restore_qtype_truefalse_plugin, restore_qtype_calculatedmulti_plugin, and restore_qtype_random_plugin.

Definition at line 332 of file restore_qtype_plugin.class.php.

recode_response ( questionid,
sequencenumber,
array response 
)

Do any re-coding necessary in the student response.

Parameters:
int$questionidthe new id of the question
int$sequencenumberof the step within the qusetion attempt.
arraythe response data from the backup.
Returns:
array the recoded response.

Reimplemented in restore_qtype_match_plugin, restore_qtype_multianswer_plugin, restore_qtype_multichoice_plugin, and restore_qtype_calculatedmulti_plugin.

Definition at line 324 of file restore_qtype_plugin.class.php.


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