Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 39 and 400]

Defines the editing form for the numerical question type.

Copyright: 2007 Jamie Pratt me@jamiep.org
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 399 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: qtype_numerical_edit_form  - X-Ref

numerical editing form definition.

definition_inner($mform)   X-Ref
No description

get_per_answer_fields($mform, $label, $gradeoptions,&$repeatedoptions, &$answersoption)   X-Ref
No description

get_more_choices_string()   X-Ref
No description

add_unit_options($mform)   X-Ref
Add the unit handling options to the form.

param: object $mform the form being built.

add_unit_fields($mform)   X-Ref
Add the input areas for each unit.

param: object $mform the form being built.

unit_group($mform)   X-Ref
Get the form fields needed to edit one unit.

return: array of form fields.
param: MoodleQuickForm $mform the form being built.

data_preprocessing($question)   X-Ref
No description

data_preprocessing_answers($question, $withanswerfiles = false)   X-Ref
No description

data_preprocessing_units($question)   X-Ref
Perform the necessary preprocessing for the fields added by
{@link add_unit_fields()}.

return: object $question the modified data.
param: object $question the data being passed to the form.

data_preprocessing_unit_options($question)   X-Ref
Perform the necessary preprocessing for the fields added by
{@link add_unit_options()}.

return: object $question the modified data.
param: object $question the data being passed to the form.

validation($data, $files)   X-Ref
No description

validate_answers($data, $errors)   X-Ref
Validate the answers.

return: array the updated errors array.
param: array $data the submitted data.
param: array $errors the errors array to add to.

is_valid_answer($answer, $data)   X-Ref
Validate a particular answer.

return: bool whether this is a valid answer.
param: string $answer an answer to validate. Known to be non-blank and already trimmed.
param: array $data the submitted data.

valid_answer_message($answer)   X-Ref

return: string erre describing what an answer should be.

validate_numerical_options($data, $errors)   X-Ref
Validate the answers.

return: array the updated errors array.
param: array $data the submitted data.
param: array $errors the errors array to add to.

qtype()   X-Ref
No description