diff --git a/webapp/src/Twig/TwigExtension.php b/webapp/src/Twig/TwigExtension.php index 143af85f52..d801f58f49 100644 --- a/webapp/src/Twig/TwigExtension.php +++ b/webapp/src/Twig/TwigExtension.php @@ -1112,7 +1112,8 @@ public function printMetadata(?string $metadata): string . Utils::printsize((int)($metadata['memory-bytes'])) . ', ' . ' ' . 'exit-code: ' . $metadata['exitcode'] - . (($metadata['signal'] ?? -1) > 0 ? ' signal: ' . $metadata['signal'] : ''); + . (($metadata['signal'] ?? -1) > 0 ? ' signal: ' . $metadata['signal'] : '') + . ''; } public function printWarningContent(ExternalSourceWarning $warning): string diff --git a/webapp/templates/jury/submission.html.twig b/webapp/templates/jury/submission.html.twig index b965604dce..4a540d8967 100644 --- a/webapp/templates/jury/submission.html.twig +++ b/webapp/templates/jury/submission.html.twig @@ -83,45 +83,130 @@ {% endfor %} {% endif %} -
-

- Submission {{ submission.submitid }} - {% if submission.originalSubmission %} - {% set origSubmissionUrl = path('jury_submission', {submitId: submission.originalSubmission.submitid}) %} - (resubmit of s{{ submission.originalSubmission.submitid }}) - {% endif %} - {% if submission.resubmissions is not empty %} - (resubmitted as - {%- for resubmission in submission.resubmissions -%} - {% set resubmissionUrl = path('jury_submission', {submitId: resubmission.submitid}) %} - s{{ resubmission.submitid }} - {%- if not loop.last -%},{%- endif -%} - {%- endfor -%} - ) - {% endif %} - {% if not submission.valid %} - (ignored) - {% endif %} -

- {% if not submission.importError %} - {% if is_granted('ROLE_ADMIN') %} - {% if submission.valid %} - {% set action = 'ignore' %} - {% else %} - {% set action = 'unignore' %} +
+
+

+ Submission s{{ submission.submitid }} + {% if submission.originalSubmission %} + {% set origSubmissionUrl = path('jury_submission', {submitId: submission.originalSubmission.submitid}) %} + (resubmit of s{{ submission.originalSubmission.submitid }}) + {% endif %} + {% if submission.resubmissions is not empty %} + (resubmitted as + {%- for resubmission in submission.resubmissions -%} + {% set resubmissionUrl = path('jury_submission', {submitId: resubmission.submitid}) %} + s{{ resubmission.submitid }} + {%- if not loop.last -%},{%- endif -%} + {%- endfor -%} + ) + {% endif %} + {% if not submission.valid %} + (ignored) {% endif %} -
- - -
+

