Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core_grades\output\penalty_indicator Class Reference
Inheritance diagram for core_grades\output\penalty_indicator:
core\output\renderable core\output\templatable

Public Member Functions

 __construct (protected int int $decimals, protected grade_grade grade_grade $grade, protected bool bool $showfinalgrade=false, protected bool bool $showgrademax=false, protected array|null ?array $penaltyicon=null)
 The class constructor.
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template.
 
 get_template ()
 Returns the template for the actions bar.
 

Constructor & Destructor Documentation

◆ __construct()

core_grades\output\penalty_indicator::__construct ( protected int int $decimals,
protected grade_grade grade_grade $grade,
protected bool bool $showfinalgrade = false,
protected bool bool $showgrademax = false,
protected array|null ?array $penaltyicon = null )

The class constructor.

Parameters
int$decimalsthe decimal places
grade_grade$gradeuser grade
bool$showfinalgradewhether to show the final grade (or show icon only)
bool$showgrademaxwhether to show the max grade
array | null$penaltyiconicon to show if penalty is applied
Parameters
$decimals$decimals the decimal places
$grade$grade user grade
$showfinalgrade$showfinalgrade whether to show the final grade (or show icon only)
$showgrademax$showgrademax whether to show the max grade
$penaltyicon$penaltyicon icon to show if penalty is applied

Member Function Documentation

◆ export_for_template()

core_grades\output\penalty_indicator::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 core\output\templatable.

◆ get_template()

core_grades\output\penalty_indicator::get_template ( )

Returns the template for the actions bar.

Return values
string

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