Commit graph

12 commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
e2821bf1ce MDL-73824 gradebook: Stricter float check to some gradelib functions
It has been detected that, right now, some localised floats are
being passed to those functions (say comma separator, say thousands)
and that's leading to all sort of problems later when comparing,
processing or storing those "wrong-floats" (user entered).

This just makes all those functions to be stricter, so any attempt
of passing to them a wrong float will fail with a clear TypeError.

Any existing case must be converted to a corrrect (X.Y) format, using
unformat_float() or PARAM_LOCALISEDFLOAT before any processing.

Localised floats cannot be used.

Also, fix all the places where those functions are called from
files having strict_types enabled because, with that, now float-like
strings are not accepted any more. Luckily, there is only case,
within the grade/classes/component_gradeitem.php file, and it has
been fixed by casting the float-like string coming from DB to float.
2022-03-03 12:19:02 +01:00
Mark Nelson
85eda546b3 MDL-71439 core_grades: add new method 'get_formatted_grade_for_user' 2021-10-27 12:19:31 +08:00
Mark Nelson
581bc8d6b4 MDL-71439 core_grades: fixed undefined class issues 2021-10-27 12:19:31 +08:00
Mark Nelson
2e1c282ef6 MDL-71439 core_grades: remove returning null when not possible
The method explicitly declares 'stdClass' as the return type.
2021-10-27 12:19:31 +08:00
Mathew May
07d8669dbf MDL-66906 mod_forum: Show learners their grades in a Modal 2019-11-12 16:17:04 +08:00
Simey Lameze
175fd687b4 MDL-66360 grade: fix user grade notification sending errors 2019-11-11 15:37:19 +08:00
Shamim Rezaie
9672c8aa08 MDL-66360 core_grade: New method to send grade notifications to students 2019-11-11 15:16:19 +08:00
Mathew May
63cd8d45db MDL-66958 core_grade: Add grade status abstract
Also implement the new abstract in Forum
2019-11-11 11:25:17 +08:00
Mathew May
9f1195fa66 MDL-66074 core_grade: Documentation 2019-10-30 13:03:59 +08:00
Andrew Nicols
ce1c470167 MDL-66841 forum: Display grade update errors to user
Part of MDL-66074

This change modifies the return val for all of the grading functions to
allow them to add additional information.
This means that a grading service can suppress a Grade saved message if
there were no changes, for example.

This also adds a distinction between:
- Errored (Exception thrown in the WS call)
- Failed (Warning in the output of the WS call)
- Success (Grade actually saved)
- None of the above (No save, no fail, no change)
2019-10-30 10:23:41 +08:00
Andrew Nicols
b253a4f21d MDL-66809 core_grades: Implement scale-based marking
Part of MDL-66074
2019-10-30 10:23:41 +08:00
Andrew Nicols
f8da1b9353 MDL-66722 forum: Add gradeitem storage handler
Part of MDL-66074
2019-10-30 10:23:40 +08:00