Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

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: 395 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.

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

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()}.

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

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

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

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

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

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

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

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

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.

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

qtype()   X-Ref
No description