|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| questions_recode_response_data ($qtype, $newquestionid, $sequencenumber, array $response) | |
| restore_recode_legacy_answer ($state, $qtype) | |
Protected Member Functions | |
| add_question_usages ($element, &$paths) | |
| process_question_usage ($data) | |
| inform_new_usage_id ($newusageid) | |
| process_question_attempt ($data) | |
| process_question_attempt_step ($data) | |
| questions_recode_layout ($layout) | |
| get_qtype_restorer ($qtype) | |
| after_execute () | |
| add_legacy_question_attempt_data ($element, &$paths) | |
| get_attempt_upgrader () | |
| process_legacy_quiz_attempt_data ($data, $quiz) | |
| find_question_session_and_states ($data, $questionid) | |
| recode_legacy_response_data ($question, $qsession, $qstates) | |
Protected Attributes | |
| $qtypes = array() | |
| $newquestionids = array() | |
Abstract structure step, to be used by all the activities using core questions stuff (like the quiz module), to support qtype plugins, states and sessions
Definition at line 2881 of file restore_stepslib.php.
| add_legacy_question_attempt_data | ( | $ | element, |
| &$ | paths | ||
| ) | [protected] |
Attach below $element (usually attempts) the needed restore_path_elements to restore question attempt data from Moodle 2.0.
When using this method, the parent element ($element) must be defined with $grouped = true. Then, in that elements process method, you must call process_legacy_attempt_data() with the groupded data. See, for example, the usage of this method in restore_quiz_activity_structure_step.
| restore_path_element | $element | the parent element. (E.g. a quiz attempt.) |
| array | $paths | the paths array that is being built to describe the structure. |
Definition at line 3082 of file restore_stepslib.php.

| add_question_usages | ( | $ | element, |
| &$ | paths | ||
| ) | [protected] |
Attach below $element (usually attempts) the needed restore_path_elements to restore question_usages and all they contain.
Definition at line 2891 of file restore_stepslib.php.

| after_execute | ( | ) | [protected] |
This method will be executed after the whole structure step have been processed
After execution method for code needed to be executed after the whole structure has been processed. Useful for cleaning tasks, files process and others. Simply overwrite in in your steps if needed
Reimplemented from restore_structure_step.
Reimplemented in restore_quiz_activity_structure_step.
Definition at line 3061 of file restore_stepslib.php.

| find_question_session_and_states | ( | $ | data, |
| $ | questionid | ||
| ) | [protected] |
| get_attempt_upgrader | ( | ) | [protected] |
| get_qtype_restorer | ( | $ | qtype | ) | [protected] |
Get the restore_qtype_plugin subclass for a specific question type.
| string | $qtype | e.g. multichoice. |
Definition at line 3044 of file restore_stepslib.php.

| inform_new_usage_id | ( | $ | newusageid | ) | [abstract, protected] |
When process_question_usage creates the new usage, it calls this method to let the activity link to the new usage. For example, the quiz uses this method to set quiz_attempts.uniqueid to the new usage id.
| integer | $newusageid |
Reimplemented in restore_quiz_activity_structure_step.

| process_legacy_quiz_attempt_data | ( | $ | data, |
| $ | quiz | ||
| ) | [protected] |
Process the attempt data defined by add_legacy_question_attempt_data().
| object | $data | contains all the grouped attempt data ot process. |
| pbject | $quiz | data about the activity the attempts belong to. Required fields are (basically this only works for the quiz module): oldquestions => list of question ids in this activity - using old ids. preferredbehaviour => the behaviour to use for questionattempts. |
Definition at line 3117 of file restore_stepslib.php.


| process_question_attempt | ( | $ | data | ) | [protected] |
Process question_attempts
Definition at line 2946 of file restore_stepslib.php.

| process_question_attempt_step | ( | $ | data | ) | [protected] |
Process question_attempt_steps
Definition at line 2967 of file restore_stepslib.php.

| process_question_usage | ( | $ | data | ) | [protected] |
Process question_usages
Definition at line 2914 of file restore_stepslib.php.

| questions_recode_layout | ( | $ | layout | ) | [protected] |
Given a list of question->ids, separated by commas, returns the recoded list, with all the restore question mappings applied. Note: Used by quiz->questions and quiz_attempts->layout Note: 0 = page break (unconverted)
Definition at line 3026 of file restore_stepslib.php.


| questions_recode_response_data | ( | $ | qtype, |
| $ | newquestionid, | ||
| $ | sequencenumber, | ||
| array $ | response | ||
| ) |
Recode the respones data for a particular step of an attempt at at particular question.
| string | $qtype | the question type. |
| int | $newquestionid | the question id. |
| int | $sequencenumber | the sequence number. |
| array | $response | the response data to recode. |
Definition at line 3011 of file restore_stepslib.php.


| recode_legacy_response_data | ( | $ | question, |
| $ | qsession, | ||
| $ | qstates | ||
| ) | [protected] |
Recode any ids in the response data
| object | $question | the question data |
| object | $qsession | the question sessions. |
| array | $qstates | the question states. |
Definition at line 3207 of file restore_stepslib.php.


| restore_recode_legacy_answer | ( | $ | state, |
| $ | qtype | ||
| ) |
Recode the legacy answer field.
| object | $state | the state to recode the answer of. |
| string | $qtype | the question type. |
Definition at line 3223 of file restore_stepslib.php.


$newquestionids = array() [protected] |
Definition at line 2885 of file restore_stepslib.php.
$qtypes = array() [protected] |
Definition at line 2883 of file restore_stepslib.php.