Skip to content
Snippets Groups Projects
Commit 5df7df2a authored by Dominik Seeger's avatar Dominik Seeger
Browse files

tests are now created when importing via the frontend

parent 4cb7711c
No related branches found
No related tags found
No related merge requests found
Pipeline #111129 failed
......@@ -41,26 +41,6 @@ class Feedback(models.Model):
# the denominators that are allowed for the decimal score interpreted as a fraction
ALLOWED_DENOMINATORS = [1, 2]
# how was this feedback created
(
WAS_EMPTY,
FAILED_UNIT_TESTS,
DID_NOT_COMPILE,
COULD_NOT_LINK,
MANUAL,
) = range(5)
ORIGIN = (
(WAS_EMPTY, 'was empty'),
(FAILED_UNIT_TESTS, 'passed unittests'),
(DID_NOT_COMPILE, 'did not compile'),
(COULD_NOT_LINK, 'could not link'),
(MANUAL, 'created by a human. yak!'),
)
origin = models.IntegerField(
choices=ORIGIN,
default=MANUAL,
)
class Meta:
verbose_name = "Feedback"
verbose_name_plural = "Feedback Set"
......
......@@ -34,19 +34,14 @@ RUSTY_HEKTOR_MAX_VER = "<5.0.0"
valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False}
ORIGIN_ORDER = {
Feedback.WAS_EMPTY,
Feedback.DID_NOT_COMPILE,
}
# the camel-case entries are here for the import via frontend functionality.
TEST_ORDER = (
'EmptyTest',
'_empty_test',
'CompileTest',
'_compile_test',
)
FEEDBACK_MAPPER = dict(zip(TEST_ORDER, ORIGIN_ORDER))
user_factory = GradyUserFactory()
......@@ -199,7 +194,6 @@ def add_feedback_if_test_recommends_it(test_obj):
of_submission=test_obj.submission,
defaults={
'score': 0,
'origin': FEEDBACK_MAPPER[test_obj.name],
'is_final': True,
}
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment