Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Base class for editing form for the drag-and-drop images onto images question type.

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

Defines 1 class

qtype_ddtoimage_edit_form_base:: (5 methods):
  file_picker_options()
  definition_inner()
  definition_drop_zones()
  get_drag_item_repeats()
  file_uploaded()


Class: qtype_ddtoimage_edit_form_base  - X-Ref

Base class for drag-and-drop onto images editing form definition.

file_picker_options()   X-Ref
Options shared by all file pickers in the form.

return: array Array of filepicker options.

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

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

definition_drop_zones($mform, $imagerepeats)   X-Ref
Make and add drop zones to the form.

param: object $mform The Moodle form object.
param: int $imagerepeats The initial number of repeat elements.

get_drag_item_repeats()   X-Ref
Returns an array of starting number of repeats, and the total number of repeats.

return: array

file_uploaded($draftitemid)   X-Ref
Checks to see if a file has been uploaded.

param: string $draftitemid The draft id
return: bool True if files exist, false if not.