Test helper for the ordering question type.
More...
Test helper for the ordering question type.
The class has code to generate question data structures for sample ordering questions.
- Copyright
- 2018 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ get_ordering_question_data_moodle()
qtype_ordering_test_helper::get_ordering_question_data_moodle |
( |
| ) |
|
Get the raw data that corresponds an ordering question.
The question is to sort the words Modular Object Oriented Dynamic Learning Environment.
- Return values
-
stdClass | simulated question form data. |
◆ get_ordering_question_form_data_moodle()
qtype_ordering_test_helper::get_ordering_question_form_data_moodle |
( |
| ) |
|
Get the form data that corresponds an ordering question.
The question is to sort the words Modular Object Oriented Dynamic Learning Environment.
- Return values
-
stdClass | simulated question form data. |
◆ get_question_editing_form()
static question_test_helper::get_question_editing_form |
( |
| $cat, |
|
|
| $questiondata ) |
|
staticinherited |
Set up a form to create a question in $cat.
This method also sets cat and contextid on $questiondata object.
- Parameters
-
object | $cat | the category |
object | $questiondata | form initialisation requires question data. |
- Return values
-
◆ get_response()
static qtype_ordering_test_helper::get_response |
( |
question_definition | $question, |
|
|
array | $items ) |
|
static |
Return an array of answer codes in the order of given response.
- Parameters
-
- Return values
-
array | The array of answer codes in the order of given response. |
◆ get_test_questions()
qtype_ordering_test_helper::get_test_questions |
( |
| ) |
|
Get the question types that this helper can handle.
- Return values
-
Reimplemented from question_test_helper.
◆ make_answer()
qtype_ordering_test_helper::make_answer |
( |
int | $id, |
|
|
string | $text, |
|
|
int | $textformat, |
|
|
int | $order, |
|
|
bool | $addmd5 = false ) |
Create an answer record to use in a test question.
- Parameters
-
int | $id | the id to set. |
string | $text | |
int | $textformat | one of the FORMAT_... constants. |
int | $order | the position in order, numbered from 1. |
bool | $addmd5 | whether to add the md5key property. |
- Return values
-
◆ make_ordering_question_moodle()
qtype_ordering_test_helper::make_ordering_question_moodle |
( |
| ) |
|
Makes an ordering question to sort the words Modular Object Oriented Dynamic Learning Environment.
- Return values
-
The documentation for this class was generated from the following file:
- question/type/ordering/tests/helper.php