Advance grading form element.
More...
|
static | _validate ($elementvalue, $attributes=null) |
| Function registered as rule for this element and is called when this element is being validated.
|
|
|
string | $_helpbutton ='' |
| html for help button, if empty then no help
|
|
Advance grading form element.
HTML class for a grading element. This is a wrapper for advanced grading plugins. When adding the 'grading' element to the form, developer must pass an object of class gradingform_instance as $attributes['gradinginstance']. Otherwise an exception will be thrown. This object is responsible for implementing functions to render element html and validate it
- Copyright
- 2011 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
MoodleQuickForm_grading::__construct |
( |
| $elementName = null, |
|
|
| $elementLabel = null, |
|
|
| $attributes = null ) |
Class constructor.
- Parameters
-
string | $elementName | Input field name attribute |
mixed | $elementLabel | Label(s) for the input field |
mixed | $attributes | Either a typical HTML attribute string or an associative array |
◆ _validate()
static MoodleQuickForm_grading::_validate |
( |
| $elementvalue, |
|
|
| $attributes = null ) |
|
static |
Function registered as rule for this element and is called when this element is being validated.
This is a wrapper to pass the validation to the method gradingform_instance\validate_grading_element
- Parameters
-
mixed | $elementvalue | value of element to be validated |
array | $attributes | element attributes |
- Return values
-
◆ export_for_template()
MoodleQuickForm_grading::export_for_template |
( |
renderer_base | $output | ) |
|
Function to export the renderer data in a format that is suitable for a mustache template.
This means:
- No complex types - only stdClass, array, int, string, float, bool
- Any additional info that is required for the template is pre-calculated (e.g. capability checks).
- Parameters
-
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
- Return values
-
Implements templatable.
◆ get_gradinginstance()
MoodleQuickForm_grading::get_gradinginstance |
( |
| ) |
|
◆ getElementTemplateType()
MoodleQuickForm_grading::getElementTemplateType |
( |
| ) |
|
The renderer of gradingform_instance will take care itself about different display in normal and frozen states.
- Return values
-
◆ getHelpButton()
MoodleQuickForm_grading::getHelpButton |
( |
| ) |
|
get html for help button
- Return values
-
string | html for help button |
◆ MoodleQuickForm_grading()
MoodleQuickForm_grading::MoodleQuickForm_grading |
( |
| $elementName = null, |
|
|
| $elementLabel = null, |
|
|
| $attributes = null ) |
◆ onQuickFormEvent()
MoodleQuickForm_grading::onQuickFormEvent |
( |
| $event, |
|
|
| $arg, |
|
|
& | $caller ) |
Called by HTML_QuickForm whenever form event is made on this element.
Adds necessary rules to the element and checks that coorenct instance of gradingform_instance is passed in attributes
- Parameters
-
string | $event | Name of event |
mixed | $arg | event arguments |
object | $caller | calling object |
- Return values
-
- Exceptions
-
◆ toHtml()
MoodleQuickForm_grading::toHtml |
( |
| ) |
|
Returns the input field in HTML.
- Return values
-
The documentation for this class was generated from the following file: