instructure/canvas-lms · error · ActiveRecord::RecordNotFound

Quiz Submission not found

Error message

Quiz Submission not found

What it means

Guard in Filters::QuizSubmissions#require_quiz_submission: no Quizzes::QuizSubmission matches the id (or 'self' → current user) in the quiz/course scope. Raised for any route requiring a quiz submission; 'not_settings_only' also excludes settings-only submissions.

Solutions

  1. Check the quiz_submission_id/id param and that the submission belongs to the requested quiz and user
  2. Ensure the user actually took the quiz (a submission exists) before calling quiz-submission endpoints
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/controllers/filters/quiz_submissions.rb:48 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15). Data as JSON: /api/errors/3b5facf854a4ab01. Report an issue: GitHub.

Appendix: source

Thrown at app/controllers/filters/quiz_submissions.rb:48

    scope = @quiz ? @quiz.quiz_submissions : Quizzes::QuizSubmission
    id = if params.key?(:quiz_submission_id)
           params[:quiz_submission_id]
         else
           params[:id]
         end

    if active
      scope = scope.not_settings_only
    end

    if id.to_s == "self"
      query[:user_id] = @current_user
    else
      query[:id] = id.to_i
    end

    unless (@quiz_submission = scope.where(query).first)
      raise ActiveRecord::RecordNotFound, "Quiz Submission not found"
    end

    @quiz_submission.ensure_question_reference_integrity!
    @quiz_submission
  end

  def require_active_quiz_submission
    require_quiz_submission(active: true)
  end

  def retrieve_quiz_submission_attempt!(attempt)
    unless (@quiz_submission = @quiz_submission.model_for_attempt(attempt.to_i))
      raise ActiveRecord::RecordNotFound, "Unable to find a submission with that attempt"
    end
  end

  def prepare_service
    participant = Quizzes::QuizParticipant.new(@current_user, temporary_user_code)

View on GitHub (pinned to 1c9f0bb801)