{
  "$defs": {
    "CappedCategoryConfig": {
      "additionalProperties": false,
      "description": "A bonus or penalty category: its criteria move the score by at most `max_points`.",
      "properties": {
        "max_points": {
          "description": "The most points this category adds to (bonus) or subtracts from (penalty) the base score.",
          "maximum": 100,
          "minimum": 0,
          "title": "Max Points",
          "type": "number"
        },
        "tests": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TestConfig"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Criteria directly in this group; null when it has none.",
          "title": "Tests"
        },
        "subjects": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/SubjectConfig"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Subjects nested in this group; null when it has none.",
          "title": "Subjects"
        },
        "subjects_weight": {
          "anyOf": [
            {
              "maximum": 100,
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Share (0-100) of this group's score taken from its subjects when it has both tests and subjects; its tests get the rest. Required for such mixed groups and rejected otherwise.",
          "title": "Subjects Weight"
        },
        "metadata": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "default": {},
          "description": "Free-form JSON stored with the definition; never interpreted by grading.",
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "max_points"
      ],
      "title": "CappedCategoryConfig",
      "type": "object"
    },
    "CriteriaConfig": {
      "additionalProperties": false,
      "description": "Root configuration for grading criteria.",
      "properties": {
        "base": {
          "$ref": "#/$defs/GroupConfig",
          "description": "Criteria that make up the score (0-100)."
        },
        "bonus": {
          "anyOf": [
            {
              "$ref": "#/$defs/CappedCategoryConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Criteria whose score adds up to max_points."
        },
        "penalty": {
          "anyOf": [
            {
              "$ref": "#/$defs/CappedCategoryConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Criteria whose shortfall subtracts up to max_points."
        },
        "metadata": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "default": {},
          "description": "Free-form JSON stored with the definition; never interpreted by grading.",
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "base"
      ],
      "title": "CriteriaConfig",
      "type": "object"
    },
    "DefaultPreferences": {
      "additionalProperties": false,
      "description": "Options of the default Markdown report.",
      "properties": {
        "category_headers": {
          "additionalProperties": {
            "type": "string"
          },
          "default": {},
          "description": "Section heading per category; a missing category uses its localized default heading.",
          "propertyNames": {
            "enum": [
              "base",
              "bonus",
              "penalty"
            ]
          },
          "title": "Category Headers",
          "type": "object"
        }
      },
      "title": "DefaultPreferences",
      "type": "object"
    },
    "Feedback": {
      "additionalProperties": false,
      "description": "Whether and how a feedback report is written for a completed grade.",
      "properties": {
        "enabled": {
          "default": false,
          "description": "Whether a feedback report is rendered; disabled feedback does no work.",
          "title": "Enabled",
          "type": "boolean"
        },
        "mode": {
          "const": "default",
          "default": "default",
          "description": "Report format; only the Markdown default exists.",
          "title": "Mode",
          "type": "string"
        },
        "preferences": {
          "$ref": "#/$defs/FeedbackPreferences",
          "default": {
            "general": {
              "add_report_summary": true,
              "online_content": [],
              "report_title": null,
              "show_passed_tests": false,
              "show_score": true
            },
            "default": {
              "category_headers": {}
            }
          },
          "description": "Report options."
        }
      },
      "title": "Feedback",
      "type": "object"
    },
    "FeedbackPreferences": {
      "additionalProperties": false,
      "description": "How the feedback report is written.",
      "properties": {
        "general": {
          "$ref": "#/$defs/GeneralPreferences",
          "default": {
            "report_title": null,
            "show_score": true,
            "show_passed_tests": false,
            "add_report_summary": true,
            "online_content": []
          },
          "description": "Options for every mode."
        },
        "default": {
          "$ref": "#/$defs/DefaultPreferences",
          "default": {
            "category_headers": {}
          },
          "description": "Options of the default mode."
        }
      },
      "title": "FeedbackPreferences",
      "type": "object"
    },
    "Fixture": {
      "additionalProperties": false,
      "description": "A host-provided file staged into the sandbox before setup commands.",
      "properties": {
        "reference": {
          "description": "Logical relative reference resolved by the host's fixture provider (an object key on the shipped hosts).",
          "minLength": 1,
          "title": "Reference",
          "type": "string"
        },
        "path": {
          "description": "Unique relative destination under the fixture root (/tmp/app on the shipped hosts).",
          "title": "Path",
          "type": "string"
        },
        "read_only": {
          "default": true,
          "description": "Whether the staged file is read-only to the submission.",
          "title": "Read Only",
          "type": "boolean"
        }
      },
      "required": [
        "reference",
        "path"
      ],
      "title": "Fixture",
      "type": "object"
    },
    "GeneralPreferences": {
      "additionalProperties": false,
      "description": "Report options shared by every feedback mode.",
      "properties": {
        "report_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Report heading; null uses the localized default title.",
          "title": "Report Title"
        },
        "show_score": {
          "default": true,
          "description": "Whether the report shows the final score.",
          "title": "Show Score",
          "type": "boolean"
        },
        "show_passed_tests": {
          "default": false,
          "description": "Whether criteria that scored 100 are listed; by default only criteria below 100 are.",
          "title": "Show Passed Tests",
          "type": "boolean"
        },
        "add_report_summary": {
          "default": true,
          "description": "Whether the report starts with a score summary.",
          "title": "Add Report Summary",
          "type": "boolean"
        },
        "online_content": {
          "default": [],
          "description": "Learning resources listed at the end of the report.",
          "items": {
            "$ref": "#/$defs/LearningResource"
          },
          "title": "Online Content",
          "type": "array"
        }
      },
      "title": "GeneralPreferences",
      "type": "object"
    },
    "GroupConfig": {
      "additionalProperties": false,
      "description": "A group of criteria, such as the base category: its own tests, nested subjects, or both.",
      "properties": {
        "tests": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TestConfig"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Criteria directly in this group; null when it has none.",
          "title": "Tests"
        },
        "subjects": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/SubjectConfig"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Subjects nested in this group; null when it has none.",
          "title": "Subjects"
        },
        "subjects_weight": {
          "anyOf": [
            {
              "maximum": 100,
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Share (0-100) of this group's score taken from its subjects when it has both tests and subjects; its tests get the rest. Required for such mixed groups and rejected otherwise.",
          "title": "Subjects Weight"
        },
        "metadata": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "default": {},
          "description": "Free-form JSON stored with the definition; never interpreted by grading.",
          "title": "Metadata",
          "type": "object"
        }
      },
      "title": "GroupConfig",
      "type": "object"
    },
    "JsonValue": {},
    "LanguagePreparation": {
      "additionalProperties": false,
      "description": "Preparation for one allowed language.",
      "properties": {
        "required_files": {
          "default": [],
          "description": "Unique relative submission paths that must exist; a missing one fails with REQUIRED_FILE_MISSING before any sandbox is acquired.",
          "items": {
            "type": "string"
          },
          "title": "Required Files",
          "type": "array"
        },
        "setup_commands": {
          "default": [],
          "description": "Steps run in order after fixtures are staged, for example compilation. A failing step stops grading with PREPARATION_FAILED.",
          "items": {
            "$ref": "#/$defs/SetupCommand"
          },
          "title": "Setup Commands",
          "type": "array"
        }
      },
      "title": "LanguagePreparation",
      "type": "object"
    },
    "LearningResource": {
      "additionalProperties": false,
      "description": "A link listed in the feedback report.",
      "properties": {
        "url": {
          "description": "Address of the resource.",
          "minLength": 1,
          "title": "Url",
          "type": "string"
        },
        "description": {
          "description": "Link text shown in the report.",
          "title": "Description",
          "type": "string"
        },
        "linked_tests": {
          "default": [],
          "description": "Criterion IDs; the resource is shown only when one of them scored below 100. Empty shows it always.",
          "items": {
            "type": "string"
          },
          "title": "Linked Tests",
          "type": "array"
        }
      },
      "required": [
        "url",
        "description"
      ],
      "title": "LearningResource",
      "type": "object"
    },
    "Preparation": {
      "additionalProperties": false,
      "description": "What must exist and run before any criterion is assessed.",
      "properties": {
        "languages": {
          "additionalProperties": {
            "$ref": "#/$defs/LanguagePreparation"
          },
          "default": {},
          "description": "Preparation keyed by allowed language; only the submission's language is used.",
          "propertyNames": {
            "enum": [
              "python",
              "java",
              "node",
              "cpp",
              "c"
            ]
          },
          "title": "Languages",
          "type": "object"
        },
        "fixtures": {
          "default": [],
          "description": "Files staged for every language.",
          "items": {
            "$ref": "#/$defs/Fixture"
          },
          "title": "Fixtures",
          "type": "array"
        }
      },
      "title": "Preparation",
      "type": "object"
    },
    "SetupCommand": {
      "additionalProperties": false,
      "description": "One preparation step, run once before assessment in the selected language's sandbox.",
      "properties": {
        "name": {
          "description": "Label of the step, shown when it fails.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "command": {
          "description": "Executable and arguments, split with POSIX quoting and run without a shell. Standalone shell operators (&&, |, ;, >, ...) are rejected: use one setup command per step, and an explicit `sh -c '...'` command only for a real pipeline.",
          "minLength": 1,
          "title": "Command",
          "type": "string"
        },
        "private_output": {
          "default": false,
          "description": "Keep this step's output out of the student-facing failure explanation, for example when it compiles a hidden test harness. By default a failing step's output excerpt is shown.",
          "title": "Private Output",
          "type": "boolean"
        }
      },
      "required": [
        "name",
        "command"
      ],
      "title": "SetupCommand",
      "type": "object"
    },
    "SubjectConfig": {
      "additionalProperties": false,
      "description": "A named group of criteria inside a category or another subject.",
      "properties": {
        "name": {
          "description": "Display name of the subject; may repeat.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "weight": {
          "default": 100.0,
          "description": "Weight relative to sibling criteria or subjects (any nonnegative ratio); all-zero siblings share equally.",
          "minimum": 0,
          "title": "Weight",
          "type": "number"
        },
        "tests": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TestConfig"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Criteria directly in this group; null when it has none.",
          "title": "Tests"
        },
        "subjects": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/SubjectConfig"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Subjects nested in this group; null when it has none.",
          "title": "Subjects"
        },
        "subjects_weight": {
          "anyOf": [
            {
              "maximum": 100,
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Share (0-100) of this group's score taken from its subjects when it has both tests and subjects; its tests get the rest. Required for such mixed groups and rejected otherwise.",
          "title": "Subjects Weight"
        },
        "metadata": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "default": {},
          "description": "Free-form JSON stored with the definition; never interpreted by grading.",
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "name"
      ],
      "title": "SubjectConfig",
      "type": "object"
    },
    "TestConfig": {
      "additionalProperties": false,
      "description": "One criterion: an evaluator invocation with its parameters.",
      "properties": {
        "id": {
          "description": "Stable identifier, unique in the definition; results, feedback links and comparisons use it.",
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[A-Za-z0-9_.:-]+$",
          "title": "Id",
          "type": "string"
        },
        "type": {
          "description": "Evaluator identifier (see the evaluator reference).",
          "minLength": 1,
          "title": "Type",
          "type": "string",
          "enum": [
            "ai_graph_algorithm",
            "ai_search_algorithm",
            "ai_sorting_algorithm",
            "check_all_images_have_alt",
            "check_attribute_and_value",
            "check_bootstrap_linked",
            "check_css_linked",
            "check_dir_exists",
            "check_flexbox_usage",
            "check_head_details",
            "check_headings_sequential",
            "check_html_direct_children",
            "check_id_selector_over_usage",
            "check_internal_links",
            "check_internal_links_to_article",
            "check_media_queries",
            "check_no_inline_styles",
            "check_no_unclosed_tags",
            "check_project_structure",
            "check_response_json",
            "check_tag_not_inside",
            "count_global_vars",
            "count_over_usage",
            "count_unused_css_classes",
            "css_uses_property",
            "dont_fail",
            "expect_file_artifact",
            "expect_output",
            "forbidden_import",
            "forbidden_keyword",
            "has_attribute",
            "has_class",
            "has_forbidden_tag",
            "has_no_bootstrap",
            "has_no_js_framework",
            "has_style",
            "has_tag",
            "health_check",
            "js_has_json_array_with_id",
            "js_uses_dom_manipulation",
            "js_uses_feature",
            "js_uses_query_string_parsing",
            "link_points_to_page_with_query_param",
            "uses_forbidden_method",
            "uses_relative_units",
            "uses_semantic_tags"
          ]
        },
        "name": {
          "description": "Display name; may repeat.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "parameters": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "description": "The evaluator's parameters ({} when it has none); each evaluator documents its own.",
          "title": "Parameters",
          "type": "object"
        },
        "file": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Exact relative submission path to assess; null selects the evaluator's matching files.",
          "title": "File"
        },
        "weight": {
          "default": 100.0,
          "description": "Weight relative to sibling criteria or subjects (any nonnegative ratio); all-zero siblings share equally.",
          "minimum": 0,
          "title": "Weight",
          "type": "number"
        },
        "metadata": {
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          },
          "default": {},
          "description": "Free-form JSON stored with the definition; never interpreted by grading.",
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "id",
        "type",
        "name",
        "parameters"
      ],
      "title": "TestConfig",
      "type": "object",
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "has_class"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "class_names": {
                    "description": "A list of class names to search for. Wildcards (*) are supported (e.g., 'col-*').",
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "minItems": 1,
                    "title": "Class Names",
                    "type": "array"
                  },
                  "required_count": {
                    "default": 1,
                    "description": "The minimum total number of times the classes must appear.",
                    "minimum": 1,
                    "title": "Required Count",
                    "type": "integer"
                  }
                },
                "required": [
                  "class_names"
                ],
                "title": "HasClassParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_bootstrap_linked"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckBootstrapLinkedParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_internal_links"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "required_count": {
                    "default": 1,
                    "description": "The minimum number of links that point to an existing element ID.",
                    "minimum": 1,
                    "title": "Required Count",
                    "type": "integer"
                  }
                },
                "title": "CheckInternalLinksParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "has_tag"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "tag": {
                    "description": "The HTML tag to search for (e.g., 'div').",
                    "minLength": 1,
                    "title": "Tag",
                    "type": "string"
                  },
                  "required_count": {
                    "default": 1,
                    "description": "The minimum number of times the tag must appear.",
                    "minimum": 1,
                    "title": "Required Count",
                    "type": "integer"
                  }
                },
                "required": [
                  "tag"
                ],
                "title": "HasTagParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "has_forbidden_tag"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "tag": {
                    "description": "The forbidden HTML tag to search for.",
                    "minLength": 1,
                    "title": "Tag",
                    "type": "string"
                  }
                },
                "required": [
                  "tag"
                ],
                "title": "HasForbiddenTagParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "has_attribute"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "attribute": {
                    "description": "The attribute to search for (e.g., 'alt').",
                    "minLength": 1,
                    "title": "Attribute",
                    "type": "string"
                  },
                  "required_count": {
                    "default": 1,
                    "description": "The minimum number of times the attribute must appear.",
                    "minimum": 1,
                    "title": "Required Count",
                    "type": "integer"
                  }
                },
                "required": [
                  "attribute"
                ],
                "title": "HasAttributeParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_no_unclosed_tags"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckNoUnclosedTagsParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_no_inline_styles"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckNoInlineStylesParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "uses_semantic_tags"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "UsesSemanticTagsParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_css_linked"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckCssLinkedParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "css_uses_property"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "prop": {
                    "description": "The CSS property.",
                    "minLength": 1,
                    "title": "Prop",
                    "type": "string"
                  },
                  "value": {
                    "description": "The expected value.",
                    "minLength": 1,
                    "title": "Value",
                    "type": "string"
                  }
                },
                "required": [
                  "prop",
                  "value"
                ],
                "title": "CssUsesPropertyParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "count_over_usage"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "text": {
                    "description": "The text to be counted.",
                    "minLength": 1,
                    "title": "Text",
                    "type": "string"
                  },
                  "max_allowed": {
                    "default": 0,
                    "description": "The maximum number of allowed occurrences.",
                    "minimum": 0,
                    "title": "Max Allowed",
                    "type": "integer"
                  }
                },
                "required": [
                  "text"
                ],
                "title": "CountOverUsageParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "js_uses_feature"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "feature": {
                    "description": "The feature to search for.",
                    "minLength": 1,
                    "title": "Feature",
                    "type": "string"
                  }
                },
                "required": [
                  "feature"
                ],
                "title": "JsUsesFeatureParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "uses_forbidden_method"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "method": {
                    "description": "The name of the forbidden method.",
                    "minLength": 1,
                    "title": "Method",
                    "type": "string"
                  }
                },
                "required": [
                  "method"
                ],
                "title": "UsesForbiddenMethodParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "count_global_vars"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "max_allowed": {
                    "default": 0,
                    "description": "The maximum number of allowed global variables.",
                    "minimum": 0,
                    "title": "Max Allowed",
                    "type": "integer"
                  }
                },
                "title": "CountGlobalVarsParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_headings_sequential"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckHeadingsSequentialParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_all_images_have_alt"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckAllImagesHaveAltParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_html_direct_children"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckHtmlDirectChildrenParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_tag_not_inside"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "child_tag": {
                    "description": "The child tag.",
                    "minLength": 1,
                    "title": "Child Tag",
                    "type": "string"
                  },
                  "parent_tag": {
                    "description": "The parent tag.",
                    "minLength": 1,
                    "title": "Parent Tag",
                    "type": "string"
                  }
                },
                "required": [
                  "child_tag",
                  "parent_tag"
                ],
                "title": "CheckTagNotInsideParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_internal_links_to_article"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "required_count": {
                    "default": 1,
                    "description": "The minimum number of links that point to the ID of an <article> element.",
                    "minimum": 1,
                    "title": "Required Count",
                    "type": "integer"
                  }
                },
                "title": "CheckInternalLinksToArticleParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "has_style"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "style": {
                    "description": "The style rule.",
                    "minLength": 1,
                    "title": "Style",
                    "type": "string"
                  },
                  "required_count": {
                    "default": 1,
                    "description": "The minimum number of occurrences.",
                    "minimum": 1,
                    "title": "Required Count",
                    "type": "integer"
                  }
                },
                "required": [
                  "style"
                ],
                "title": "HasStyleParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_head_details"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "detail_tag": {
                    "description": "The tag to be checked.",
                    "minLength": 1,
                    "title": "Detail Tag",
                    "type": "string"
                  }
                },
                "required": [
                  "detail_tag"
                ],
                "title": "CheckHeadDetailsParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_attribute_and_value"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "tag": {
                    "description": "The tag.",
                    "minLength": 1,
                    "title": "Tag",
                    "type": "string"
                  },
                  "attribute": {
                    "description": "The attribute.",
                    "minLength": 1,
                    "title": "Attribute",
                    "type": "string"
                  },
                  "value": {
                    "description": "The expected value.",
                    "minLength": 1,
                    "title": "Value",
                    "type": "string"
                  }
                },
                "required": [
                  "tag",
                  "attribute",
                  "value"
                ],
                "title": "CheckAttributeAndValueParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_dir_exists"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "dir_path": {
                    "description": "The directory path.",
                    "minLength": 1,
                    "title": "Dir Path",
                    "type": "string"
                  }
                },
                "required": [
                  "dir_path"
                ],
                "title": "CheckDirExistsParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_project_structure"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "expected_structure": {
                    "description": "The expected file path.",
                    "minLength": 1,
                    "title": "Expected Structure",
                    "type": "string"
                  }
                },
                "required": [
                  "expected_structure"
                ],
                "title": "CheckProjectStructureParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_id_selector_over_usage"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "max_allowed": {
                    "default": 0,
                    "description": "Maximum number of allowed ID selectors.",
                    "minimum": 0,
                    "title": "Max Allowed",
                    "type": "integer"
                  }
                },
                "title": "CheckIdSelectorOverUsageParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "uses_relative_units"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "UsesRelativeUnitsParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_media_queries"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckMediaQueriesParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_flexbox_usage"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CheckFlexboxUsageParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "has_no_bootstrap"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "HasNoBootstrapParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "link_points_to_page_with_query_param"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "target_page": {
                    "description": "The expected destination page (e.g., 'details.html').",
                    "minLength": 1,
                    "title": "Target Page",
                    "type": "string"
                  },
                  "query_param": {
                    "description": "The name of the query string parameter to check (e.g., 'id').",
                    "minLength": 1,
                    "title": "Query Param",
                    "type": "string"
                  },
                  "required_count": {
                    "default": 1,
                    "description": "The minimum number of valid links.",
                    "minimum": 1,
                    "title": "Required Count",
                    "type": "integer"
                  }
                },
                "required": [
                  "target_page",
                  "query_param"
                ],
                "title": "LinkPointsToPageWithQueryParamParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "js_uses_query_string_parsing"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "JsUsesQueryStringParsingParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "js_has_json_array_with_id"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "required_key": {
                    "description": "The key that must exist in each object (e.g., 'id').",
                    "minLength": 1,
                    "title": "Required Key",
                    "type": "string"
                  },
                  "min_items": {
                    "default": 1,
                    "description": "The minimum number of items expected in the array.",
                    "minimum": 1,
                    "title": "Min Items",
                    "type": "integer"
                  }
                },
                "required": [
                  "required_key"
                ],
                "title": "JsHasJsonArrayWithIdParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "js_uses_dom_manipulation"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "methods": {
                    "description": "A list of methods to search for (e.g., ['createElement', 'appendChild']).",
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "minItems": 1,
                    "title": "Methods",
                    "type": "array"
                  },
                  "required_count": {
                    "default": 1,
                    "description": "Total minimum number of times these methods must appear.",
                    "minimum": 1,
                    "title": "Required Count",
                    "type": "integer"
                  }
                },
                "required": [
                  "methods"
                ],
                "title": "JsUsesDomManipulationParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "has_no_js_framework"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "HasNoJsFrameworkParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "count_unused_css_classes"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {},
                "title": "CountUnusedCssClassesParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "health_check"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "endpoint": {
                    "description": "The endpoint to be tested (e.g., '/health').",
                    "minLength": 1,
                    "title": "Endpoint",
                    "type": "string"
                  }
                },
                "required": [
                  "endpoint"
                ],
                "title": "HealthCheckTestParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "check_response_json"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "endpoint": {
                    "description": "The API endpoint to be tested (e.g., '/api/data').",
                    "minLength": 1,
                    "title": "Endpoint",
                    "type": "string"
                  },
                  "expected_key": {
                    "description": "The JSON key to check.",
                    "minLength": 1,
                    "title": "Expected Key",
                    "type": "string"
                  },
                  "expected_value": {
                    "default": null,
                    "description": "The expected value for the specified key.",
                    "title": "Expected Value"
                  }
                },
                "required": [
                  "endpoint",
                  "expected_key"
                ],
                "title": "CheckResponseJsonTestParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "expect_output"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "inputs": {
                    "default": [],
                    "description": "List of strings to be sent to the program, each on a new line.",
                    "items": {
                      "type": "string"
                    },
                    "title": "Inputs",
                    "type": "array"
                  },
                  "expected_output": {
                    "description": "The single string the program must print to standard output.",
                    "title": "Expected Output",
                    "type": "string"
                  },
                  "program_command": {
                    "anyOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "additionalProperties": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "propertyNames": {
                          "enum": [
                            "python",
                            "java",
                            "node",
                            "cpp",
                            "c"
                          ]
                        },
                        "type": "object"
                      }
                    ],
                    "description": "Command that runs the program: a nonempty string, a map with a command for every allowed language, or 'CMD' for the conventional per-language default. It runs without a shell for every test: compile in preparation.setup_commands, never here; standalone shell operators (&&, |, ;, >, ...) are rejected.",
                    "title": "Program Command"
                  },
                  "normalization": {
                    "default": true,
                    "description": "Strip trailing whitespace from each line and normalize line endings",
                    "title": "Normalization",
                    "type": "boolean"
                  }
                },
                "required": [
                  "expected_output",
                  "program_command"
                ],
                "title": "ExpectOutputParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "dont_fail"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "inputs": {
                    "default": [],
                    "description": "Lines sent to the program's standard input, each ending in a newline; empty sends nothing.",
                    "items": {
                      "type": "string"
                    },
                    "title": "Inputs",
                    "type": "array"
                  },
                  "program_command": {
                    "anyOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "additionalProperties": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "propertyNames": {
                          "enum": [
                            "python",
                            "java",
                            "node",
                            "cpp",
                            "c"
                          ]
                        },
                        "type": "object"
                      }
                    ],
                    "description": "Command that runs the program: a nonempty string, a map with a command for every allowed language, or 'CMD' for the conventional per-language default. It runs without a shell for every test: compile in preparation.setup_commands, never here; standalone shell operators (&&, |, ;, >, ...) are rejected.",
                    "title": "Program Command"
                  }
                },
                "required": [
                  "program_command"
                ],
                "title": "DontFailParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "expect_file_artifact"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "inputs": {
                    "default": [],
                    "description": "List of strings to be sent to the program via stdin.",
                    "items": {
                      "type": "string"
                    },
                    "title": "Inputs",
                    "type": "array"
                  },
                  "program_command": {
                    "anyOf": [
                      {
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "additionalProperties": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "propertyNames": {
                          "enum": [
                            "python",
                            "java",
                            "node",
                            "cpp",
                            "c"
                          ]
                        },
                        "type": "object"
                      }
                    ],
                    "description": "Command that runs the program: a nonempty string, a map with a command for every allowed language, or 'CMD' for the conventional per-language default. It runs without a shell for every test: compile in preparation.setup_commands, never here; standalone shell operators (&&, |, ;, >, ...) are rejected.",
                    "title": "Program Command"
                  },
                  "artifact_path": {
                    "description": "Relative path (under /app) of the file the program must generate (e.g. 'output.txt').",
                    "minLength": 1,
                    "title": "Artifact Path",
                    "type": "string"
                  },
                  "expected_content": {
                    "description": "The expected file content or pattern to match against.",
                    "title": "Expected Content",
                    "type": "string"
                  },
                  "match_mode": {
                    "default": "exact",
                    "description": "Comparison mode: 'exact' (default), 'contains', or 'regex'.",
                    "enum": [
                      "exact",
                      "contains",
                      "regex"
                    ],
                    "title": "Match Mode",
                    "type": "string"
                  },
                  "normalization": {
                    "default": true,
                    "description": "Whether to normalize line endings and trim trailing whitespace (default: true).",
                    "title": "Normalization",
                    "type": "boolean"
                  }
                },
                "required": [
                  "program_command",
                  "artifact_path",
                  "expected_content"
                ],
                "title": "ArtifactParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "forbidden_import"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "forbidden_imports": {
                    "description": "List of library/module names whose import is forbidden (at least one).",
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "minItems": 1,
                    "title": "Forbidden Imports",
                    "type": "array"
                  }
                },
                "required": [
                  "forbidden_imports"
                ],
                "title": "ForbiddenImportTestParameters",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "forbidden_keyword"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "forbidden_keywords": {
                    "default": [],
                    "description": "List of predefined constructs to forbid (e.g., 'for_loop', 'while_loop', 'eval_call'). At least one keyword or custom rule is required.",
                    "items": {
                      "type": "string"
                    },
                    "title": "Forbidden Keywords",
                    "type": "array"
                  },
                  "custom_ast_grep_rules": {
                    "default": [],
                    "description": "List of custom ast-grep rules to apply.",
                    "items": {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    "title": "Custom Ast Grep Rules",
                    "type": "array"
                  }
                },
                "title": "ForbiddenKeywordConfig",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "ai_sorting_algorithm"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "algorithm_name": {
                    "description": "Name of the algorithm the submission must implement.",
                    "minLength": 1,
                    "title": "Algorithm Name",
                    "type": "string"
                  }
                },
                "required": [
                  "algorithm_name"
                ],
                "title": "AiAlgorithmConfig",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "ai_search_algorithm"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "algorithm_name": {
                    "description": "Name of the algorithm the submission must implement.",
                    "minLength": 1,
                    "title": "Algorithm Name",
                    "type": "string"
                  }
                },
                "required": [
                  "algorithm_name"
                ],
                "title": "AiAlgorithmConfig",
                "type": "object"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "ai_graph_algorithm"
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "properties": {
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "algorithm_name": {
                    "description": "Name of the algorithm the submission must implement.",
                    "minLength": 1,
                    "title": "Algorithm Name",
                    "type": "string"
                  }
                },
                "required": [
                  "algorithm_name"
                ],
                "title": "AiAlgorithmConfig",
                "type": "object"
              }
            }
          }
        }
      ]
    }
  },
  "additionalProperties": false,
  "description": "One assignment's complete grading definition (version 2.0).",
  "properties": {
    "schema_version": {
      "const": "2.0",
      "description": "Definition format version.",
      "title": "Schema Version",
      "type": "string"
    },
    "languages": {
      "description": "Distinct languages a submission may use; with several, each submission names its language.",
      "items": {
        "enum": [
          "python",
          "java",
          "node",
          "cpp",
          "c"
        ],
        "type": "string"
      },
      "minItems": 1,
      "title": "Languages",
      "type": "array"
    },
    "criteria": {
      "$ref": "#/$defs/CriteriaConfig",
      "description": "The weighted criteria tree."
    },
    "preparation": {
      "$ref": "#/$defs/Preparation",
      "default": {
        "languages": {},
        "fixtures": []
      },
      "description": "Required files, fixtures and setup commands."
    },
    "feedback": {
      "$ref": "#/$defs/Feedback",
      "default": {
        "enabled": false,
        "mode": "default",
        "preferences": {
          "default": {
            "category_headers": {}
          },
          "general": {
            "add_report_summary": true,
            "online_content": [],
            "report_title": null,
            "show_passed_tests": false,
            "show_score": true
          }
        }
      },
      "description": "Feedback report policy."
    },
    "metadata": {
      "additionalProperties": {
        "$ref": "#/$defs/JsonValue"
      },
      "default": {},
      "description": "Free-form JSON stored with the definition; never interpreted by grading.",
      "title": "Metadata",
      "type": "object"
    }
  },
  "required": [
    "schema_version",
    "languages",
    "criteria"
  ],
  "title": "GradingDefinition",
  "type": "object",
  "$id": "https://webtech.network/autograder/contracts/grading-definition/2.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}
