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

Grading Assistance is not enabled for this course.

Error message

Grading Assistance is not enabled for this course.

What it means

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.

Solutions

  1. Enable the project_lhotse feature flag for the course (or its root account) via the account Feature Options UI or feature_flag API.
  2. Confirm you are targeting the course on the account where the flag is enabled.
  3. Check flag state first via GET /api/v1/courses/:id/feature_flags before calling the mutation.
  4. Gate the Grading Assistance UI behind the same flag so the mutation is never called while disabled.

Example fix

// before
await client.mutate({ mutation: SUBMIT_AUTO_GRADE_FEEDBACK, variables: { courseId } })
// after
const flags = await fetch(`/api/v1/courses/${courseId}/feature_flags`)
if (flags.project_lhotse === 'on') {
  await client.mutate({ mutation: SUBMIT_AUTO_GRADE_FEEDBACK, variables: { courseId } })
}
Defensive patterns

Strategy: validation

Validate before calling

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')

Try / catch

try { await mutate(...) } catch (e) { if (e.message.includes('not enabled for this course')) showFeatureFlagNotice(); else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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

Appendix: source

Thrown at app/graphql/mutations/submit_auto_grade_feedback.rb:32

# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#

class Mutations::SubmitAutoGradeFeedback < Mutations::BaseAiFeedback
  argument :course_id, ID, required: true

  private

  def check_feature_and_permissions!(input)
    course_id = GraphQLHelpers.parse_relay_or_legacy_id(input[:course_id], "Course")
    course = Course.find(course_id)
    verify_authorized_action!(course, :manage_grades)

    unless course.feature_enabled?(:project_lhotse)
      raise GraphQL::ExecutionError, I18n.t("Grading Assistance is not enabled for this course.")
    end

    course.root_account.uuid
  end

  def feature_slug
    "grading-assistance-feedback"
  end
end

View on GitHub (pinned to 1c9f0bb801)