|
static | choose_question_for_redo (int $quizid, context_module $quizcontext, int $slotid, qubaid_condition $qubaids) |
| Choose question for redo in a particular slot.
|
|
static | describe_random_question (\stdClass $slotdata) |
| Given a slot from the array returned by get_question_structure, describe the random question it represents.
|
|
static | get_question_structure (int $quizid, context_module $quizcontext, int $slotid=null) |
| Get the information about which questions should be used to create a quiz attempt.
|
|
static | get_tag_ids_for_slot (\stdClass $slotdata) |
| Get this list of random selection tag ids from one of the slots returned by get_question_structure.
|
|
static | get_version_options (int $questionid) |
| Get the available versions of a question where one of the version has the given question id.
|
|
◆ choose_question_for_redo()
static mod_quiz\question\bank\qbank_helper::choose_question_for_redo |
( |
int | $quizid, |
|
|
context_module | $quizcontext, |
|
|
int | $slotid, |
|
|
qubaid_condition | $qubaids ) |
|
static |
Choose question for redo in a particular slot.
- Parameters
-
int | $quizid | the id of the quiz to load the data for. |
context_module | $quizcontext | the context of this quiz. |
int | $slotid | optional, if passed only load the data for this one slot (if it is in this quiz). |
qubaid_condition | $qubaids | attempts to consider when avoiding picking repeats of random questions. |
- Return values
-
int | the id of the question to use. |
◆ describe_random_question()
static mod_quiz\question\bank\qbank_helper::describe_random_question |
( |
\stdClass | $slotdata | ) |
|
|
static |
Given a slot from the array returned by get_question_structure, describe the random question it represents.
- Parameters
-
stdClass | $slotdata | one of the array elements returned by get_question_structure. |
- Return values
-
string | that can be used to display the random slot. |
◆ get_question_structure()
static mod_quiz\question\bank\qbank_helper::get_question_structure |
( |
int | $quizid, |
|
|
context_module | $quizcontext, |
|
|
int | $slotid = null ) |
|
static |
Get the information about which questions should be used to create a quiz attempt.
Each element in the returned array is indexed by slot.slot (slot number) an each object hass:
- All the field of the slot table.
- contextid for where the question(s) come from.
- category id for where the questions come from.
- For non-random questions, All the fields of the question table (but id is in questionid). Also question version and question bankentryid.
- For random questions, filtercondition, which is also unpacked into category, randomrecurse, randomtags, and note that these also have a ->name set and ->qtype set to 'random'.
- Parameters
-
int | $quizid | the id of the quiz to load the data for. |
context_module | $quizcontext | the context of this quiz. |
int | null | $slotid | optional, if passed only load the data for this one slot (if it is in this quiz). |
- Return values
-
array | indexed by slot, with information about the content of each slot. |
◆ get_tag_ids_for_slot()
static mod_quiz\question\bank\qbank_helper::get_tag_ids_for_slot |
( |
\stdClass | $slotdata | ) |
|
|
static |
Get this list of random selection tag ids from one of the slots returned by get_question_structure.
- Parameters
-
stdClass | $slotdata | one of the array elements returned by get_question_structure. |
- Return values
-
◆ get_version_options()
static mod_quiz\question\bank\qbank_helper::get_version_options |
( |
int | $questionid | ) |
|
|
static |
Get the available versions of a question where one of the version has the given question id.
- Parameters
-
int | $questionid | id of a question. |
- Return values
-
stdClass[] | other versions of this question. Each object has fields versionid, version and questionid. Array is returned most recent version first. |
The documentation for this class was generated from the following file:
- mod/quiz/classes/question/bank/qbank_helper.php