Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

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: 310 lines (11 kb)
Included or required:0 times
Referenced: 0 times
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

extra_slot_validation(array $slots, array $choices)   X-Ref
Finds more errors in question slots.

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