Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
MoodleQuickForm_grading Class Reference
Inheritance diagram for MoodleQuickForm_grading:
templatable

Public Member Functions

 __construct ($elementName=null, $elementLabel=null, $attributes=null)
 Class constructor. More...
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template. More...
 
 get_gradinginstance ()
 Helper function to retrieve gradingform_instance passed in element attributes. More...
 
 getElementTemplateType ()
 The renderer of gradingform_instance will take care itself about different display in normal and frozen states. More...
 
 getHelpButton ()
 get html for help button More...
 
 MoodleQuickForm_grading ($elementName=null, $elementLabel=null, $attributes=null)
 Old syntax of class constructor. More...
 
 onQuickFormEvent ($event, $arg, &$caller)
 Called by HTML_QuickForm whenever form event is made on this element. More...
 
 toHtml ()
 Returns the input field in HTML. More...
 

Static Public Member Functions

static _validate ($elementvalue, $attributes=null)
 Function registered as rule for this element and is called when this element is being validated. More...
 

Public Attributes

string $_helpbutton =''
 html for help button, if empty then no help
 

Constructor & Destructor Documentation

◆ __construct()

MoodleQuickForm_grading::__construct (   $elementName = null,
  $elementLabel = null,
  $attributes = null 
)

Class constructor.

Parameters
string$elementNameInput field name attribute
mixed$elementLabelLabel(s) for the input field
mixed$attributesEither a typical HTML attribute string or an associative array

Member Function Documentation

◆ _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$elementvaluevalue of element to be validated
array$attributeselement attributes
Return values
MoodleQuickForm_grading

◆ 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:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implements templatable.

◆ get_gradinginstance()

MoodleQuickForm_grading::get_gradinginstance ( )

Helper function to retrieve gradingform_instance passed in element attributes.

Return values
gradingform_instance

◆ getElementTemplateType()

MoodleQuickForm_grading::getElementTemplateType ( )

The renderer of gradingform_instance will take care itself about different display in normal and frozen states.

Return values
string

◆ getHelpButton()

MoodleQuickForm_grading::getHelpButton ( )

get html for help button

Return values
stringhtml for help button

◆ MoodleQuickForm_grading()

MoodleQuickForm_grading::MoodleQuickForm_grading (   $elementName = null,
  $elementLabel = null,
  $attributes = null 
)

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ 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$eventName of event
mixed$argevent arguments
object$callercalling object
Return values
bool
Exceptions
moodle_exception

◆ toHtml()

MoodleQuickForm_grading::toHtml ( )

Returns the input field in HTML.

Return values
string

The documentation for this class was generated from the following file: