Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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:
question_hint question_hint_ddmarker

Public Member Functions

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

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. More...
 

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_... More...
 
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.

Reimplemented in question_hint_ddmarker.

◆ 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.

Member Data Documentation

◆ $hintformat

integer question_hint::$hintformat
inherited

The corresponding text FORMAT_...

type.


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