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

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()

Detailed Description

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.


Member Function Documentation

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.

Parameters:
restore_path_element$elementthe parent element. (E.g. a quiz attempt.)
array$pathsthe paths array that is being built to describe the structure.

Definition at line 3082 of file restore_stepslib.php.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

find_question_session_and_states ( data,
questionid 
) [protected]

Definition at line 3176 of file restore_stepslib.php.

Here is the caller graph for this function:

get_attempt_upgrader ( ) [protected]

Definition at line 3101 of file restore_stepslib.php.

Here is the caller graph for this function:

get_qtype_restorer ( qtype) [protected]

Get the restore_qtype_plugin subclass for a specific question type.

Parameters:
string$qtypee.g. multichoice.
Returns:
restore_qtype_plugin instance.

Definition at line 3044 of file restore_stepslib.php.

Here is the caller graph for this function:

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.

Parameters:
integer$newusageid

Reimplemented in restore_quiz_activity_structure_step.

Here is the caller graph for this function:

process_legacy_quiz_attempt_data ( data,
quiz 
) [protected]

Process the attempt data defined by add_legacy_question_attempt_data().

Parameters:
object$datacontains all the grouped attempt data ot process.
pbject$quizdata 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.

Here is the call graph for this function:

Here is the caller graph for this function:

process_question_attempt ( data) [protected]

Process question_attempts

Definition at line 2946 of file restore_stepslib.php.

Here is the call graph for this function:

process_question_attempt_step ( data) [protected]

Process question_attempt_steps

Definition at line 2967 of file restore_stepslib.php.

Here is the call graph for this function:

process_question_usage ( data) [protected]

Process question_usages

Definition at line 2914 of file restore_stepslib.php.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

questions_recode_response_data ( qtype,
newquestionid,
sequencenumber,
array response 
)

Recode the respones data for a particular step of an attempt at at particular question.

Parameters:
string$qtypethe question type.
int$newquestionidthe question id.
int$sequencenumberthe sequence number.
array$responsethe response data to recode.

Definition at line 3011 of file restore_stepslib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

recode_legacy_response_data ( question,
qsession,
qstates 
) [protected]

Recode any ids in the response data

Parameters:
object$questionthe question data
object$qsessionthe question sessions.
array$qstatesthe question states.

Definition at line 3207 of file restore_stepslib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

restore_recode_legacy_answer ( state,
qtype 
)

Recode the legacy answer field.

Parameters:
object$statethe state to recode the answer of.
string$qtypethe question type.

Definition at line 3223 of file restore_stepslib.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$newquestionids = array() [protected]

Definition at line 2885 of file restore_stepslib.php.

$qtypes = array() [protected]

Definition at line 2883 of file restore_stepslib.php.


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