instructure/canvas-lms · error · GraphQL::ExecutionError

Cannot set rubric self assessment for quiz assignments

Error message

Cannot set rubric self assessment for quiz assignments

What it means

SetRubricSelfAssessment raises this GraphQL::ExecutionError when assignment.quiz_lti? || assignment.quiz? is true (app/graphql/mutations/set_rubric_self_assessment.rb:46). Quiz assignments (both classic quizzes and New Quizzes/LTI) do not support rubric self assessment, so the mutation blocks them.

Solutions

  1. Only call this mutation for non-quiz assignments; filter out quiz_lti?/quiz? assignments client-side.
  2. Check assignment type via the GraphQL query before sending the mutation.
  3. Hide the self assessment toggle for quiz-type assignments in the UI.
  4. If rubric feedback on quizzes is needed, use quiz-level rubric features instead of self assessment.

Example fix

// before
await client.mutate({ mutation: SET_SELF_ASSESSMENT, variables: { assignmentId } })
// after
if (!assignment.quiz && !assignment.quizLti) {
  await client.mutate({ mutation: SET_SELF_ASSESSMENT, variables: { assignmentId } })
}
Defensive patterns

Strategy: validation

Validate before calling

if (assignment.quiz || assignment.quizLti) throw new SkipMutation('quiz assignments unsupported')

Try / catch

try { await mutate(...) } catch (e) { if (e.message.includes('quiz assignments')) showUnsupportedNotice(); else throw e; }

Prevention

When it happens

Trigger: Invoking the setRubricSelfAssessment mutation with an assignment ID that wraps a classic quiz (assignment.quiz? true) or a New Quizzes LTI assignment (assignment.quiz_lti? true).

Common situations: Course redesign tool iterates all assignments including quiz-backed ones; user toggles self assessment from an assignment index that does not filter quiz types; an assignment is converted to a quiz after self assessment was enabled.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/set_rubric_self_assessment.rb:46

      unless Rubric.rubric_self_assessment_enabled?(assignment.course)
        raise GraphQL::ExecutionError, "enhanced_rubrics, rubric_self_assesment and assignments_2_student must be enabled"
      end

      unless assignment.active_rubric_association?
        raise GraphQL::ExecutionError, I18n.t("Rubric Association not found")
      end

      unless rubric_association.grants_right?(current_user, session, :update)
        raise GraphQL::ExecutionError, I18n.t("Insufficient permissions")
      end

      if assignment.has_group_category?
        raise GraphQL::ExecutionError, I18n.t("Cannot set rubric self assessment for group assignments")
      end

      if assignment.quiz_lti? || assignment.quiz?
        raise GraphQL::ExecutionError, I18n.t("Cannot set rubric self assessment for quiz assignments")
      end

      if assignment.discussion_topic?
        raise GraphQL::ExecutionError, I18n.t("Cannot set rubric self assessment for discussion assignments")
      end

      unless assignment.can_update_rubric_self_assessment?
        raise GraphQL::ExecutionError, I18n.t("Assignment has self assessments or due date has passed")
      end

      rubric_self_assessment_enabled = input[:rubric_self_assessment_enabled]

      if assignment.update(rubric_self_assessment_enabled:)
        { rubric_self_assessment_enabled: }
      else
        errors_for(assignment)
      end
    rescue ActiveRecord::RecordNotFound => e

View on GitHub (pinned to 1c9f0bb801)