Skip to content

Commit 9cea18e

Browse files
committed
Simplify test case run display.
1 parent d9c9044 commit 9cea18e

File tree

3 files changed

+26
-42
lines changed

3 files changed

+26
-42
lines changed

webapp/public/js/domjudge.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,6 @@ function collapse(x)
117117
$(x).toggleClass('d-none');
118118
}
119119

120-
function togglelastruns()
121-
{
122-
var names = {'lastruntime':0, 'lastresult':1, 'lasttcruns':2};
123-
for (var name in names) {
124-
var cells = document.getElementsByClassName(name);
125-
for (var i = 0; i < cells.length; i++) {
126-
var style = 'inline';
127-
if (name === 'lasttcruns') {
128-
style = 'table-row';
129-
}
130-
cells[i].style.display = (cells[i].style.display === 'none') ? style : 'none';
131-
}
132-
}
133-
}
134-
135120
// TODO: We should probably reload the page if the clock hits contest
136121
// start (and end?).
137122
function updateClock()

webapp/public/style_domjudge.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,3 +655,7 @@ blockquote {
655655
color: DimGray;
656656
margin-left: auto;
657657
}
658+
659+
.lasttcruns, .lastresult {
660+
opacity: 0.5;
661+
}

webapp/templates/jury/submission.html.twig

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@
414414
<div class="mb-2">
415415
<div>
416416
{% if not submission.importError %}
417-
Result:
418417
{% if selectedJudging is null or selectedJudging.result is empty %}
419418
{%- if selectedJudging and selectedJudging.started %}
420419
{{- '' | printValidJuryResult -}}
@@ -431,7 +430,7 @@
431430
{%- if lastJudging is not null -%}
432431
{% set lastSubmissionLink = path('jury_submission', {submitId: lastSubmission.submitid}) %}{#-
433432
-#}<span class="lastresult">
434-
(<a href="{{ lastSubmissionLink }}">s{{ lastSubmission.submitid }}</a>: {{ lastJudging.result }}){#-
433+
(<a href="{{ lastSubmissionLink }}">s{{ lastSubmission.submitid }}</a>: {{ lastJudging.result | printResult }}){#-
435434
-#}</span>
436435
{%- endif -%}
437436
{%- if externalJudgement is not null %}
@@ -472,14 +471,15 @@
472471
<table>
473472
{% if not submission.importError %}
474473
<tr>
475-
<td>testcase runs:</td>
476474
<td>
477475
{% if selectedJudging is null %}
478476
{% set judgingDone = false %}
479477
{% else %}
480478
{% set judgingDone = selectedJudging.endtime is not empty %}
481479
{% endif %}
482480
{{ runs | displayTestcaseResults(judgingDone) }}
481+
</td>
482+
<td>
483483
{% if selectedJudging is not null and runsOutstanding %}
484484
{% if selectedJudging.judgeCompletely %}
485485
<i class="fas fa-balance-scale" title="remaining test cases requested to be judged"></i>
@@ -493,45 +493,40 @@
493493
</td>
494494
</tr>
495495
{% endif %}
496-
{% if lastJudging is not null %}
497-
<tr class="lasttcruns">
496+
{% if externalJudgement is not null %}
497+
<tr>
498498
<td>
499-
<a href="{{ lastSubmissionLink }}">s{{ lastSubmission.submitid }}</a> runs:
499+
{{ externalRuns | displayTestcaseResults(externalJudgement.endtime is not empty, true) }}
500500
</td>
501501
<td>
502-
{{ lastRuns | displayTestcaseResults(lastJudging.endtime is not empty) }}
502+
{% if externalSubmissionUrl and externalSubmissionUrl is not empty %}
503+
<a href="{{ externalSubmissionUrl }}">
504+
{% endif %}
505+
external {{ externalJudgement.extjudgementid }}
506+
{% if externalSubmissionUrl and externalSubmissionUrl is not empty %}
507+
</a>
508+
{% endif %}
503509
</td>
504510
</tr>
505511
{% endif %}
506-
{% if externalJudgement is not null %}
507-
<tr>
508-
<td>external runs:</td>
512+
{% if lastJudging is not null %}
513+
<tr class="lasttcruns">
509514
<td>
510-
{{ externalRuns | displayTestcaseResults(externalJudgement.endtime is not empty, true) }}
515+
{{ lastRuns | displayTestcaseResults(lastJudging.endtime is not empty) }}
516+
</td>
517+
<td>
518+
<a href="{{ lastSubmissionLink }}">previous s{{ lastSubmission.submitid }}</a>
519+
{% if lastJudging.verifyComment %}
520+
<span class="prevsubmit">(verify comment: '{{ lastJudging.verifyComment }}')</span>
521+
{% endif %}
511522
</td>
512523
</tr>
513524
{% endif %}
514525
</table>
515526

516-
{# Show JS toggle of previous submission results #}
517-
{% if lastJudging is not null %}
518-
<span class="testcases_prev">
519-
<a href="javascript:togglelastruns();">show/hide</a>
520-
results of previous <a href="{{ lastSubmissionLink }}">submission s{{ lastSubmission.submitid }}</a>
521-
{% if lastJudging.verifyComment %}
522-
<span class="prevsubmit">(verify comment: '{{ lastJudging.verifyComment }}')</span>
523-
{% endif %}
524-
</span>
525-
{% endif %}
526527
{% endif %}
527528
</div>
528529

529-
<script>
530-
$(function () {
531-
togglelastruns();
532-
});
533-
</script>
534-
535530
{# Show verify info, but only when a result is known #}
536531
{% if selectedJudging is not null and selectedJudging.result is not empty %}
537532
{% include 'jury/partials/verify_form.html.twig' with {

0 commit comments

Comments
 (0)