Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
qbank_editquestion\editquestion_helper Class Reference

Class editquestion_helper for methods related to add/edit/copy. More...

Static Public Member Functions

static create_new_question_button ($categoryid, $params, $canadd, $tooltip='', $disabled=false)
 Print a button for creating a new question.
 
static get_question_status_list ()
 Get the array of status of the questions.
 
static get_question_status_string ($status)
 Get the string for the status of the question.
 
static print_choose_qtype_to_add_form (array $hiddenparams, array $allowedqtypes=null, $enablejs=true)
 Print a form to let the user choose which question type to add.
 

Detailed Description

Class editquestion_helper for methods related to add/edit/copy.

Author
Safat Shahin safat.nosp@m.shah.nosp@m.in@ca.nosp@m.taly.nosp@m.st-au.nosp@m..net

Member Function Documentation

◆ create_new_question_button()

static qbank_editquestion\editquestion_helper::create_new_question_button ( $categoryid,
$params,
$canadd,
$tooltip = '',
$disabled = false )
static

Print a button for creating a new question.

This will open question/addquestion.php, which in turn goes to question/question.php before getting back to $params['returnurl'] (by default the question bank screen).

Parameters
int$categoryidThe id of the category that the new question should be added to.
array$paramsOther paramters to add to the URL. You need either $params['cmid'] or $params['courseid'], and you should probably set $params['returnurl']
bool$canaddthe text to display on the button.
string$tooltipa tooltip to add to the button (optional).
bool$disabledif true, the button will be disabled.
Deprecated
since Moodle 4.3. Use {
See also
add_new_question} renderable instead
Todo
Final deprecation in Moodle 4.7

◆ get_question_status_list()

static qbank_editquestion\editquestion_helper::get_question_status_list ( )
static

Get the array of status of the questions.

Return values
array

◆ get_question_status_string()

static qbank_editquestion\editquestion_helper::get_question_status_string ( $status)
static

Get the string for the status of the question.

Parameters
string$status
Return values
string

◆ print_choose_qtype_to_add_form()

static qbank_editquestion\editquestion_helper::print_choose_qtype_to_add_form ( array $hiddenparams,
array $allowedqtypes = null,
$enablejs = true )
static

Print a form to let the user choose which question type to add.

When the form is submitted, it goes to the question.php script.

Parameters
array | null$hiddenparamshidden parameters to add to the form, in addition to the qtype radio buttons.
array | null$allowedqtypesoptional list of qtypes that are allowed. If given, only those qtypes will be shown. Example value array('description', 'multichoice').
bool$enablejs
Return values
bool|string

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