Problem/Motivation
Drupal\moodle_rest\Services\RestFunctions::getCourseCompletionPercentage() often returns a float when an integer is specified by the return type.
Steps to reproduce
Fetching course completion for any incomplete course with completion criteria.
Proposed resolution
Round and cast to int? Or update the return type to float? Probably should round either way.
Remaining tasks
Patch incoming.
User interface changes
None.
API changes
None (or return type if that's preferred).
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | course-completion-3245696-2.patch | 676 bytes | jacktonkin |
Comments
Comment #2
jacktonkin commentedPatch also returns NULL if there are no activities to avoid divide-by-zero warning.
Comment #4
ekes commentedMakes sense to me, and follows the actual return pattern.
Committed.