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 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

The form used at the rubric editor page is defined here

Copyright: 2011 Marina Glancy <marina@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 217 lines (9 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 1 file
 grade/grading/form/rubric/rubriceditor.php

Defines 1 class

gradingform_rubric_editrubric:: (6 methods):
  definition()
  definition_after_data()
  validation()
  get_data()
  need_confirm_regrading()
  findButton()


Class: gradingform_rubric_editrubric  - X-Ref

Defines the rubric 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. rubric 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 rubric 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_rubric_controller $controller

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

param: string $elementname
return: HTML_QuickForm_element