+ {% if not submission.importError %} +
+ {% if is_granted('ROLE_ADMIN') %} + {% if submission.valid %} + {% set action = 'ignore' %} + {% else %} + {% set action = 'unignore' %} + {% endif %} +
+ + +
+ {% endif %} + + {% include 'jury/partials/rejudge_form.html.twig' with {table: 'submission', id: submission.submitid} %} +
{% endif %} - {% include 'jury/partials/rejudge_form.html.twig' with {table: 'submission', id: submission.submitid} %} - {% endif %} + {# Condensed submission info on a single line with icons #} +
+ + + + {{ submission.team.effectiveName }} {{ submission.team | entityIdBadge('t') }} + + + + {% if submission.user %} + + + + {{ submission.user.username }} {{ submission.user | entityIdBadge('u') }} + + + {% endif %} + + {% if current_contest.cid != submission.contest.cid %} + + + + {{ submission.contest.shortname }} + {{ submission.contest | entityIdBadge('c') }} + + + {% endif %} + + + + + {% if submission.contestProblem %} + {{ submission.contestProblem | problemBadge }} {{ submission.problem.name }} + {% else %} + {{ submission.problem.name }} + {% endif %} + {{ submission.problem | entityIdBadge('p') }} + + + + + + + {{ submission.language.name }} + {{ submission.language | entityIdBadge }} + + + + + + + {{ submission.submittime | printtime(null, submission.contest) }} + + + + + + {{ submission.problem.timelimit * submission.language.timeFactor }}s + + + + + + View {{ submission.files | printFiles }} + + + + {% if external_ccs_submission_url is not empty %} + {% set externalSubmissionUrl = submission | externalCcsUrl %} + {% if externalSubmissionUrl is not empty %} + + + + View in external CCS + + + {% endif %} + {% endif %} +
+
+
{% if not submission.valid %}
This submission is not used during scoreboard calculations.
@@ -140,86 +225,6 @@
{% endif %} - {# Condensed submission info on a single line with icons #} -
- - - - {{ submission.team.effectiveName }} {{ submission.team | entityIdBadge('t') }} - - - - {% if submission.user %} - - - - {{ submission.user.username }} {{ submission.user | entityIdBadge('u') }} - - - {% endif %} - - {% if current_contest.cid != submission.contest.cid %} - - - - {{ submission.contest.shortname }} - {{ submission.contest | entityIdBadge('c') }} - - - {% endif %} - - - - - {% if submission.contestProblem %} - {{ submission.contestProblem | problemBadge }}: {{ submission.problem.name }} - {% else %} - {{ submission.problem.name }} - {% endif %} - {{ submission.problem | entityIdBadge('p') }} - - - - - - - {{ submission.language.name }} - {{ submission.language | entityIdBadge }} - - - - - - - {{ submission.submittime | printtime(null, submission.contest) }} - - - - - - {{ submission.problem.timelimit * submission.language.timeFactor }}s - - - - - - View {{ submission.files | printFiles }} - - - - {% if external_ccs_submission_url is not empty %} - {% set externalSubmissionUrl = submission | externalCcsUrl %} - {% if externalSubmissionUrl is not empty %} - - - - View in external CCS - - - {% endif %} - {% endif %} -
- {% if shadowMode() and submission.externalid %}
External ID: @@ -343,16 +348,11 @@ {% if selectedJudging is not null or externalJudgement is not null %} - {% if (selectedJudging is not null and selectedJudging.result != 'compiler-error') - or (externalJudgement is not null and externalJudgement.result != 'compiler-error') %} - {% include 'jury/partials/submission_graph.html.twig' %} - {% endif %} - {% if selectedJudging is not null %} {# Show judging information #}
-

+

Judging j{{ selectedJudging.judgingid }} {% if selectedJudging.rejudging %} (rejudging @@ -361,27 +361,81 @@ {% elseif not selectedJudging.valid %} (Invalid) {% endif %} -

-   - {% if selectedJudging.debugPackages | length > 0 %} - {% for debug_package in selectedJudging.debugPackages %} - - - - {% endfor %} - {% else %} - {% if not requestedOutputCount %} - - - + + + {% if not submission.importError %} + {% if selectedJudging is null or selectedJudging.result is empty %} + {%- if selectedJudging and selectedJudging.started %} + {{- '' | printValidJuryResult -}} + {%- else %} + {{- 'queued' | printValidJuryResult -}} + {%- endif %} + {%- else %} + {{- selectedJudging.result | printValidJuryResult -}} + {%- endif %} + {%- if submission.stillBusy -%} + (…) + {%- endif -%} + {% endif %} + {%- if lastJudging is not null -%} + {% set lastSubmissionLink = path('jury_submission', {submitId: lastSubmission.submitid}) %}{#- + -#} + (s{{ lastSubmission.submitid }}: {{ lastJudging.result | printResult }}){#- + -#} + {%- endif -%} + {%- if externalJudgement is not null %} + {% if submission.importError %} + External result: {{ externalJudgement.result | printValidJuryResult }} + {% else %} + (external: {{ externalJudgement.result | printValidJuryResult }}) + {% endif %} + {%- endif %} + {%- if selectedJudging is not null and judgehosts is not empty -%} + , on {{ judgehosts | printHosts }} + {% if selectedJudging.starttime %} + {% if selectedJudging.endtime %} + , took {{ selectedJudging.starttime | printHumanTimeDiff(selectedJudging.endtime) }} + {% elseif selectedJudging.valid or selectedJudging.rejudging %} +  [still judging - busy {{ selectedJudging.starttime | printtimediff }}] + {% else %} +  [aborted] + {% endif %} + {% else %} + , not started yet + {% endif %} + {% endif -%} + {%- if externalJudgement is not null %} + (external judging started: {{ externalJudgement.starttime | printtime('H:i:s') }} + {%- if externalJudgement.endtime -%} + , finished in {{ externalJudgement.starttime | printtimediff(externalJudgement.endtime) }}s + {%- else -%} +  [still judging - busy {{ externalJudgement.starttime | printtimediff }}] + {%- endif -%} + ) + {%- endif -%} + + + +
+ {% if selectedJudging.debugPackages | length > 0 %} + {% for debug_package in selectedJudging.debugPackages %} + + + + {% endfor %} + {% else %} + {% if not requestedOutputCount %} + + + + {% endif %} {% endif %} - {% endif %}   {% if not selectedJudging.verified %}
{%- endif %} {%- endif %} +
{% endif %} -
-
- {% if not submission.importError %} - {% if selectedJudging is null or selectedJudging.result is empty %} - {%- if selectedJudging and selectedJudging.started %} - {{- '' | printValidJuryResult -}} - {%- else %} - {{- 'queued' | printValidJuryResult -}} - {%- endif %} - {%- else %} - {{- selectedJudging.result | printValidJuryResult -}} - {%- endif %} - {%- if submission.stillBusy -%} - (…) - {%- endif -%} - {% endif %} - {%- if lastJudging is not null -%} - {% set lastSubmissionLink = path('jury_submission', {submitId: lastSubmission.submitid}) %}{#- - -#} - (s{{ lastSubmission.submitid }}: {{ lastJudging.result | printResult }}){#- - -#} - {%- endif -%} - {%- if externalJudgement is not null %} - {% if submission.importError %} - External result: {{ externalJudgement.result | printValidJuryResult }} - {% else %} - (external: {{ externalJudgement.result | printValidJuryResult }}) - {% endif %} - {%- endif %} - {%- if selectedJudging is not null and judgehosts is not empty -%} - , on {{ judgehosts | printHosts }} - {% if selectedJudging.starttime %} - {% if selectedJudging.endtime %} - , took {{ selectedJudging.starttime | printHumanTimeDiff(selectedJudging.endtime) }} - {% elseif selectedJudging.valid or selectedJudging.rejudging %} -  [still judging - busy {{ selectedJudging.starttime | printtimediff }}] - {% else %} -  [aborted] - {% endif %} - (started: {{ selectedJudging.starttime | printtime('H:i:s') }}) + {# Display compile output #} + {% set color = '#6666FF' %} + {% set message = 'not finished yet' %} + {% set output = null %} + {% if selectedJudging is not null %} + {% set output = selectedJudging.outputCompile(true) %} + {% endif %} + {% if output is not null %} + {% if selectedJudging.result == 'compiler-error' %} + {% set message = 'unsuccessful' %} + {% else %} + {% set message = 'successful' %} + {% if output is not empty %} + {% set outputLines = output | lineCount %} + {% if outputLines == 1 %} + {% set message = message ~ ' (with 1 line of output)' %} {% else %} - , not started yet + {% set message = message ~ ' (with ' ~ outputLines ~ ' lines of output)' %} {% endif %} - {% endif -%} - {%- if externalJudgement is not null %} - (external judging started: {{ externalJudgement.starttime | printtime('H:i:s') }} - {%- if externalJudgement.endtime -%} - , finished in {{ externalJudgement.starttime | printtimediff(externalJudgement.endtime) }}s - {%- else -%} -  [still judging - busy {{ externalJudgement.starttime | printtimediff }}] - {%- endif -%} - ) - {%- endif -%} + {% endif %} + {% endif %} + {% endif %} + Compilation {{ message }} + {% if selectedJudging is not null and selectedJudging.compileMetadata is not null %} + {{ selectedJudging.compileMetadata | printMetadata }} + +
+
{{ selectedJudging.compileMetadata }}
+ {% endif %} + {% if selectedJudging is not null and selectedJudging.result != 'compiler-error' %} + + {% endif %} +
+
Compilation output
+ {% if output is empty %} +
There were no compiler errors or warnings.
+ {% else %} +
{{ output }}
+ {% endif %} +
+
{# Display testcase results #} {% if externalJudgement is not null or (selectedJudging is not null and selectedJudging.result != 'compiler-error') %} @@ -556,55 +608,13 @@
Judging is not ready yet!
{% endif %} - {# Display compile output #} - {% set color = '#6666FF' %} - {% set message = 'not finished yet' %} - {% set output = null %} - {% if selectedJudging is not null %} - {% set output = selectedJudging.outputCompile(true) %} - {% endif %} - {% if output is not null %} - {% if selectedJudging.result == 'compiler-error' %} - {% set message = 'unsuccessful' %} - {% else %} - {% set message = 'successful' %} - {% if output is not empty %} - {% set outputLines = output | lineCount %} - {% if outputLines == 1 %} - {% set message = message ~ ' (with 1 line of output)' %} - {% else %} - {% set message = message ~ ' (with ' ~ outputLines ~ ' lines of output)' %} - {% endif %} - {% endif %} - {% endif %} - {% endif %} -

- - Compilation {{ message }} - -

- {% if selectedJudging is not null and selectedJudging.compileMetadata is not null %} - {{ selectedJudging.compileMetadata | printMetadata }} - -
-
{{ selectedJudging.compileMetadata }}
-
-
-
- {% endif %} -
-
Compilation output
- {% if output is empty %} -
There were no compiler errors or warnings.
- {% else %} -
{{ output }}
+ {% if (selectedJudging is not null and selectedJudging.result != 'compiler-error') + or (externalJudgement is not null and externalJudgement.result != 'compiler-error') %} + {% include 'jury/partials/submission_graph.html.twig' %} {% endif %} -
+ +
+
{% if externalJudgement is not null or (selectedJudging is not null and selectedJudging.result != 'compiler-error') %} {# Show run info. Only when compilation was successful or we have an external judgement #} @@ -665,7 +675,7 @@ | .../{{ runsOutput[runIdx].testcasedir | split('/') | last }}{#- -#} {% endif %} - +
{% if run.firstJudgingRun is not null %}