Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9.4
-
Fix Version/s: STABLE backlog
-
Component/s: Gradebook
-
Labels:None
-
Difficulty:Easy
-
Affected Branches:MOODLE_19_STABLE
Description
Once more, the public/private discussion of the gradebook rises...
Until now I was using one combination like this:
$grade_item = grade_get_grades($courseid, 'mod', $module->name, $cm->instance, $userid))
and then, used various calls to:
grade_format_gradevalue($grade, $item, true, GRADE_DISPLAY_TYPE_XXXX, $decimals=2)
to get the grade in various formats (real, %, letter...).
It seems that the grade_format_gradevalue() is private API, so there isn't any way to format grades (in public API) in a consistent way with the gradebook.
After HQ chat, Petr commented the way was to implement that in grade_format_gradevalue() (official public API), so it will return current information + "printable" information.
Perhaps it will need the "localised" and "decimals" parameters (or will apply gradebook settings, not sure). But, in any case, it should return ALSO the formatted grade in the formats (real, percentage, letter...) supported by current grade_format_gradevalue()
Would be great to have that working asap if no complex. Ciao ![]()
it does return "printable" value using gradebook settings, in Certificate mod you wanted percentages too