Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Base class for editing question types like this one.

Copyright: 2011 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 308 lines (11 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class


Class: qtype_gapselect_edit_form_base  - X-Ref

Elements embedded in question text editing form definition.

get_illegal_tag_error($text)   X-Ref
Vaidate some input to make sure it does not contain any tags other than
$this->allowedhtmltags.

param: string $text the input to validate.
return: string any validation errors.

allowed_tags_message($badtag)   X-Ref
Returns a message indicating what tags are allowed.

param: string $badtag The disallowed tag that was supplied
return: string Message indicating what tags are allowed

get_list_of_printable_allowed_tags($allowedhtmltags)   X-Ref
Returns a prinatble list of allowed HTML tags.

param: array $allowedhtmltags An array for tag strings that are allowed
return: string A printable list of tags

definition_inner($mform)   X-Ref
definition_inner adds all specific fields to the form.

param: object $mform (the form being built).

definition_answer_choice(&$mform)   X-Ref
Defines form elements for answer choices.

param: object $mform The Moodle form object being built

get_maximum_choice_group_number()   X-Ref
Return how many different groups of choices there should be.

return: int the maximum group number.

choice_group($mform)   X-Ref
Creates an array with elements for a choice group.

param: object $mform The Moodle form we are working with
param: int $maxgroup The number of max group generate element select.
return: array Array for form elements

repeated_options()   X-Ref
Returns an array for form repeat options.

return: array Array of repeate options

data_preprocessing($question)   X-Ref
No description

data_preprocessing_choice($question, $answer, $key)   X-Ref
No description

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

validate_slots($questiontext, $choices)   X-Ref
Finds errors in question slots.

param: string $questiontext The question text
param: array $choices Question choices
return: string|bool Error message or false if no errors

qtype()   X-Ref
No description