Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
qtype_calculated_question_with_expressions Interface Reference

This interface defines the method that a quetsion type must implement if it is to work with qtype_calculated_question_helper. More...

Inheritance diagram for qtype_calculated_question_with_expressions:
qtype_calculated_question qtype_calculatedmulti_multi_question qtype_calculatedmulti_single_question qtype_calculatedsimple_question

Public Member Functions

 calculate_all_expressions ()
 Replace all the expression in the question definition with the values computed from the selected dataset by calling $this->vs->calculate() and $this->vs->replace_expressions_in_text() on the parts of the question that require it.
 

Detailed Description

This interface defines the method that a quetsion type must implement if it is to work with qtype_calculated_question_helper.

As well as this method, the class that implements this interface must have fields public $datasetloader; // of type qtype_calculated_dataset_loader public $vs; // of type qtype_calculated_variable_substituter

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

Member Function Documentation

◆ calculate_all_expressions()

qtype_calculated_question_with_expressions::calculate_all_expressions ( )

Replace all the expression in the question definition with the values computed from the selected dataset by calling $this->vs->calculate() and $this->vs->replace_expressions_in_text() on the parts of the question that require it.

Implemented in qtype_calculated_question, qtype_calculatedmulti_multi_question, and qtype_calculatedmulti_single_question.


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