Skip to content

Certificates auto-issue on 100% lesson progress, ignoring assignment submission and grading #1149

Description

@jeromehardaway

Problem

A course certificate is auto-generated the moment lesson progress hits 100% — with no check that the course's assignments were submitted or graded.

In src/pages/api/lms/progress/index.ts, completion is computed purely from lessons:

progressPercentage = round(completedLessons / totalLessons * 100)
isComplete = progressPercentage === 100
// → on transition to COMPLETED, generate certificate number, render PDF,
//   upload, create Certificate row, email the user

Assignments (Assignment / Submission models) are never consulted. A veteran can mark every lesson complete, submit zero assignments, and still receive a verifiable VWC certificate.

Why it matters

For a software engineering accelerator, the certificate should attest to demonstrated, graded work — not just content consumption. Issuing it on lesson-views-only weakens the credential and the verification feature (see related cert-verification bug). It also undercuts the assignment → submission → grading loop that already exists (src/pages/api/lms/submissions/**, .../[submissionId]/grade.ts).

Decision to make

Define real completion criteria. Options:

  • Require all required assignments to be GRADED (and optionally meeting a minimum score) before a course is COMPLETED and a certificate issues.
  • Mark some assignments required vs optional (add a flag to Assignment if not present) so completion gates on required ones only.
  • Keep lesson progress for the progress bar, but gate COMPLETED/certificate on assignments.

Proposed implementation

  1. In src/pages/api/lms/progress/index.ts, before setting COMPLETED/issuing a cert, query the course's required assignments and the user's submissions; only complete when all required submissions exist and are GRADED (and ≥ passing score, if defined).
  2. Surface remaining requirements to the learner ("2 assignments left to graduate this course").
  3. Add tests for: lessons-100%-but-assignments-pending → not completed, no cert; all requirements met → completed + cert.

Acceptance criteria

  • Certificate cannot be issued for a course with ungraded/missing required assignments.
  • Learner can see what remains before completion.
  • Tests cover both paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementintermediateRequires moderate codebase familiarity; multi-file or design judgment

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions