|
| __construct (public stdClass readonly stdClass $quiz, public float float $grade, public float float $maxgrade, public string|null readonly ?string $name=null, public string readonly string $style=self::NORMAL,) |
| Constructor.
|
|
| get_formatted_values () |
| Get the formatted values to be inserted into the {.
|
|
| get_string_key () |
| Get the lang string to use to display the grade in the requested style.
|
|
| style_formatted_values (stdClass $a) |
| Apply the normal styling to the values returned by {.
|
|
|
string const | NORMAL = 'outof' |
| Indicates we want the default rendering.
|
|
string const | SHORT = 'outofshort' |
| Indicates we want a short rendering.
|
|
string const | WITH_PERCENT = 'outofpercent' |
| like normal, but with the percent equivalent in brackets.
|
|
- Copyright
- 2024 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
mod_quiz\output\grades\grade_out_of::__construct |
( |
public stdClass readonly stdClass | $quiz, |
|
|
public float float | $grade, |
|
|
public float float | $maxgrade, |
|
|
public string|null readonly ?string | $name = null, |
|
|
public string readonly string | $style = self::NORMAL ) |
Constructor.
- Parameters
-
stdClass | $quiz | Quiz settings. |
float | $grade | the mark to show. |
float | $maxgrade | the total to show it out of. |
string | null | $name | optional, a name for what this grade is. |
string | $style | which format to use, grade_out_of\NORMAL (default), SHORT or WITH_PERCENT. |
- Parameters
-
$quiz | Quiz settings (so we can access the settings like decimal places). |
$grade | the grade to show. |
$maxgrade | the total the grade is out of. |
$name | optional, a name for what this grade is. Must be output via format_string. |
$style | The display style, one of the consts above. |
◆ get_formatted_values()
mod_quiz\output\grades\grade_out_of::get_formatted_values |
( |
| ) |
|
Get the formatted values to be inserted into the {.
- See also
- get_string_key()} string placeholders.
Values are not styled. To apply the recommended styling, call {
- See also
- style_formatted_values()}
- Return values
-
stdClass | to be passed as the third argument to get_string(). |
◆ get_string_key()
mod_quiz\output\grades\grade_out_of::get_string_key |
( |
| ) |
|
Get the lang string to use to display the grade in the requested style.
- Return values
-
string | lang string key from the mod_quiz lang pack. |
◆ style_formatted_values()
mod_quiz\output\grades\grade_out_of::style_formatted_values |
( |
stdClass | $a | ) |
|
Apply the normal styling to the values returned by {.
- See also
- get_formatted_values()}.
- Parameters
-
stdClass | $a | formatted values, as returned by get_formatted_values. |
- Return values
-
stdClass | same structure, with some values wrapped in <b> tags. |
◆ NORMAL
string const mod_quiz\output\grades\grade_out_of::NORMAL = 'outof' |
Indicates we want the default rendering.
Also the lang string used.
◆ SHORT
string const mod_quiz\output\grades\grade_out_of::SHORT = 'outofshort' |
Indicates we want a short rendering.
Also the lang string used.
◆ WITH_PERCENT
string const mod_quiz\output\grades\grade_out_of::WITH_PERCENT = 'outofpercent' |
like normal, but with the percent equivalent in brackets.
Also the lang string used
The documentation for this class was generated from the following file:
- mod/quiz/classes/output/grades/grade_out_of.php