diff --git a/judge/migrations/0196_add_interactive_testlib.py b/judge/migrations/0196_add_interactive_testlib.py new file mode 100644 index 00000000..532ca8ba --- /dev/null +++ b/judge/migrations/0196_add_interactive_testlib.py @@ -0,0 +1,61 @@ +# Generated by Django 3.2.25 on 2024-11-20 22:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("judge", "0195_signature_grader"), + ] + + operations = [ + migrations.AlterField( + model_name="problemdata", + name="checker", + field=models.CharField( + blank=True, + choices=[ + ("standard", "Standard"), + ("floats", "Floats"), + ("floatsabs", "Floats (absolute)"), + ("floatsrel", "Floats (relative)"), + ("rstripped", "Non-trailing spaces"), + ("sorted", "Unordered"), + ("identical", "Byte identical"), + ("linecount", "Line-by-line"), + ("custom", "Custom checker (PY)"), + ("customcpp", "Custom checker (CPP)"), + ("interact", "Interactive"), + ("testlib", "Testlib"), + ("interacttl", "Interactive (Testlib)"), + ], + max_length=10, + verbose_name="checker", + ), + ), + migrations.AlterField( + model_name="problemtestcase", + name="checker", + field=models.CharField( + blank=True, + choices=[ + ("standard", "Standard"), + ("floats", "Floats"), + ("floatsabs", "Floats (absolute)"), + ("floatsrel", "Floats (relative)"), + ("rstripped", "Non-trailing spaces"), + ("sorted", "Unordered"), + ("identical", "Byte identical"), + ("linecount", "Line-by-line"), + ("custom", "Custom checker (PY)"), + ("customcpp", "Custom checker (CPP)"), + ("interact", "Interactive"), + ("testlib", "Testlib"), + ("interacttl", "Interactive (Testlib)"), + ], + max_length=10, + verbose_name="checker", + ), + ), + ] diff --git a/judge/models/problem_data.py b/judge/models/problem_data.py index a5b4808c..12a78b65 100644 --- a/judge/models/problem_data.py +++ b/judge/models/problem_data.py @@ -42,6 +42,7 @@ def problem_directory_file(data, filename): ("customcpp", _("Custom checker (CPP)")), ("interact", _("Interactive")), ("testlib", _("Testlib")), + ("interacttl", _("Interactive (Testlib)")), ) diff --git a/judge/utils/problem_data.py b/judge/utils/problem_data.py index 807c22b2..c21ddbda 100644 --- a/judge/utils/problem_data.py +++ b/judge/utils/problem_data.py @@ -241,14 +241,14 @@ def make_checker(case): if self.data.output_prefix is not None: init["output_prefix_length"] = self.data.output_prefix if self.data.checker: - if self.data.checker == "interact": + if self.data.checker in ("interact", "interacttl"): interactor_path = split_path_first(self.data.interactive_judge.name) if len(interactor_path) != 2: raise ProblemDataError(_("Invalid interactor judge")) init["interactive"] = { "files": interactor_path[1], "feedback": True, - "type": "lqdoj", + "type": "lqdoj" if self.data.checker == "interact" else "testlib", } init["unbuffered"] = True else: diff --git a/templates/problem/data.html b/templates/problem/data.html index 2f95d029..5682a011 100644 --- a/templates/problem/data.html +++ b/templates/problem/data.html @@ -164,9 +164,9 @@ $checker.change(function () { $tr_checker.toggle($checker.val() == 'custom').change(); $tr_validator.toggle($checker.val() == 'customcpp' || $checker.val() == 'testlib').change(); - $tr_interactive.toggle($checker.val() == 'interact').change(); + $tr_interactive.toggle($checker.val() == 'interact' || $checker.val() == 'interacttl').change(); - $sample.toggle(['custom', 'customcpp', 'interact'].includes($checker.val())).change(); + $sample.toggle(['custom', 'customcpp', 'interact', 'interacttl'].includes($checker.val())).change(); }).change(); $ioi_signature.change(function() {