Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
qtype_multianswer_test_helper Class Reference

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

Inheritance diagram for qtype_multianswer_test_helper:
question_test_helper

Public Member Functions

 get_multianswer_question_data_dollarsigns ()
 Makes a multianswer question onetaining one blank in some text.
 
 get_multianswer_question_data_twosubq ()
 Makes a multianswer question about completing two blanks in some text.
 
 get_multianswer_question_form_data_twosubq ()
 Makes a multianswer question about completing two blanks in some text.
 
 get_test_questions ()
 
 make_multianswer_question_fourmc ()
 Makes a multianswer question about completing two blanks in some text.
 
 make_multianswer_question_multiple ()
 Makes a multianswer question with multichoice_multiple questions in it.
 
 make_multianswer_question_numericalzero ()
 Makes a multianswer question with one numerical subquestion, right answer 0.
 
 make_multianswer_question_twosubq ()
 Makes a multianswer question about completing two blanks in some text.
 
 make_multianswer_question_zeroweight ()
 Makes a multianswer question with zero weight.
 

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 multianswer question type.

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

Member Function Documentation

◆ get_multianswer_question_data_dollarsigns()

qtype_multianswer_test_helper::get_multianswer_question_data_dollarsigns ( )

Makes a multianswer question onetaining one blank in some text.

This question has no hints.

Return values
objectthe question definition data, as it might be returned from get_question_options.

◆ get_multianswer_question_data_twosubq()

qtype_multianswer_test_helper::get_multianswer_question_data_twosubq ( )

Makes a multianswer question about completing two blanks in some text.

Return values
objectthe question definition data, as it might be returned from get_question_options.

◆ get_multianswer_question_form_data_twosubq()

qtype_multianswer_test_helper::get_multianswer_question_form_data_twosubq ( )

Makes a multianswer question about completing two blanks in some text.

Return values
objectthe question definition data, as it might be returned from the question editing form.

◆ 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_test_questions()

qtype_multianswer_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_multianswer_question_fourmc()

qtype_multianswer_test_helper::make_multianswer_question_fourmc ( )

Makes a multianswer question about completing two blanks in some text.

Return values
qtype_multianswer_question

◆ make_multianswer_question_multiple()

qtype_multianswer_test_helper::make_multianswer_question_multiple ( )

Makes a multianswer question with multichoice_multiple questions in it.

Return values
qtype_multianswer_question

◆ make_multianswer_question_numericalzero()

qtype_multianswer_test_helper::make_multianswer_question_numericalzero ( )

Makes a multianswer question with one numerical subquestion, right answer 0.

This is used for testing the MDL-35370 bug.

Return values
qtype_multianswer_question

◆ make_multianswer_question_twosubq()

qtype_multianswer_test_helper::make_multianswer_question_twosubq ( )

Makes a multianswer question about completing two blanks in some text.

Return values
qtype_multianswer_question

◆ make_multianswer_question_zeroweight()

qtype_multianswer_test_helper::make_multianswer_question_zeroweight ( )

Makes a multianswer question with zero weight.

This is used for testing the MDL-77378 bug.

Return values
qtype_multianswer_question

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