diff --git a/judge/views/submission.py b/judge/views/submission.py index 68176be..d130062 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -152,8 +152,11 @@ def get_cases_data(submission): case_data = get_problem_case(submission.problem, files) problem_data = {} - for count, case in enumerate(testcases): - problem_data[count + 1] = {'input': case_data[case.input_file], + count = 0 + for case in testcases: + if case.type != 'C': continue + count += 1 + problem_data[count] = {'input': case_data[case.input_file], 'answer': case_data[case.output_file]} return problem_data @@ -167,6 +170,7 @@ class SubmissionStatus(SubmissionDetailBase): submission = self.object context['last_msg'] = event.last() context['batches'] = group_test_cases(submission.test_cases.all()) + print(context['batches']) context['time_limit'] = submission.problem.time_limit contest = submission.contest_or_none diff --git a/resources/submission.scss b/resources/submission.scss index ea71252..c66a718 100644 --- a/resources/submission.scss +++ b/resources/submission.scss @@ -210,7 +210,6 @@ label[for="language"], label[for="status"] { padding-left: 1em; padding-bottom: 3px; padding-top: 3px; - display: inline-block; } // .batch-cases .case-row td b { @@ -237,7 +236,7 @@ label[for="language"], label[for="status"] { font-family: Consolas; } - #testcases-table { + .testcases-table { width: 100%; border: 1px solid grey; border-radius: 0.5em; diff --git a/templates/submission/status-testcases.html b/templates/submission/status-testcases.html index f37eb79..01462da 100644 --- a/templates/submission/status-testcases.html +++ b/templates/submission/status-testcases.html @@ -25,55 +25,70 @@
{{_('Overall: ')}} + {% if request.in_contest and submission.contest_or_none %} + {% with contest=submission.contest_or_none %} + ({{ _('%(points)s/%(total)s points', points=contest.points|roundfloat(3), + total=contest.problem.points|floatformat(-1)) }}) + {% endwith %} + {% else %} + {{ _('%(points)s/%(total)s', points=submission.points|roundfloat(3), + total=submission.problem.points|floatformat(-1)) }} + {% endif %} + | + +{{submission.long_status}} | + +{{_('Point: ')}} + {{ submission.case_points|floatformat(1) }}/{{ submission.case_total|floatformat(0) }} + + | + +{{_('Time: ')}} + {% if submission.result == "TLE" %} + --- + {% else %} + {{ (submission.time * 1000)|floatformat(0) }} ms + {% endif %} + + | + +{{_('Memory: ')}}{{ submission.memory|kbdetailformat }} | +
+ {{ _('Batch ') }}#{{ loop.index }} + | ++ {% if batch_AC %} + + {% else %} + + {% endif %} + | ++ + {{_('Point')}}: + + {{ _('%(points)s/%(total)s', points=batch.points|floatformat(1), total=batch.total|floatformat(0)) }} + | ++ | + |
{{_('Overall: ')}} - {% if request.in_contest and submission.contest_or_none %} - {% with contest=submission.contest_or_none %} - ({{ _('%(points)s/%(total)s points', points=contest.points|roundfloat(3), - total=contest.problem.points|floatformat(-1)) }}) - {% endwith %} - {% else %} - {{ _('%(points)s/%(total)s', points=submission.points|roundfloat(3), - total=submission.problem.points|floatformat(-1)) }} - {% endif %} - | - -{{submission.long_status}} | - -{{_('Point: ')}} - {{ submission.case_points|floatformat(1) }}/{{ submission.case_total|floatformat(0) }} - - | - -{{_('Time: ')}} - {% if submission.result == "TLE" %} - --- - {% else %} - {{ (submission.time * 1000)|floatformat(0) }} ms - {% endif %} - - | - -{{_('Memory: ')}}{{ submission.memory|kbdetailformat }} | -
@@ -83,9 +98,9 @@ {%- if batch.id -%} {{ _('Case') }} #{{ loop.index }}: {%- elif is_pretest -%} - {{ _('Pretest') }} #{{ test_case_id() }}: + {{ _('Pretest') }} #{{ loop.index }}: {%- else -%} - {{ _('Test case') }} #{{ test_case_id() }}: + {{ _('Test case') }} #{{ loop.index }}: {%- endif -%} | @@ -95,9 +110,14 @@ - {% if not batch.id %} -{{_('Point')}}: {{ case.points|floatformat }}/{{ case.total|floatformat(0) }} | - {% endif %} +{{_('Point')}}: + {% if not batch.id %} + {{ case.points|floatformat }}/{{ case.total|floatformat(0) }} + {% else %} + - + {% endif %} + | +{%- if case.status != 'SC' -%} @@ -112,43 +132,41 @@ | {% if case.status != 'SC' %}{{_('Memory')}}: {{ case.memory|kbdetailformat }}{% endif %} |
{{ case.output|linebreaksbr }}- {% if batch.id %}
{{ curr_data['answer']|linebreaksbr }}+ {% endif %} + + {% if case.extended_feedback or case.feedback %} + {{ _('Judge feedback:') }} + {% if case.feedback %} +
{{ case.feedback|linebreaksbr }}+ {% endif %} + {% if case.extended_feedback %} +
{{ case.extended_feedback|linebreaksbr }}+ {% endif %} + {% endif %} + + + + {% endif %} + {% endfor %} {% endfor %} +