Drop down form element to select the grade.
More...
|
| __construct ($elementname=null, $elementlabel=null, $options=array(), $attributes=null) |
| Constructor.
|
|
| _createElements () |
| Create elements for this group.
|
|
| accept (&$renderer, $required=false, $error=null) |
| Accepts a renderer.
|
|
| createFormElement () |
| Creates an element to add to the group Expects the same arguments as MoodleQuickForm\createElement()
|
|
| export_for_template (renderer_base $output) |
| Function to export the renderer data in a format that is suitable for a mustache template.
|
|
| exportValue (&$submitvalues, $notused=false) |
| Calculate the output value for the element as a whole.
|
|
| getAttributesForFormElement () |
| Return attributes suitable for passing to {.
|
|
| getElementTemplateType () |
| Returns element template, nodisplay/static/fieldset.
|
|
string | getHelpButton () |
| template type, would cause problems with client side validation so will leave for now
|
|
| MoodleQuickForm_group ($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName=true) |
| Old syntax of class constructor.
|
|
| MoodleQuickForm_modgrade ($elementname=null, $elementlabel=null, $options=array(), $attributes=null) |
| Old syntax of class constructor.
|
|
| onQuickFormEvent ($event, $arg, &$caller) |
| Called by HTML_QuickForm whenever form event is made on this element.
|
|
| setElements ($elements) |
| Sets the grouped elements and hides label.
|
|
| setHiddenLabel ($hiddenLabel) |
| Sets label to be hidden.
|
|
| setMoodleForm ($mform) |
| Stores the form this element was added to This object is later used by MoodleQuickForm_group::createElement().
|
|
| validateSubmitValue ($values) |
| Calls the validateSubmitValue function for the containing elements and returns an error string as soon as it finds one.
|
|
|
string | $_helpbutton ='' |
| html for help button, if empty then no help
|
|
boolean | $canrescale = false |
| $canrescale Does this activity support rescaling grades?
|
|
float | $currentgrade = false |
| $currentgrade The current grademax for the grade_item
|
|
string | $currentgradetype = 'none' |
| $currentgradetype The current gradetype - can either be 'none', 'scale', or 'point'
|
|
int | $currentscaleid = null |
| $currentscaleid The current scale id
|
|
boolean | $hasgrades = false |
| $hasgrades Has this grade_item got any real grades (with values)
|
|
boolean | $isupdate = false |
| $isupdate Is this an add or an update ?
|
|
boolean | $useratings = false |
| $useratings Set to true if the activity is using ratings, false otherwise
|
|
|
| generate_modgrade_subelement_id ($subname) |
| Generates the id attribute for the subelement of the modgrade group.
|
|
| process_value ($type='none', $scale=null, $point=null, $rescalegrades=null) |
| Process the value for the group based on the selected grade type, and the input for the scale and point elements.
|
|
| validate_point ($val) |
| Determines whether a given value is a valid point selection.
|
|
| validate_scale ($val) |
| Determines whether a given value is a valid scale selection.
|
|
|
bool | $_hiddenLabel = false |
| if true label will be hidden.
|
|
MoodleQuickForm | $_mform = null |
|
| $_renderedfromtemplate = false |
|
Drop down form element to select the grade.
HTML class for a drop down element to select the grade for an activity, used in mod update form
- Copyright
- 2006 Jamie Pratt me@ja.nosp@m.miep.nosp@m..org
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
MoodleQuickForm_modgrade::__construct |
( |
| $elementname = null, |
|
|
| $elementlabel = null, |
|
|
| $options = array(), |
|
|
| $attributes = null ) |
Constructor.
- Parameters
-
string | $elementname | Element's name |
mixed | $elementlabel | Label(s) for an element |
array | $options | Options to control the element's display. Required - must contain the following options: 'isupdate' - is this a new module or are we editing an existing one? 'currentgrade' - the current grademax in the database for this gradeitem 'hasgrades' - whether or not the grade_item has existing grade_grades 'canrescale' - whether or not the activity supports rescaling grades |
mixed | $attributes | Either a typical HTML attribute string or an associative array |
◆ accept()
MoodleQuickForm_group::accept |
( |
& | $renderer, |
|
|
| $required = false, |
|
|
| $error = null ) |
|
inherited |
◆ export_for_template()
MoodleQuickForm_group::export_for_template |
( |
renderer_base | $output | ) |
|
|
inherited |
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.
Reimplemented in MoodleQuickForm_date_selector, and MoodleQuickForm_date_time_selector.
◆ exportValue()
MoodleQuickForm_modgrade::exportValue |
( |
& | $submitvalues, |
|
|
| $notused = false ) |
Calculate the output value for the element as a whole.
- Parameters
-
array | $submitvalues | The incoming values from the form. |
bool | $notused | Not used. |
- Return values
-
array | Return value for the element, formatted like field name => value. |
◆ generate_modgrade_subelement_id()
MoodleQuickForm_modgrade::generate_modgrade_subelement_id |
( |
| $subname | ) |
|
|
protected |
Generates the id attribute for the subelement of the modgrade group.
Uses algorithm similar to what HTML_QuickForm_element::_generateId() does but takes the name of the wrapping modgrade group into account.
- Parameters
-
string | $subname | the name of the HTML_QuickForm_element in this modgrade group |
- Return values
-
◆ getAttributesForFormElement()
MoodleQuickForm_group::getAttributesForFormElement |
( |
| ) |
|
|
inherited |
Return attributes suitable for passing to {.
- See also
- createFormElement}, comprised of all group attributes without ID in order to ensure uniqueness of that value within the group
- Return values
-
◆ getElementTemplateType()
MoodleQuickForm_group::getElementTemplateType |
( |
| ) |
|
|
inherited |
Returns element template, nodisplay/static/fieldset.
- Return values
-
◆ getHelpButton()
string MoodleQuickForm_group::getHelpButton |
( |
| ) |
|
|
inherited |
template type, would cause problems with client side validation so will leave for now
set html for help button
◆ MoodleQuickForm_group()
MoodleQuickForm_group::MoodleQuickForm_group |
( |
| $elementName = null, |
|
|
| $elementLabel = null, |
|
|
| $elements = null, |
|
|
| $separator = null, |
|
|
| $appendName = true ) |
|
inherited |
◆ MoodleQuickForm_modgrade()
MoodleQuickForm_modgrade::MoodleQuickForm_modgrade |
( |
| $elementname = null, |
|
|
| $elementlabel = null, |
|
|
| $options = array(), |
|
|
| $attributes = null ) |
◆ onQuickFormEvent()
MoodleQuickForm_modgrade::onQuickFormEvent |
( |
| $event, |
|
|
| $arg, |
|
|
& | $caller ) |
Called by HTML_QuickForm whenever form event is made on this element.
- Parameters
-
string | $event | Name of event |
mixed | $arg | event arguments |
MoodleQuickForm | $caller | calling object |
- Return values
-
Reimplemented from MoodleQuickForm_group.
◆ process_value()
MoodleQuickForm_modgrade::process_value |
( |
| $type = 'none', |
|
|
| $scale = null, |
|
|
| $point = null, |
|
|
| $rescalegrades = null ) |
|
protected |
Process the value for the group based on the selected grade type, and the input for the scale and point elements.
- Parameters
-
string | $type | The value of the grade type select box. Can be 'none', 'scale', or 'point' |
string | int | $scale | The value of the scale select box. |
string | int | $point | The value of the point grade textbox. |
string | $rescalegrades | The value of the rescalegrades select. |
- Return values
-
◆ setElements()
MoodleQuickForm_group::setElements |
( |
| $elements | ) |
|
|
inherited |
Sets the grouped elements and hides label.
- Parameters
-
◆ setHiddenLabel()
MoodleQuickForm_group::setHiddenLabel |
( |
| $hiddenLabel | ) |
|
|
inherited |
Sets label to be hidden.
- Parameters
-
bool | $hiddenLabel | sets if label should be hidden |
◆ setMoodleForm()
MoodleQuickForm_group::setMoodleForm |
( |
| $mform | ) |
|
|
inherited |
◆ validate_point()
MoodleQuickForm_modgrade::validate_point |
( |
| $val | ) |
|
|
protected |
Determines whether a given value is a valid point selection.
- Parameters
-
string | int | $val | The value to test. |
- Return values
-
◆ validate_scale()
MoodleQuickForm_modgrade::validate_scale |
( |
| $val | ) |
|
|
protected |
Determines whether a given value is a valid scale selection.
- Parameters
-
string | int | $val | The value to test. |
- Return values
-
◆ validateSubmitValue()
MoodleQuickForm_group::validateSubmitValue |
( |
| $values | ) |
|
|
inherited |
Calls the validateSubmitValue function for the containing elements and returns an error string as soon as it finds one.
- Parameters
-
array | $values | Values of the containing elements. |
- Return values
-
string|null | Validation error message or null. |
Reimplemented in MoodleQuickForm_filetypes.
The documentation for this class was generated from the following file: