Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
qtype_shortanswer_test_helper Class Reference

Test helper class for the shortanswer question type. More...

Inheritance diagram for qtype_shortanswer_test_helper:
question_test_helper

Public Member Functions

 get_shortanswer_question_data_frogonly ()
 Gets the question data for a shortanswer questionwith just the correct ansewer 'frog', and no other answer matching.
 
 get_shortanswer_question_data_frogtoad ()
 Gets the question data for a shortanswer question with with correct ansewer 'frog', partially correct answer 'toad' and defaultmark 1.
 
 get_shortanswer_question_form_data_frogtoad ()
 Gets the question form data for a shortanswer question with with correct answer 'frog', partially correct answer 'toad' and defaultmark 1.
 
 get_test_questions ()
 
 make_shortanswer_question_escapedwildcards ()
 Makes a shortanswer question with just the correct ansewer 'frog', and no other answer matching.
 
 make_shortanswer_question_frogonly ()
 Makes a shortanswer question with just the correct ansewer 'frog', and no other answer matching.
 
 make_shortanswer_question_frogtoad ()
 Makes a shortanswer question with correct ansewer 'frog', partially correct answer 'toad' and defaultmark 1.
 

Static Public Member Functions

static get_question_editing_form ($cat, $questiondata)
 Set up a form to create a question in $cat.
 

Detailed Description

Test helper class for the shortanswer question type.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ 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$catthe category
object$questiondataform initialisation requires question data.
Return values
moodleform

◆ get_shortanswer_question_data_frogonly()

qtype_shortanswer_test_helper::get_shortanswer_question_data_frogonly ( )

Gets the question data for a shortanswer questionwith just the correct ansewer 'frog', and no other answer matching.

Return values
stdClass

◆ get_shortanswer_question_data_frogtoad()

qtype_shortanswer_test_helper::get_shortanswer_question_data_frogtoad ( )

Gets the question data for a shortanswer question with with correct ansewer 'frog', partially correct answer 'toad' and defaultmark 1.

This question also has a '*' match anything answer.

Return values
stdClass

◆ get_shortanswer_question_form_data_frogtoad()

qtype_shortanswer_test_helper::get_shortanswer_question_form_data_frogtoad ( )

Gets the question form data for a shortanswer question with with correct answer 'frog', partially correct answer 'toad' and defaultmark 1.

This question also has a '*' match anything answer.

Return values
stdClass

◆ get_test_questions()

qtype_shortanswer_test_helper::get_test_questions ( )
Return values
arrayof example question names that can be passed as the $which argument of test_question_maker::make_question when $qtype is this question type.

Reimplemented from question_test_helper.

◆ make_shortanswer_question_escapedwildcards()

qtype_shortanswer_test_helper::make_shortanswer_question_escapedwildcards ( )

Makes a shortanswer question with just the correct ansewer 'frog', and no other answer matching.

Return values
qtype_shortanswer_question

◆ make_shortanswer_question_frogonly()

qtype_shortanswer_test_helper::make_shortanswer_question_frogonly ( )

Makes a shortanswer question with just the correct ansewer 'frog', and no other answer matching.

Return values
qtype_shortanswer_question

◆ make_shortanswer_question_frogtoad()

qtype_shortanswer_test_helper::make_shortanswer_question_frogtoad ( )

Makes a shortanswer question with correct ansewer 'frog', partially correct answer 'toad' and defaultmark 1.

This question also has a '*' match anything answer.

Return values
qtype_shortanswer_question

The documentation for this class was generated from the following file: