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

Cannot set rubric self assessment for group assignments

Error message

Cannot set rubric self assessment for group assignments

What it means

SetRubricSelfAssessment raises this GraphQL::ExecutionError when assignment.has_group_category? is true (app/graphql/mutations/set_rubric_self_assessment.rb:42). Rubric self assessment is not supported for group assignments in Canvas, so the mutation rejects them outright even with correct permissions.

Solutions

  1. Only call this mutation for individual (non-group-category) assignments.
  2. Filter candidate assignments by group_category being absent before batching.
  3. Surface the limitation in the UI instead of sending the mutation for group assignments.
  4. If self assessment is truly needed for group work, restructure the assignment without a group category.

Example fix

// before
const res = await client.mutate({ mutation: SET_SELF_ASSESSMENT, variables: { assignmentId } })
// after
if (!assignment.groupCategoryId) {
  const res = await client.mutate({ mutation: SET_SELF_ASSESSMENT, variables: { assignmentId } })
}
Defensive patterns

Strategy: validation

Validate before calling

if (assignment.groupCategoryId || assignment.hasGroupCategory) throw new SkipMutation('group assignments unsupported')

Try / catch

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

Prevention

When it happens

Trigger: Invoking the setRubricSelfAssessment mutation with an assignment ID whose assignment belongs to a group set (group_category_id is set / has_group_category? returns true), after passing the permission check.

Common situations: Frontend sends an assignment that was converted to a group assignment after page load; admin toggles self assessment on a course where the target assignment is a graded discussion or project using group sets; scripts iterating over many assignments hit the first group-based one.

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/a37c61b4ce02d627. Report an issue: GitHub.

Appendix: source

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

    def resolve(input:)
      assignment = Assignment.find(input[:assignment_id])
      rubric_association = assignment.rubric_association

      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: }

View on GitHub (pinned to 1c9f0bb801)