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.

The form used at the guide editor page is defined here

Copyright: 2012 Dan Marsden <dan@danmarsden.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 223 lines (9 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 1 file
 grade/grading/form/guide/guideeditor.php

Defines 1 class

gradingform_guide_editguide:: (6 methods):
  definition()
  definition_after_data()
  validation()
  get_data()
  need_confirm_regrading()
  findbutton()


Class: gradingform_guide_editguide  - X-Ref

Defines the guide edit form

definition()   X-Ref
Form element definition


definition_after_data()   X-Ref
Setup the form depending on current values. This method is called after definition(),
data submission and set_data().
All form setup that is dependent on form values should go in here.

We remove the element status if there is no current status (i.e. guide is only being created)
so the users do not get confused

validation($data, $files)   X-Ref
Form vlidation.
If there are errors return array of errors ("fieldname"=>"error message"),
otherwise true if ok.

param: array $data array of ("fieldname"=>value) of submitted data
param: array $files array of uploaded files "element_name"=>tmp_file_path
return: array of "element_name"=>"error_description" if there are errors,

get_data()   X-Ref
Return submitted data if properly submitted or returns NULL if validation fails or
if there is no submitted data.

return: object submitted data; NULL if not valid or not submitted or cancelled

need_confirm_regrading($controller)   X-Ref
Check if there are changes in the guide and it is needed to ask user whether to
mark the current grades for re-grading. User may confirm re-grading and continue,
return to editing or cancel the changes

param: gradingform_guide_controller $controller

findbutton($elementname)   X-Ref
Returns a form element (submit button) with the name $elementname

param: string $elementname
return: HTML_QuickForm_element