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

Assignment has self assessments or due date has passed

Error message

Assignment has self assessments or due date has passed

What it means

SetRubricSelfAssessment raises this GraphQL::ExecutionError when assignment.can_update_rubric_self_assessment? returns false (app/graphql/mutations/set_rubric_self_assessment.rb:54). This means the assignment already has student self assessments recorded, or its due date has passed — both of which make the setting no longer editable.

Solutions

  1. Toggle self assessment only before the assignment due date and before any self assessments exist.
  2. Check assignment.can_update_rubric_self_assessment? / due date client-side before calling the mutation.
  3. Disable or lock the UI toggle once due date passes or submissions exist.
  4. Contact an admin or use course-level tooling if a deadline extension is appropriate, then retry.

Example fix

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

Strategy: validation

Validate before calling

if (!assignment.canUpdateRubricSelfAssessment) throw new SkipMutation('self assessments exist or due date passed')

Try / catch

try { await mutate(...) } catch (e) { if (e.message.includes('due date has passed')) showLockedNotice(); else throw e; }

Prevention

When it happens

Trigger: Invoking the setRubricSelfAssessment mutation on an assignment that already has rubric self assessments submitted by students, or whose due date is in the past, while all earlier validation (permissions, group/quiz/discussion type) passes.

Common situations: Teacher tries to disable self assessment after students already submitted one; user attempts the change after the semester/due date ended; importing or copying settings from a template assignment that already has self assessments.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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

Appendix: source

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

      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
      raise GraphQL::ExecutionError, "#{e.model} not found"
    end
  end
end

View on GitHub (pinned to 1c9f0bb801)