-
Notifications
You must be signed in to change notification settings - Fork 212
Grading page: hide rows for lessons with nothing to grade #7926
Copy link
Copy link
Open
Description
Problem
The Grading page shows rows for lessons where there is nothing to grade. This includes:
- Lessons whose quiz has no questions. These rows show misleading statuses (e.g. "Passed" with a "Review Grade" button that opens an empty quiz) and inflate the Graded count.
- Lessons where the student never submitted the quiz. There are no answers to review or grade.
This affects both comments-based and tables-based (HPPS) storage.
Expected behavior
Rows should only appear on the Grading page when:
- The student has actually submitted the quiz (quiz answers / submission exists), OR
- There is otherwise something meaningful to review.
Important edge case
If a quiz had questions at one point and a student submitted answers, but the questions were later removed, the submission data still exists and the "Review Grade" page can still show the historical answers. These rows should NOT be excluded — there is still something to review. The filtering should be based on whether a submission/answers exist, not on the current question count alone.
Context
- Every lesson in Sensei auto-creates a quiz post, so checking for
_lesson_quizmeta is not sufficient to determine if a quiz is "real." - The migration from comments to tables creates quiz progress rows with
passedstatus for completed lessons even when the quiz has no questions, leading to phantom graded rows. - For tables-based storage, quiz submissions can be checked via the
wp_sensei_lms_quiz_submissionstable. For comments-based storage, the equivalent is thequiz_answerscomment meta.
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels