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


Public Member Functions | |
| __construct ($realqas, $extraprefix) | |
| add_prefix ($field) | |
| remove_prefix ($field) | |
| filter_array ($data) | |
| get_state () | |
| set_state ($state) | |
| get_fraction () | |
| set_fraction ($fraction) | |
| get_user_id () | |
| get_timecreated () | |
| has_qt_var ($name) | |
| get_qt_var ($name) | |
| set_qt_var ($name, $value) | |
| get_qt_data () | |
| has_behaviour_var ($name) | |
| get_behaviour_var ($name) | |
| set_behaviour_var ($name, $value) | |
| get_behaviour_data () | |
| get_submitted_data () | |
| get_all_data () | |
| get_qt_files ($name, $contextid) | |
| prepare_response_files_draft_itemid ($name, $contextid) | |
| prepare_response_files_draft_itemid_with_text ($name, $contextid, $text) | |
| rewrite_response_pluginfile_urls ($text, $contextid, $name, $extras) | |
Protected Attributes | |
| $realstep | |
| $extraprefix | |
This is an adapter class that wraps a question_attempt_step and modifies the get/set_*_data methods so that they operate only on the parts that belong to a particular subquestion, as indicated by an extra prefix.
Definition at line 496 of file questionattemptstep.php.
| __construct | ( | $ | realqas, |
| $ | extraprefix | ||
| ) |
Constructor.
| question_attempt_step | $realqas | the step to wrap. (Can be null if you just want to call add/remove.prefix.) |
| unknown_type | $extraprefix | the extra prefix that is used for date fields. |
Definition at line 508 of file questionattemptstep.php.
| add_prefix | ( | $ | field | ) |
Add the extra prefix to a field name.
| string | $field | the plain field name. |
Definition at line 518 of file questionattemptstep.php.

| filter_array | ( | $ | data | ) |
Filter some data to keep only those entries where the key contains extraprefix, and remove the extra prefix from the reutrned arrary.
| array | $data | some of the data stored in this step. |
Definition at line 550 of file questionattemptstep.php.


| get_all_data | ( | ) |
Get all the data. behaviour variables have the - at the start of their name. This is only intended for internal use, for example by question_engine_data_mapper::insert_question_attempt_step(), however, it can ocasionally be useful in test code. It should not be considered part of the public API of this class.
| array | name => value pairs. |
Reimplemented from question_attempt_step.
Definition at line 620 of file questionattemptstep.php.

Get all the behaviour variables.
| array | name => value pairs. |
Reimplemented from question_attempt_step.
Definition at line 612 of file questionattemptstep.php.

| get_behaviour_var | ( | $ | name | ) |
| string | $name | the name of an behaviour variable to look for in the submitted data. |
Reimplemented from question_attempt_step.
Definition at line 604 of file questionattemptstep.php.

| get_fraction | ( | ) |
Reimplemented from question_attempt_step.
Definition at line 568 of file questionattemptstep.php.
| get_qt_data | ( | ) |
Get all the question type variables.
| array | name => value pairs. |
Reimplemented from question_attempt_step.
Definition at line 596 of file questionattemptstep.php.

| get_qt_files | ( | $ | name, |
| $ | contextid | ||
| ) |
Get the latest set of files for a particular question type variable of type question_attempt::PARAM_FILES.
| string | $name | the name of the associated variable. |
Reimplemented from question_attempt_step.
Definition at line 624 of file questionattemptstep.php.
| get_qt_var | ( | $ | name | ) |
| string | $name | the name of a question type variable to look for in the submitted data. |
Reimplemented from question_attempt_step.
Definition at line 588 of file questionattemptstep.php.

| get_state | ( | ) |
Reimplemented from question_attempt_step.
Definition at line 560 of file questionattemptstep.php.
Get all the submitted data, but not the cached data. behaviour variables have the - at the start of their name. This is only really intended for use by question_attempt::regrade(), it should not be considered part of the public API.
| array | name => value pairs. |
Reimplemented from question_attempt_step.
Definition at line 616 of file questionattemptstep.php.

| get_timecreated | ( | ) |
Reimplemented from question_attempt_step.
Definition at line 580 of file questionattemptstep.php.
| get_user_id | ( | ) |
Reimplemented from question_attempt_step.
Definition at line 576 of file questionattemptstep.php.
| has_behaviour_var | ( | $ | name | ) |
| string | $name | the name of an behaviour variable to look for in the submitted data. |
Reimplemented from question_attempt_step.
Definition at line 600 of file questionattemptstep.php.

| has_qt_var | ( | $ | name | ) |
| string | $name | the name of a question type variable to look for in the submitted data. |
Reimplemented from question_attempt_step.
Definition at line 584 of file questionattemptstep.php.

| prepare_response_files_draft_itemid | ( | $ | name, |
| $ | contextid | ||
| ) |
Prepare a draft file are for the files belonging the a response variable of this step.
| string | $name | the variable name the files belong to. |
| int | $contextid | the id of the context the quba belongs to. |
Reimplemented from question_attempt_step.
Definition at line 629 of file questionattemptstep.php.
| prepare_response_files_draft_itemid_with_text | ( | $ | name, |
| $ | contextid, | ||
| $ | text | ||
| ) |
Prepare a draft file are for the files belonging the a response variable of this step, while rewriting the URLs in some text.
| string | $name | the variable name the files belong to. |
| int | $contextid | the id of the context the quba belongs to. |
| string | $text | the text to update the URLs in. |
Reimplemented from question_attempt_step.
Definition at line 634 of file questionattemptstep.php.
| remove_prefix | ( | $ | field | ) |
Remove the extra prefix from a field name if it is present.
| string | $field | the extended field name. |
Definition at line 536 of file questionattemptstep.php.

| rewrite_response_pluginfile_urls | ( | $ | text, |
| $ | contextid, | ||
| $ | name, | ||
| $ | extras | ||
| ) |
Rewrite the @PLUGINFILE@ tokens in a response variable from this step that contains links to file. Normally you should probably call question_attempt::rewrite_response_pluginfile_urls() instead of calling this method directly.
| string | $text | the text to update the URLs in. |
| int | $contextid | the id of the context the quba belongs to. |
| string | $name | the variable name the files belong to. |
| array | $extra | extra file path components. |
Reimplemented from question_attempt_step.
Definition at line 639 of file questionattemptstep.php.
| set_behaviour_var | ( | $ | name, |
| $ | value | ||
| ) |
Set a cached behaviour variable.
| string | $name | the name of the variable to set. Must match _[a-z][a-z0-9]*. |
| string | $value | the value to set. |
Reimplemented from question_attempt_step.
Definition at line 608 of file questionattemptstep.php.

| set_fraction | ( | $ | fraction | ) |
Set the fraction. Normally only called by behaviours.
| null | number | $fraction | the fraction to set. |
Reimplemented from question_attempt_step.
Definition at line 572 of file questionattemptstep.php.
| set_qt_var | ( | $ | name, |
| $ | value | ||
| ) |
Set a cached question type variable.
| string | $name | the name of the variable to set. Must match _[a-z][a-z0-9]*. |
| string | $value | the value to set. |
Reimplemented from question_attempt_step.
Definition at line 592 of file questionattemptstep.php.

| set_state | ( | $ | state | ) |
Set the state. Normally only called by behaviours.
| question_state | $state | one of the question_state constants. |
Reimplemented from question_attempt_step.
Definition at line 564 of file questionattemptstep.php.
$extraprefix [protected] |
Definition at line 500 of file questionattemptstep.php.
$realstep [protected] |
Definition at line 498 of file questionattemptstep.php.