Test helper class for the essay question type.
More...
Test helper class for the essay question type.
- Copyright
- 2013 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ get_essay_question_form_data_editor()
qtype_essay_test_helper::get_essay_question_form_data_editor |
( |
| ) |
|
Make the data what would be received from the editing form for an essay question using the HTML editor allowing embedded files as input, and up to three attachments.
- Return values
-
stdClass | the data that would be returned by $form->get_gata(); |
◆ get_essay_question_form_data_editorfilepicker()
qtype_essay_test_helper::get_essay_question_form_data_editorfilepicker |
( |
| ) |
|
Make the data what would be received from the editing form for an essay question using the HTML editor allowing embedded files as input, and up to three attachments.
- Return values
-
stdClass | the data that would be returned by $form->get_gata(); |
◆ get_essay_question_form_data_plain()
qtype_essay_test_helper::get_essay_question_form_data_plain |
( |
| ) |
|
Make the data what would be received from the editing form for an essay question using the HTML editor allowing embedded files as input, and up to three attachments.
- Return values
-
stdClass | the data that would be returned by $form->get_gata(); |
◆ 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_test_questions()
qtype_essay_test_helper::get_test_questions |
( |
| ) |
|
◆ initialise_essay_question()
qtype_essay_test_helper::initialise_essay_question |
( |
| ) |
|
|
protected |
Helper method to reduce duplication.
- Return values
-
◆ make_attachment()
qtype_essay_test_helper::make_attachment |
( |
|
$draftid, |
|
|
|
$name, |
|
|
|
$contents |
|
) |
| |
|
protected |
Creates an attachment in the provided attachment draft area.
- Parameters
-
int | $draftid | The itemid for the draft area in which the file should be created. |
string | $name | The filename for the file to be created. |
string | $contents | The contents of the file to be created. |
◆ make_attachment_draft_area()
qtype_essay_test_helper::make_attachment_draft_area |
( |
| ) |
|
|
protected |
Creates an empty draft area for attachments.
- Return values
-
int | The draft area's itemid. |
◆ make_attachments()
qtype_essay_test_helper::make_attachments |
( |
|
$attachments | ) |
|
Generates a draft file area that contains the provided number of attachments.
You should ensure that a user is logged in with setUser before you run this function.
- Parameters
-
int | $attachments | The number of attachments to generate. |
- Return values
-
int | The itemid of the generated draft file area. |
◆ make_attachments_saver()
qtype_essay_test_helper::make_attachments_saver |
( |
|
$attachments | ) |
|
Generates a question_file_saver that contains the provided number of attachments.
You should ensure that a user is logged in with setUser before you run this function.
- Parameters
-
int | $:attachments The number of attachments to generate. |
- Return values
-
◆ make_essay_question_editor()
qtype_essay_test_helper::make_essay_question_editor |
( |
| ) |
|
Makes an essay question using the HTML editor as input.
- Return values
-
◆ make_essay_question_editorfilepicker()
qtype_essay_test_helper::make_essay_question_editorfilepicker |
( |
| ) |
|
Makes an essay question using the HTML editor allowing embedded files as input, and up to three attachments.
- Return values
-
◆ make_essay_question_editorfilepickertworequired()
qtype_essay_test_helper::make_essay_question_editorfilepickertworequired |
( |
| ) |
|
Makes an essay question using the HTML editor allowing embedded files as input, and up to two attachments, two needed.
- Return values
-
◆ make_essay_question_monospaced()
qtype_essay_test_helper::make_essay_question_monospaced |
( |
| ) |
|
Makes an essay question using monospaced input.
- Return values
-
◆ make_essay_question_noinline()
qtype_essay_test_helper::make_essay_question_noinline |
( |
| ) |
|
Makes an essay question without an online text editor.
- Return values
-
◆ make_essay_question_plain()
qtype_essay_test_helper::make_essay_question_plain |
( |
| ) |
|
Makes an essay question using plain text input.
- Return values
-
The documentation for this class was generated from the following file: