{"record":{"id":"6c02abf3da527113","repo":"instructure/canvas-lms","slug":"cannot-set-rubric-self-assessment-for-quiz-assignments","errorCode":null,"errorMessage":"Cannot set rubric self assessment for quiz assignments","messagePattern":"Cannot set rubric self assessment for quiz assignments","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/set_rubric_self_assessment.rb","lineNumber":46,"sourceCode":"\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: }\n      else\n        errors_for(assignment)\n      end\n    rescue ActiveRecord::RecordNotFound => e","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/set_rubric_self_assessment.rb#L28-L64","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Only call this mutation for non-quiz assignments; filter out quiz_lti?/quiz? assignments client-side.","Check assignment type via the GraphQL query before sending the mutation.","Hide the self assessment toggle for quiz-type assignments in the UI.","If rubric feedback on quizzes is needed, use quiz-level rubric features instead of self assessment."],"exampleFix":"// before\nawait client.mutate({ mutation: SET_SELF_ASSESSMENT, variables: { assignmentId } })\n// after\nif (!assignment.quiz && !assignment.quizLti) {\n  await client.mutate({ mutation: SET_SELF_ASSESSMENT, variables: { assignmentId } })\n}","handlingStrategy":"validation","validationCode":"if (assignment.quiz || assignment.quizLti) throw new SkipMutation('quiz assignments unsupported')","typeGuard":null,"tryCatchPattern":"try { await mutate(...) } catch (e) { if (e.message.includes('quiz assignments')) showUnsupportedNotice(); else throw e; }","preventionTips":["Exclude quiz and New Quizzes assignments from self assessment UI.","Re-query assignment type before mutating.","Keep type-based restriction lists in one place for frontend and backend parity."],"tags":["graphql","unsupported-operation","quizzes","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"}