{"record":{"id":"66eea92dc74ac932","repo":"instructure/canvas-lms","slug":"grading-assistance-is-not-enabled-for-this-course","errorCode":null,"errorMessage":"Grading Assistance is not enabled for this course.","messagePattern":"Grading Assistance is not enabled for this course\\.","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/submit_auto_grade_feedback.rb","lineNumber":32,"sourceCode":"# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\n# details.\n#\n# You should have received a copy of the GNU Affero General Public License along\n# with this program. If not, see <http://www.gnu.org/licenses/>.\n#\n\nclass Mutations::SubmitAutoGradeFeedback < Mutations::BaseAiFeedback\n  argument :course_id, ID, required: true\n\n  private\n\n  def check_feature_and_permissions!(input)\n    course_id = GraphQLHelpers.parse_relay_or_legacy_id(input[:course_id], \"Course\")\n    course = Course.find(course_id)\n    verify_authorized_action!(course, :manage_grades)\n\n    unless course.feature_enabled?(:project_lhotse)\n      raise GraphQL::ExecutionError, I18n.t(\"Grading Assistance is not enabled for this course.\")\n    end\n\n    course.root_account.uuid\n  end\n\n  def feature_slug\n    \"grading-assistance-feedback\"\n  end\nend\n","sourceCodeStart":14,"sourceCodeEnd":42,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/submit_auto_grade_feedback.rb#L14-L42","documentation":"SubmitAutoGradeFeedback's check_feature_and_permissions! raises this GraphQL::ExecutionError when the target course does not have the :project_lhotse feature flag enabled (app/graphql/mutations/submit_auto_grade_feedback.rb:32). The Grading Assistance feature is gated per-course by this root-account-known feature flag, so the mutation refuses to run without it.","triggerScenarios":"Calling the submitAutoGradeFeedback mutation for a course where course.feature_enabled?(:project_lhotse) returns false; the flag may be off at account level and not overridden at course level, or disabled entirely.","commonSituations":"Testing on a non-production Canvas environment where the flag was never turned on; a course on a root account different from the one where the feature was enabled; the feature flag was rolled back by an admin; deploying Grading Assistance UI before the ops team enabled the flag.","solutions":["Enable the project_lhotse feature flag for the course (or its root account) via the account Feature Options UI or feature_flag API.","Confirm you are targeting the course on the account where the flag is enabled.","Check flag state first via GET /api/v1/courses/:id/feature_flags before calling the mutation.","Gate the Grading Assistance UI behind the same flag so the mutation is never called while disabled."],"exampleFix":"// before\nawait client.mutate({ mutation: SUBMIT_AUTO_GRADE_FEEDBACK, variables: { courseId } })\n// after\nconst flags = await fetch(`/api/v1/courses/${courseId}/feature_flags`)\nif (flags.project_lhotse === 'on') {\n  await client.mutate({ mutation: SUBMIT_AUTO_GRADE_FEEDBACK, variables: { courseId } })\n}","handlingStrategy":"validation","validationCode":"const flags = await fetch(`/api/v1/courses/${courseId}/feature_flags`); if (flags.project_lhotse !== 'on') throw new SkipMutation('Grading Assistance not enabled for this course')","typeGuard":null,"tryCatchPattern":"try { await mutate(...) } catch (e) { if (e.message.includes('not enabled for this course')) showFeatureFlagNotice(); else throw e; }","preventionTips":["Check the project_lhotse course feature flag before rendering Grading Assistance UI.","Confirm the correct root account/environment has the flag enabled.","Document flag rollout so ops and frontend deployments stay in sync."],"tags":["graphql","feature-flag","grading-assistance","canvas"],"backgroundTag":"feature-not-enabled","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"}