|
Moodle
2.2.1
http://www.collinsharper.com
|
This static class provides access to the other question engine classes.
It provides functions for managing question behaviours), and for creating, loading, saving and deleting question_usage_by_activitys, which is the main class that is used by other code that wants to use questions.
| static delete_questions_usage_by_activities | ( | qubaid_condition $ | qubaids | ) | [static] |
Delete question_usage_by_activitys from the database.
| qubaid_condition | $qubaids | identifies which questions usages to delete. |
Definition at line 109 of file lib.php.

| static delete_questions_usage_by_activity | ( | $ | qubaid | ) | [static] |
Delete a question_usage_by_activity from the database, based on its id.
| int | $qubaid | the id of the usage to delete. |
Definition at line 101 of file lib.php.


| static get_all_response_file_areas | ( | ) | [static] |
| static get_archetypal_behaviours | ( | ) | [static] |
Return an array where the keys are the internal names of the archetypal behaviours, and the values are a human-readable name. An archetypal behaviour is one that is suitable to pass the name of to question_usage_by_activity::set_preferred_behaviour().
Definition at line 224 of file lib.php.


| static get_behaviour_name | ( | $ | behaviour | ) | [static] |
| static get_behaviour_options | ( | $ | currentbehaviour | ) | [static] |
Return an array where the keys are the internal names of the behaviours in preferred order and the values are a human-readable name.
| string | $currentbehaviour |
Definition at line 299 of file lib.php.


| static get_behaviour_unused_display_options | ( | $ | behaviour | ) | [static] |
| string | $behaviour | the name of a behaviour. |
Definition at line 164 of file lib.php.


| static get_dp_options | ( | ) | [static] |
Returns the valid choices for the number of decimal places for showing question marks. For use in the user interface.
Definition at line 352 of file lib.php.

| static initialise_js | ( | ) | [static] |
| static is_behaviour_archetypal | ( | $ | behaviour | ) | [static] |
| static load_behaviour_class | ( | $ | behaviour | ) | [static] |
Load the behaviour class(es) belonging to a particular model. That is, include_once('/question/behaviour/' . $behaviour . '/behaviour.php'), with a bit of checking.
| string | $qtypename | the question type name. For example 'multichoice' or 'shortanswer'. |
Definition at line 203 of file lib.php.

| static load_questions_usage_by_activity | ( | $ | qubaid | ) | [static] |
Load a question_usage_by_activity from the database, based on its id.
| int | $qubaid | the id of the usage to load. |
Definition at line 76 of file lib.php.

| static make_archetypal_behaviour | ( | $ | preferredbehaviour, |
| question_attempt $ | qa | ||
| ) | [static] |
Create an archetypal behaviour for a particular question attempt. Used by question_definition::make_behaviour().
| string | $preferredbehaviour | the type of model required. |
| question_attempt | $qa | the question attempt the model will process. |
Definition at line 149 of file lib.php.


| static make_behaviour | ( | $ | behaviour, |
| question_attempt $ | qa, | ||
| $ | preferredbehaviour | ||
| ) | [static] |
Create an behaviour for a particular type. If that type cannot be found, return an instance of qbehaviour_missing.
Normally you should use make_archetypal_behaviour(), or call the constructor of a particular model class directly. This method is only intended for use by question_attempt::load_from_records().
| string | $behaviour | the type of model to create. |
| question_attempt | $qa | the question attempt the model will process. |
| string | $preferredbehaviour | the preferred behaviour for the containing usage. |
Definition at line 186 of file lib.php.


| static make_questions_usage_by_activity | ( | $ | component, |
| $ | context | ||
| ) | [static] |
Create a new question_usage_by_activity. The usage is created in memory. If you want it to persist, you will need to call save_questions_usage_by_activity().
| string | $component | the plugin creating this attempt. For example mod_quiz. |
| object | $context | the context this usage belongs to. |
Definition at line 67 of file lib.php.

| static questions_in_use | ( | array $ | questionids, |
| qubaid_condition $ | qubaids = null |
||
| ) | [static] |
| array | $questionids | of question ids. |
| qubaid_condition | $qubaids | ids of the usages to consider. |
Definition at line 133 of file lib.php.

| static save_questions_usage_by_activity | ( | question_usage_by_activity $ | quba | ) | [static] |
Save a question_usage_by_activity to the database. This works either if the usage was newly created by make_questions_usage_by_activity() or loaded from the database using load_questions_usage_by_activity()
| question_usage_by_activity | the usage to save. |
Definition at line 87 of file lib.php.


| static set_max_mark_in_attempts | ( | qubaid_condition $ | qubaids, |
| $ | slot, | ||
| $ | newmaxmark | ||
| ) | [static] |
Change the maxmark for the question_attempt with number in usage $slot for all the specified question_attempts.
| qubaid_condition | $qubaids | Selects which usages are updated. |
| int | $slot | the number is usage to affect. |
| number | $newmaxmark | the new max mark to set. |
Definition at line 121 of file lib.php.

| static sort_behaviours | ( | $ | archetypes, |
| $ | orderlist, | ||
| $ | disabledlist, | ||
| $ | current = null |
||
| ) | [static] |
Return an array where the keys are the internal names of the behaviours in preferred order and the values are a human-readable name.
| array | $archetypes,array | of behaviours |
| string | $orderlist,a | comma separated list of behaviour names |
| string | $disabledlist,a | comma separated list of behaviour names |
| string | $current,current | behaviour name |
Definition at line 256 of file lib.php.
