Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graderutils/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion graderutils/schemaobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ properties:
- python_whitelist
- plain_text_blacklist
- plain_text_whitelist
- image_type
- labview
- xlsm
- html
12 changes: 0 additions & 12 deletions graderutils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import collections
import contextlib
import html5lib
import imghdr
import importlib
import io
import re
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions graderutils_format/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI="
crossorigin="anonymous"></script>
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu"
crossorigin="anonymous">
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
crossorigin="anonymous">
</head>

<body>
<div class="container">
{% block body %}
{% endblock %}
</div>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js"
integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy"
crossorigin="anonymous"></script>
</body>

</html>
90 changes: 37 additions & 53 deletions graderutils_format/templates/default.css
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
/* Increase size of labels in grader result panels */
div.grading-feedback h4 {
margin-top: 0;
}
span.feedback-label {
font-size: 14px;
}
/* Add space between different test groups */
div.grading-task {
margin-top: 40px;
margin-bottom: 40px;
}
/* Add more separation between last test group and unittest terminal output */
div.full-test-output {
margin-top: 35px;
}
/* Bootstrap h4 bottom margins are by default a bit too small */
h4.testgroup-header {
margin-bottom: 20px;
}
/* Disable automatic horizontal scroll of preformatted text blocks */
div.pre-wrap pre {
white-space: pre-wrap;
border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
background-color: var(--bs-tertiary-bg);
}
div.warning-messages {
margin-top: 35px;
}
div.grader-info {
color: gray;
div.pre-wrap pre:last-of-type {
margin-block: 0px 0px;
}
span.iotester-warning {
color: red;
color: var(--bs-danger);
}
span.iotester-basic {
color: #a5409e;
Expand All @@ -38,44 +27,39 @@ span.iotester-correct {
background-color: #8cde8c;
}
span.iotester-input {
background-color: #49d8ff;
background-color: #7ed9f5;
}
/* Traceback button top margin is by default a bit too small */
button.btn-traceback {
margin-top: 10px;
[data-bs-theme="dark"] span.iotester-basic {
color: #d0a7ff;
}
/* A table is used for wrapping long panel text to multiple lines and to prevent it from pushing badges and labels down */
div.panel-default > .panel-heading {
display: table;
width: 100%;
[data-bs-theme="dark"] span.iotester-incorrect {
background-color: #8b2e2e;
}
/* Table cell for the text part of panel titles */
div.panel-text {
display: table-cell;
[data-bs-theme="dark"] span.iotester-correct {
background-color: #1e6e1e;
}
/* Vertically center and reserve space for the badges and labels of panel titles */
div.panel-annotation {
display: table-cell;
vertical-align: middle;
min-width: 200px;
[data-bs-theme="dark"] span.iotester-input {
background-color: #0e5a8a;
}
/* Add space between panel titles and points badges, and increase badge size */
div.grading-task .panel-default > .panel-heading .badge {
div.grading-feedback .accordion-header .badge {
font-size: 14px;
margin-right: 10px;
}
/* Green color for badges and labels when tests pass */
div.grading-task .panel-default > .panel-heading .color-passed {
color: #fff;
background-color: #00803c;
}
/* Red color for badges and labels when tests fail */
div.grading-task .panel-default > .panel-heading .color-failed {
color: #fff;
background-color: #a50000;
}
/* Orange color for badges and labels when errors occur */
div.grading-task .panel-default > .panel-heading .color-error {
color: #fff;
background-color: #a6670e;
}
span.panel-title {
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
font-weight: 700;
}
/* Fix borders with vertically spaced accordion */
div.spaced-accordion > .accordion-item {
border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
border-radius: var(--bs-accordion-border-radius);
margin-top: 1rem;
}
div.spaced-accordion > .accordion-item > .accordion-header > .accordion-button:not(.collapsed) {
border-top-left-radius: var(--bs-accordion-inner-border-radius);
border-top-right-radius: var(--bs-accordion-inner-border-radius);
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
div.spaced-accordion > .accordion-item > .accordion-header > .accordion-button.collapsed {
border-radius: var(--bs-accordion-inner-border-radius);
}
Loading