{"record":{"id":"a37c61b4ce02d627","repo":"instructure/canvas-lms","slug":"cannot-set-rubric-self-assessment-for-group-assignments","errorCode":null,"errorMessage":"Cannot set rubric self assessment for group assignments","messagePattern":"Cannot set rubric self assessment for group assignments","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/set_rubric_self_assessment.rb","lineNumber":42,"sourceCode":"\n    def resolve(input:)\n      assignment = Assignment.find(input[:assignment_id])\n      rubric_association = assignment.rubric_association\n\n      unless Rubric.rubric_self_assessment_enabled?(assignment.course)\n        raise GraphQL::ExecutionError, \"enhanced_rubrics, rubric_self_assesment and assignments_2_student must be enabled\"\n      end\n\n      unless assignment.active_rubric_association?\n        raise GraphQL::ExecutionError, I18n.t(\"Rubric Association not found\")\n      end\n\n      unless rubric_association.grants_right?(current_user, session, :update)\n        raise GraphQL::ExecutionError, I18n.t(\"Insufficient permissions\")\n      end\n\n      if assignment.has_group_category?\n        raise GraphQL::ExecutionError, I18n.t(\"Cannot set rubric self assessment for group assignments\")\n      end\n\n      if assignment.quiz_lti? || assignment.quiz?\n        raise GraphQL::ExecutionError, I18n.t(\"Cannot set rubric self assessment for quiz assignments\")\n      end\n\n      if assignment.discussion_topic?\n        raise GraphQL::ExecutionError, I18n.t(\"Cannot set rubric self assessment for discussion assignments\")\n      end\n\n      unless assignment.can_update_rubric_self_assessment?\n        raise GraphQL::ExecutionError, I18n.t(\"Assignment has self assessments or due date has passed\")\n      end\n\n      rubric_self_assessment_enabled = input[:rubric_self_assessment_enabled]\n\n      if assignment.update(rubric_self_assessment_enabled:)\n        { rubric_self_assessment_enabled: }","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/set_rubric_self_assessment.rb#L24-L60","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Only call this mutation for individual (non-group-category) assignments.","Filter candidate assignments by group_category being absent before batching.","Surface the limitation in the UI instead of sending the mutation for group assignments.","If self assessment is truly needed for group work, restructure the assignment without a group category."],"exampleFix":"// before\nconst res = await client.mutate({ mutation: SET_SELF_ASSESSMENT, variables: { assignmentId } })\n// after\nif (!assignment.groupCategoryId) {\n  const res = await client.mutate({ mutation: SET_SELF_ASSESSMENT, variables: { assignmentId } })\n}","handlingStrategy":"validation","validationCode":"if (assignment.groupCategoryId || assignment.hasGroupCategory) throw new SkipMutation('group assignments unsupported')","typeGuard":null,"tryCatchPattern":"try { await mutate(...) } catch (e) { if (e.message.includes('group assignments')) showUnsupportedNotice(); else throw e; }","preventionTips":["Filter assignment lists to non-group assignments before offering self assessment controls.","Refresh assignment data when group category changes.","Encode assignment-type restrictions in shared UI constants."],"tags":["graphql","unsupported-operation","group-assignments","canvas"],"backgroundTag":"unsupported-operation","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}