Skip to content

fix: count Vue-completed exercises in course reporting top students - #9435

Open
mrpythonist wants to merge 1 commit into
chamilo:masterfrom
mrpythonist:fix/top-students-9423
Open

mrpythonist wants to merge 1 commit into
chamilo:masterfrom
mrpythonist:fix/top-students-9423

Conversation

@mrpythonist

Copy link
Copy Markdown

Fixes #9423

What?

In course reports, "Top students" showed 50% progress for a student who completed the whole learning path.

The score is floor((learningPathProgress + exerciseAverage) / 2) in CourseReportingQueryService::getOverview(). The exercise average came from track_e_exercises with status = '' only, which is the legacy finished status.

The current Vue exercise runtime finishes attempts with status = 'completed' (ExerciseRuntimeFinishProcessor), so those attempts were ignored and the average stayed 0: (100 + 0) / 2 = 50.

This changes the filter to status IN ('', 'completed'), the same pair the codebase already uses in ExerciseOverviewProvider and ExerciseRuntimeResultProvider (STATUS_LEGACY_COMPLETED = '').

Why?

A completed exercise should count toward the average whichever runtime finished it. In-progress attempts (status = 'incomplete') are still excluded.

How?

One line in src/CoreBundle/Service/CourseReporting/CourseReportingQueryService.php (loadLearnerMetrics()).

Test

  • php -l on the changed file: no syntax errors.
  • An isolated check of the exact averaging formulas reproduces the reported 50% with the old filter and gives 100% with the new filter for a completed learning path with a completed 10/10 exercise; a legacy '' attempt still counts and an incomplete attempt still does not.
  • Not verified in a running Chamilo install or with PHPUnit/Playwright here, so CI should run those.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Top students" in course reports shows 50% progress for students who completed the course

1 participant