Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
question_hint_with_parts Class Reference

An extension of question_hint for questions like match and multiple choice with multile answers, where there are options for whether to show the number of parts right at each stage, and to reset the wrong parts. More...

Inheritance diagram for question_hint_with_parts:

Public Member Functions

 __construct ($id, $hint, $hintformat, $shownumcorrect, $clearwrong)
 Constructor.
 
 adjust_display_options (question_display_options $options)
 Adjust this display options according to the hint settings.
 

Static Public Member Functions

static load_from_record ($row)
 Create a basic hint from a row loaded from the question_hints table in the database.
 

Public Attributes

boolean $clearwrong
 option to clear the parts of the question that were wrong on retry.
 
string $hint
 The feedback hint to be shown.
 
integer $hintformat
 The corresponding text FORMAT_... type.
 
integer $id
 The hint id.
 
boolean $shownumcorrect
 option to show the number of sub-parts of the question that were right.
 

Detailed Description

An extension of question_hint for questions like match and multiple choice with multile answers, where there are options for whether to show the number of parts right at each stage, and to reset the wrong parts.

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

Constructor & Destructor Documentation

◆ __construct()

question_hint_with_parts::__construct ( $id,
$hint,
$hintformat,
$shownumcorrect,
$clearwrong )

Constructor.

Parameters
intthe hint id from the database.
string$hintThe hint text
intthe corresponding text FORMAT_... type.
bool$shownumcorrectwhether the number of right parts should be shown
bool$clearwrongwhether the wrong parts should be reset.

Member Function Documentation

◆ adjust_display_options()

question_hint_with_parts::adjust_display_options ( question_display_options $options)

Adjust this display options according to the hint settings.

Parameters
question_display_options$options

Reimplemented from question_hint.

◆ load_from_record()

static question_hint_with_parts::load_from_record ( $row)
static

Create a basic hint from a row loaded from the question_hints table in the database.

Parameters
object$rowwith $row->hint, ->shownumcorrect and ->clearwrong set.
Return values
question_hint_with_parts

Reimplemented from question_hint.

Reimplemented in question_hint_ddmarker.


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