{"record":{"id":"bd922511fa2f017c","repo":"instructure/canvas-lms","slug":"rubric-criteria-not-descriptive-enough","errorCode":null,"errorMessage":"Rubric criteria not descriptive enough","messagePattern":"Rubric criteria not descriptive enough","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/services/grade_service.rb","lineNumber":36,"sourceCode":"# with this program. If not, see <http://www.gnu.org/licenses/>.\n#\n\nclass GradeService\n  def initialize(assignment:, essay:, rubric:, root_account_uuid:, current_user:)\n    @assignment = assignment.to_s\n    @essay = essay.to_s\n    @rubric = rubric\n    @root_account_uuid = root_account_uuid\n    @current_user = current_user\n    @rubric_prompt_format = self.class.normalize_rubric_for_prompt(@rubric)\n  end\n\n  def call\n    @essay = sanitize_essay(@essay)\n    validate_essay_length(@essay)\n\n    if rubric_matches_default_template?\n      raise \"Rubric criteria not descriptive enough\"\n    end\n\n    cedar_rubric = build_cedar_rubric(@rubric)\n\n    begin\n      grading_results = CedarClient.grade_essay(\n        description: @assignment,\n        essay: @essay,\n        rubric: cedar_rubric,\n        feature_slug: \"grading-assistance\",\n        root_account_uuid: @root_account_uuid,\n        current_user: @current_user\n      )\n\n      map_grade_essay_results_to_canvas(grading_results, @rubric)\n    # These subclasses have static, user-safe messages and can be shown directly.\n    # If new CedarClientError subclasses are added with user-safe messages, add them here.\n    rescue InstructureMiscPlugin::Extensions::CedarClient::ValidationError,","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/services/grade_service.rb#L18-L54","documentation":"GradeService#call checks whether the supplied rubric matches Canvas's default (generic) template via rubric_matches_default_template?. A default-template rubric lacks the descriptive, assignment-specific criteria the external Cedar grading engine needs, so the service refuses to grade rather than send useless criteria. This is an input-quality guard for the AI grading pipeline.","triggerScenarios":"Calling GradeService.call(essay:, rubric:, ...) with a rubric whose criteria exactly match the stock default template (generic criteria like 'Description of criteria'); assignments created without customizing rubric criteria before enabling AI grading; rubric criteria never edited after duplicating the default template.","commonSituations":"Teachers applying the built-in default rubric to an assignment and turning on AI grading; importers cloning rubrics verbatim from templates; automated pipelines feeding placeholder rubrics.","solutions":["Edit the rubric criteria to be assignment-specific (distinct descriptions, points, learning outcomes) so it no longer matches the default template","Create a custom rubric for the assignment instead of the default one before running GradeService","If you control the caller, validate the rubric upstream and surface a friendly 'rubric too generic' message to the instructor"],"exampleFix":"// before\nrubric = Rubric.default_template_for(course)\nGradeService.new(essay:, rubric:, rubric_association:).call\n// after\nrubric = Rubric.default_template_for(course)\nrubric.update!(data: rubric.data.map { |c| c.merge(description: custom_description(c)) })\nGradeService.new(essay:, rubric:, rubric_association:).call","handlingStrategy":"validation","validationCode":"raise 'rubric too generic' if GradeService.new(essay:, rubric:, rubric_association:).send(:rubric_matches_default_template?)","typeGuard":"rubric.present? && !rubric_matches_default_template?(rubric)","tryCatchPattern":"begin\n  GradeService.new(essay:, rubric:, rubric_association:).call\nrescue RuntimeError => e\n  prompt_custom_rubric if e.message.include?('not descriptive enough')\nend","preventionTips":["Customize rubric criteria before enabling AI grading","Avoid applying the default template verbatim","Validate rubric descriptions upstream in the UI"],"tags":["grading","rubric","ai"],"backgroundTag":"invalid-argument-value","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"}