diff --git a/judge/migrations/0124_auto_20220602_1116.py b/judge/migrations/0124_auto_20220602_1116.py index d8c045d..5b15aef 100644 --- a/judge/migrations/0124_auto_20220602_1116.py +++ b/judge/migrations/0124_auto_20220602_1116.py @@ -6,18 +6,22 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('judge', '0123_auto_20220502_2356'), + ("judge", "0123_auto_20220502_2356"), ] operations = [ migrations.AddField( - model_name='problemdata', - name='fileio_input', - field=models.TextField(blank=True, null=True, verbose_name='input file name'), + model_name="problemdata", + name="fileio_input", + field=models.TextField( + blank=True, null=True, verbose_name="input file name" + ), ), migrations.AddField( - model_name='problemdata', - name='fileio_output', - field=models.TextField(blank=True, null=True, verbose_name='output file name'), + model_name="problemdata", + name="fileio_output", + field=models.TextField( + blank=True, null=True, verbose_name="output file name" + ), ), ] diff --git a/judge/migrations/0125_auto_20220602_1216.py b/judge/migrations/0125_auto_20220602_1216.py new file mode 100644 index 0000000..18bee1c --- /dev/null +++ b/judge/migrations/0125_auto_20220602_1216.py @@ -0,0 +1,33 @@ +# Generated by Django 2.2.25 on 2022-06-02 05:16 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("judge", "0124_auto_20220602_1116"), + ] + + operations = [ + migrations.AlterField( + model_name="problemdata", + name="fileio_input", + field=models.TextField( + blank=True, + help_text="Leave empty for stdin", + null=True, + verbose_name="input file name", + ), + ), + migrations.AlterField( + model_name="problemdata", + name="fileio_output", + field=models.TextField( + blank=True, + help_text="Leave empty for stdout", + null=True, + verbose_name="output file name", + ), + ), + ] diff --git a/judge/models/problem_data.py b/judge/models/problem_data.py index 2902bab..f219197 100644 --- a/judge/models/problem_data.py +++ b/judge/models/problem_data.py @@ -106,10 +106,16 @@ class ProblemData(models.Model): validators=[FileExtensionValidator(allowed_extensions=["cpp"])], ) fileio_input = models.TextField( - verbose_name=_("input file name"), blank=True, null=True + verbose_name=_("input file name"), + blank=True, + null=True, + help_text=_("Leave empty for stdin"), ) fileio_output = models.TextField( - verbose_name=_("output file name"), blank=True, null=True + verbose_name=_("output file name"), + blank=True, + null=True, + help_text=_("Leave empty for stdout"), ) __original_zipfile = None diff --git a/judge/views/submission.py b/judge/views/submission.py index 8fdcf4b..65656c2 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -542,8 +542,10 @@ class ProblemSubmissionsBase(SubmissionsListBase): if self.check_contest_in_access_check: self.access_check_contest(request) else: - is_own = hasattr(self, 'is_own') and self.is_own - if not is_own and not self.problem.is_accessible_by(request.user, request.in_contest_mode): + is_own = hasattr(self, "is_own") and self.is_own + if not is_own and not self.problem.is_accessible_by( + request.user, request.in_contest_mode + ): raise Http404() def get(self, request, *args, **kwargs): @@ -805,7 +807,9 @@ class UserContestSubmissionsAjax(UserContestSubmissions): context["contest"] = self.contest context["problem"] = self.problem context["profile"] = self.profile - context["profile_id"] = self.request.profile.id if self.request.profile else None + context["profile_id"] = ( + self.request.profile.id if self.request.profile else None + ) contest_problem = self.contest.contest_problems.get(problem=self.problem) for s in context["submissions"]: @@ -823,4 +827,4 @@ class UserContestSubmissionsAjax(UserContestSubmissions): try: return super(UserContestSubmissionsAjax, self).get(request, *args, **kwargs) except Http404: - return HttpResponse(_("You don't have permission to access.")) \ No newline at end of file + return HttpResponse(_("You don't have permission to access.")) diff --git a/locale/vi/LC_MESSAGES/django.po b/locale/vi/LC_MESSAGES/django.po index d5f0587..08d7b4e 100644 --- a/locale/vi/LC_MESSAGES/django.po +++ b/locale/vi/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: lqdoj2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-02 11:58+0700\n" +"POT-Creation-Date: 2022-06-02 12:17+0700\n" "PO-Revision-Date: 2021-07-20 03:44\n" "Last-Translator: Icyene\n" "Language-Team: Vietnamese\n" @@ -1676,10 +1676,18 @@ msgstr "" msgid "input file name" msgstr "tên file input" +#: judge/models/problem_data.py:109 +msgid "Leave empty for stdin" +msgstr "Để trống nếu nhập từ bàn phím" + #: judge/models/problem_data.py:112 judge/models/problem_data.py:190 msgid "output file name" msgstr "tên file output" +#: judge/models/problem_data.py:112 +msgid "Leave empty for stdout" +msgstr "Để trống nếu xuất ra màn hình" + #: judge/models/problem_data.py:171 msgid "problem data set" msgstr "tập hợp dữ liệu bài" @@ -4387,6 +4395,19 @@ msgstr "Hướng dẫn" msgid "View YAML" msgstr "Xem YAML" +#: templates/problem/data.html:454 +msgid "Autofill testcases" +msgstr "Tự động điền test" + +#: templates/problem/data.html:457 templates/problem/problem.html:302 +msgid "Problem type" +msgid_plural "Problem types" +msgstr[0] "Dạng bài" + +#: templates/problem/data.html:464 +msgid "Fill testcases" +msgstr "Điền test" + #: templates/problem/data.html:468 templates/problem/data.html:519 msgid "Apply!" msgstr "Lưu!" @@ -4670,11 +4691,6 @@ msgid "Author:" msgid_plural "Authors:" msgstr[0] "Tác giả:" -#: templates/problem/problem.html:302 -msgid "Problem type" -msgid_plural "Problem types" -msgstr[0] "Dạng bài" - #: templates/problem/problem.html:315 msgid "Allowed languages" msgstr "Ngôn ngữ cho phép" diff --git a/templates/problem/data.html b/templates/problem/data.html index ce0eb9b..1b77d85 100644 --- a/templates/problem/data.html +++ b/templates/problem/data.html @@ -451,17 +451,17 @@
- + | - Problem type: + {{_('Problem type')}}: - Fill testcases + {{_('Fill testcases')}} |
---|