You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scope student progress to the current course links. - #318
The instructor student-progress page joined lti_result on user id, so each enrolled student pulled every result on the site. On py4e that query reached 102 seconds.
Aggregate completion and last activity from the links in this course, and start the discussion counts from those links too. STRAIGHT_JOIN keeps MySQL on the link index.
Last activity is the newest result in this course, or the membership timestamp when the student has none here. Completion is still a distinct lesson link at 80% or higher.
Test plan
As an instructor, open /grades/student-progress and confirm the roster, completion percentages, and discussion counts.
Search by name or email, and sort by last activity and progress.
Confirm a student with no grades in this course still appears, with last activity taken from the membership row.
Summary by CodeRabbit
Refactor
Updated the calculation of student progress, assignment completion, and discussion activity. Existing progress percentages, completion thresholds, and discussion counts remain unchanged. No new user-facing features or changes to displayed results are included.
The roster query joined every result for each student, so a course page scanned the whole result table.
Co-authored-by: Cursor <cursoragent@cursor.com>
Reviewing files that changed from the base of the PR and between ce3351e and 7e2b92a.
Files selected for processing: 1
lib/src/Controllers/Grades.php
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
Walkthrough
Grades::studentProgress now calculates discussion counts from course links and uses a per-student aggregate for assignment activity and progress values.
A per-student subquery aggregates latest result times and completed assignments. The outer query uses those values for progress and filters out deleted memberships.
tsugiproject/tsugi#302: Limits first-visit discussion read-baseline queries to the current course.
Merge Risk: Minimal · up to 7e2b9
No actionable merge-blocking issue was established. The roster query appears ready to merge after normal checks.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: limiting student-progress calculations to links in the current course.
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ast-grep (0.50.0)
lib/src/Controllers/Grades.php
ast-grep output exceeded the maximum buffer for this file
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lti_resulton user id, so each enrolled student pulled every result on the site. On py4e that query reached 102 seconds.STRAIGHT_JOINkeeps MySQL on the link index.Test plan
/grades/student-progressand confirm the roster, completion percentages, and discussion counts.Summary by CodeRabbit