In Workplace we are currently using a modified version of the core function get_course_progress_percentage() in completion/classes/progress.php to calculate the progress of the program courses. The problem we are having now is that some changes were made in core (
MDL-64889) and we are getting some inconsistent results and we want to use the core function directly but we would need to change how this percentage is calculated. For example, in the case where all activities are completed but there is some condition completion that still prevents the course to be completed (like if we set a condition of enrolment duration), this function returns 100% letting us think the course is completed when is not. In this case, where the course is not completed but all activities are completed, we would like to drop a little bit the progress percentage and return 95%.