diff --git a/.editorconfig b/.editorconfig index b588bb9bb4012cf66119d6571257d17cc7577e39..73622a70e09e90a96b57cc57fa3ef406dab8b43e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -28,3 +28,10 @@ indent_style = tab [{package.json,.travis.yml}] indent_style = space indent_size = 2 + +# Frontend +[*.{js,jsx,ts,tsx,vue}] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/core/migrations/0022_remove_feedback_origin.py b/core/migrations/0022_remove_feedback_origin.py new file mode 100644 index 0000000000000000000000000000000000000000..798dccf984558b12ce29f2cf5a65decf7df0d114 --- /dev/null +++ b/core/migrations/0022_remove_feedback_origin.py @@ -0,0 +1,17 @@ +# Generated by Django 2.1.13 on 2019-10-12 15:11 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0021_merge_20190902_1246'), + ] + + operations = [ + migrations.RemoveField( + model_name='feedback', + name='origin', + ), + ] diff --git a/core/models/feedback.py b/core/models/feedback.py index 742f94289011a95fe7c5ff4fbd913c7059fc993e..ec36f63b1bbe6a5bb32b7f5a497c93869b12bc40 100644 --- a/core/models/feedback.py +++ b/core/models/feedback.py @@ -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" diff --git a/core/tests/test_import_views.py b/core/tests/test_import_views.py index 3784b85f27567166169ff71cb546728e17ed53b2..3d08b11337d69f5eccd050aea14aaf9639af75ac 100644 --- a/core/tests/test_import_views.py +++ b/core/tests/test_import_views.py @@ -6,7 +6,7 @@ from util.factories import GradyUserFactory test_data = { "meta": { - "version": "4.0.0" + "version": "5.0.0" }, "module": { "module_reference": "test", @@ -21,12 +21,12 @@ test_data = { "submissions": [ { "code": "some messy, perhaps incorrect stuff", - "tests": {}, + "tests": [], "type": "[a0] coding stuff" }, { "code": "i don't know man", - "tests": {}, + "tests": [], "type": "[a1] improvise" } ], diff --git a/functional_tests/data/hektor.json b/functional_tests/data/hektor.json index 571ab05fe8718217a9fcfc90919fa75c987007a7..1c0c4d099753176111ecd9379172b36fdd7e6fde 100644 --- a/functional_tests/data/hektor.json +++ b/functional_tests/data/hektor.json @@ -1,6 +1,6 @@ { "meta": { - "version": "4.0.0" + "version": "5.0.0" }, "module": { "module_reference": "B.Inf.1801", diff --git a/util/importer.py b/util/importer.py index 21fa74e77ee1d15a45784108ca4fe4b356f3c10a..5842c3369ca0b3a96975b83b034ad1483a620a78 100644 --- a/util/importer.py +++ b/util/importer.py @@ -29,24 +29,11 @@ PASSWORDS = '.importer_passwords' YES = 'Y/n' NO = 'y/N' -RUSTY_HEKTOR_MIN_VER = ">=4.0.0" -RUSTY_HEKTOR_MAX_VER = "<5.0.0" +RUSTY_HEKTOR_MIN_VER = ">=5.0.0" +RUSTY_HEKTOR_MAX_VER = "<6.0.0" valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False} - -ORIGIN_ORDER = { - Feedback.WAS_EMPTY, - Feedback.DID_NOT_COMPILE, -} - -TEST_ORDER = ( - 'EmptyTest', - 'CompileTest', -) - -FEEDBACK_MAPPER = dict(zip(TEST_ORDER, ORIGIN_ORDER)) - user_factory = GradyUserFactory() @@ -177,8 +164,7 @@ def add_tests(submission_obj, tests): defaults={'is_active': False} ) - for name in (name for name in TEST_ORDER if name in tests): - test_data = tests[name] + for test_data in tests: test_obj, created = Test.objects.update_or_create( name=test_data['name'], submission=submission_obj, @@ -199,7 +185,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, } )