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_quiz meta is not sufficient to determine if a quiz is "real."
- The migration from comments to tables creates quiz progress rows with
passed status 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_submissions table. For comments-based storage, the equivalent is the quiz_answers comment meta.
🤖 Generated with Claude Code
Problem
The Grading page shows rows for lessons where there is nothing to grade. This includes:
This affects both comments-based and tables-based (HPPS) storage.
Expected behavior
Rows should only appear on the Grading page when:
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
_lesson_quizmeta is not sufficient to determine if a quiz is "real."passedstatus for completed lessons even when the quiz has no questions, leading to phantom graded rows.wp_sensei_lms_quiz_submissionstable. For comments-based storage, the equivalent is thequiz_answerscomment meta.🤖 Generated with Claude Code