diff --git a/graderutils/README.md b/graderutils/README.md index 6259bc4..e281899 100644 --- a/graderutils/README.md +++ b/graderutils/README.md @@ -1,7 +1,7 @@ ## Test configuration The functionality of the test runner is customized by supplying a [yaml](http://yaml.org/) file containing the desired configuration. -The file must conform to [this](schemas/test_config_v1_3.yaml) JSON schema. +The file must conform to [this](schemas/test_config_v1_4.yaml) JSON schema. Graderutils will output JSON schema validation errors if a given test configuration file is invalid. Examples of possible test configurations are found below and in [this](test_config.yaml) example file. diff --git a/graderutils/schemaobjects.py b/graderutils/schemaobjects.py index eda05a6..f950ac2 100644 --- a/graderutils/schemaobjects.py +++ b/graderutils/schemaobjects.py @@ -14,7 +14,7 @@ SCHEMA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "schemas")) -def build_schemas(version="v1_3"): +def build_schemas(version="v1_4"): """ Build all feedback schemas and the graderutils test_config schema. """ diff --git a/graderutils/schemas/test_config_v1_3.yaml b/graderutils/schemas/test_config_v1_4.yaml similarity index 99% rename from graderutils/schemas/test_config_v1_3.yaml rename to graderutils/schemas/test_config_v1_4.yaml index f0957e3..6969c0a 100644 --- a/graderutils/schemas/test_config_v1_3.yaml +++ b/graderutils/schemas/test_config_v1_4.yaml @@ -112,7 +112,6 @@ properties: - python_whitelist - plain_text_blacklist - plain_text_whitelist - - image_type - labview - xlsm - html diff --git a/graderutils/validation.py b/graderutils/validation.py index cbd3b74..236d48c 100644 --- a/graderutils/validation.py +++ b/graderutils/validation.py @@ -10,7 +10,6 @@ import collections import contextlib import html5lib -import imghdr import importlib import io import re @@ -182,14 +181,6 @@ def ast_dump(source): return '\n'.join(map(ast.dump, ast.walk(ast.parse(source)))) -def get_image_type_errors(image, expected_type): - errors = {} - actual_type = imghdr.what(image) - if actual_type != expected_type: - errors["message"] = "Expected type '{}' but got '{}'.".format(expected_type, actual_type) - return errors - - def _import_module_from_python_file(filename): err = io.StringIO() module = None @@ -362,9 +353,6 @@ def _get_validation_error(validation, filename, config): get_matches = _get_plain_text_whitelist_misses error = get_restricted_syntax_matches(config, get_matches) - elif validation == "image_validation_type": - error = get_image_type_errors(filename) - elif validation == "labview": error = get_labview_errors(filename) diff --git a/graderutils_format/templates/base.html b/graderutils_format/templates/base.html index a73f852..3c48e9d 100644 --- a/graderutils_format/templates/base.html +++ b/graderutils_format/templates/base.html @@ -11,9 +11,9 @@ integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"> + href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" + integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" + crossorigin="anonymous">
@@ -21,9 +21,9 @@ {% block body %} {% endblock %} - +