Reformat html files
This commit is contained in:
parent
9a208ca108
commit
52f1e77fe1
205 changed files with 11096 additions and 11086 deletions
|
@ -1,16 +1,16 @@
|
|||
{% extends "common-content.html" %}
|
||||
|
||||
{% block header %}
|
||||
<span class="submission-info">
|
||||
<span class="submission-date">{{ submission.date|date(_("N j, Y, g:i a")) }}
|
||||
{%- if perms.judge.change_submission and submission.judged_on %}
|
||||
on {{ submission.judged_on.name }}
|
||||
{% endif %}
|
||||
<br>
|
||||
<span>{{ submission.language }}</span>
|
||||
{% if perms.judge.change_submission %}
|
||||
[<a href="{{ url('admin:judge_submission_change', submission.id) }}">{{ _('Admin') }}</a>]
|
||||
{% endif %}
|
||||
</span>
|
||||
<span class="submission-info">
|
||||
<span class="submission-date">{{ submission.date|date(_("N j, Y, g:i a")) }}
|
||||
{%- if perms.judge.change_submission and submission.judged_on %}
|
||||
on {{ submission.judged_on.name }}
|
||||
{% endif %}
|
||||
<br>
|
||||
<span>{{ submission.language }}</span>
|
||||
{% if perms.judge.change_submission %}
|
||||
[<a href="{{ url('admin:judge_submission_change', submission.id) }}">{{ _('Admin') }}</a>]
|
||||
{% endif %}
|
||||
</span>
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
<h3 style="font-weight:bold" class="red">
|
||||
{% if request.user == submission.user.user %}
|
||||
{% trans trimmed %}
|
||||
An internal error occurred while grading, and the {{ SITE_NAME }} administrators have been notified.<br>
|
||||
In the meantime, try resubmitting in a few seconds.
|
||||
{% endtrans %}
|
||||
{% else %}
|
||||
{{ _('An internal error occurred while grading.') }}
|
||||
{% endif %}
|
||||
{% if request.user == submission.user.user %}
|
||||
{% trans trimmed %}
|
||||
An internal error occurred while grading, and the {{ SITE_NAME }} administrators have been notified.<br>
|
||||
In the meantime, try resubmitting in a few seconds.
|
||||
{% endtrans %}
|
||||
{% else %}
|
||||
{{ _('An internal error occurred while grading.') }}
|
||||
{% endif %}
|
||||
</h3>
|
||||
|
||||
{% if submission.error and request.user.is_authenticated %}
|
||||
{% if request.profile.id in submission.problem.editor_ids or perms.judge.edit_all_problem %}
|
||||
<hr style="float:left;width:30%"><br>
|
||||
<h4>{{ _('Error information') }}</h4>
|
||||
<code>{{ submission.error|highlight('pytb', linenos=False) }}</code>
|
||||
{% endif %}
|
||||
{% if request.profile.id in submission.problem.editor_ids or perms.judge.edit_all_problem %}
|
||||
<hr style="float:left;width:30%"><br>
|
||||
<h4>{{ _('Error information') }}</h4>
|
||||
<code>{{ submission.error|highlight('pytb', linenos=False) }}</code>
|
||||
{% endif %}
|
||||
{% endif %}
|
|
@ -1,261 +1,261 @@
|
|||
{% extends "three-column-content.html" %}
|
||||
{% block three_col_js %}
|
||||
<script type="text/javascript">
|
||||
{% if dynamic_update and last_msg %}
|
||||
{% if request.in_contest_mode %}
|
||||
window.current_contest = '{{request.participation.contest.key}}';
|
||||
{% else %}
|
||||
window.current_contest = null;
|
||||
{% endif %}
|
||||
{% if dynamic_user_id %}
|
||||
window.dynamic_user_id = {{dynamic_user_id}};
|
||||
{% else %}
|
||||
window.dynamic_user_id = null;
|
||||
{% endif %}
|
||||
{% if dynamic_problem_id %}
|
||||
window.dynamic_problem_id = {{dynamic_problem_id}};
|
||||
{% else %}
|
||||
window.dynamic_problem_id = null;
|
||||
{% endif %}
|
||||
{% if show_problem %}
|
||||
window.show_problem = 1;
|
||||
{% else %}
|
||||
window.show_problem = 0;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if results_json %}
|
||||
window.results_json = {{ results_json }};
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
{% compress js %}
|
||||
<script type="text/javascript" src="{{ static('event.js') }}"></script>
|
||||
{% if request.user.is_authenticated and perms.judge.rejudge_submission %}
|
||||
<script type="text/javascript">
|
||||
window.rejudge_submission = function (id, e) {
|
||||
if ((typeof e !== 'undefined' && e.ctrlKey) ||
|
||||
confirm('Are you sure you want to rejudge?')) {
|
||||
$.ajax({
|
||||
url: '{{ url('submission_rejudge') }}',
|
||||
type: "POST",
|
||||
data: {
|
||||
id: id
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<script src="{{ static('libs/chart.js/Chart.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var info_float = $('.info-float');
|
||||
var container = $('#content-right');
|
||||
if (window.bad_browser) {
|
||||
container.css('float', 'right');
|
||||
} else if (!featureTest('position', 'sticky')) {
|
||||
fix_div(info_float, 55);
|
||||
$(window).resize(function () {
|
||||
info_float.width(container.width());
|
||||
});
|
||||
info_float.width(container.width());
|
||||
}
|
||||
|
||||
function escapeRegExp(string) {
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
}
|
||||
|
||||
function idAndTextMatcher(params, data) {
|
||||
if ($.trim(params.term) === '')
|
||||
return data;
|
||||
var regex = new RegExp(escapeRegExp(params.term), 'i');
|
||||
return data.text.search(regex) >= 0 || data.id.search(regex) >= 0 ? data : null;
|
||||
}
|
||||
|
||||
$('#status').select2({
|
||||
multiple: 1,
|
||||
placeholder: '{{ _('Filter by status...') }}',
|
||||
matcher: idAndTextMatcher,
|
||||
}).css({'visibility': 'visible'});
|
||||
|
||||
$('#language').select2({
|
||||
multiple: 1,
|
||||
placeholder: '{{ _('Filter by language...') }}',
|
||||
matcher: idAndTextMatcher,
|
||||
}).css({'visibility': 'visible'});
|
||||
});
|
||||
|
||||
// Draw the statistics graph.
|
||||
{% if results_json %}
|
||||
var chart = null;
|
||||
function stats_graph(raw_data) {
|
||||
var colors = {{ results_colors_json }};
|
||||
|
||||
var ctx = $('#status-graph').find('canvas')[0].getContext('2d');
|
||||
var font = $('body').css('font-family');
|
||||
if (chart !== null) {
|
||||
chart.destroy();
|
||||
}
|
||||
chart = new Chart(ctx, {
|
||||
type: 'pie',
|
||||
data: {
|
||||
datasets: [{
|
||||
data: raw_data.categories.map(function(entry) {
|
||||
return entry.count;
|
||||
}),
|
||||
backgroundColor: raw_data.categories.map(function(entry) {
|
||||
return colors[entry.code];
|
||||
}),
|
||||
}],
|
||||
labels: raw_data.categories.map(function(entry) {
|
||||
return entry.name;
|
||||
}),
|
||||
},
|
||||
options: {
|
||||
animation: false,
|
||||
scaleFontFamily: font,
|
||||
tooltips: {
|
||||
titleFontFamily: font,
|
||||
bodyFontFamily: font,
|
||||
},
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
$('#total-submission-count').text(raw_data.total);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
stats_graph(window.results_json);
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
function load_dynamic_update(last_msg) {
|
||||
var _collect = function (e) {
|
||||
return e.value;
|
||||
};
|
||||
var language_filter = $.map($('select#language option[selected]'), _collect);
|
||||
var status_filter = $.map($('select#status option[selected]'), _collect);
|
||||
|
||||
var table = $('#submissions-table');
|
||||
var statistics = $("#statistics-table");
|
||||
var doing_ajax = false;
|
||||
var first = parseInt(table.find('>div:first-child').attr('id'));
|
||||
|
||||
var update_submission = function (message, force) {
|
||||
if (language_filter.length && 'language' in message &&
|
||||
language_filter.indexOf(message.language) == -1)
|
||||
return;
|
||||
if (status_filter.length && 'status' in message &&
|
||||
status_filter.indexOf(message.status) == -1)
|
||||
return;
|
||||
var id = message.id;
|
||||
var row = table.find('div#' + id);
|
||||
if (row.length < 1) {
|
||||
if (id < first)
|
||||
return;
|
||||
first = id;
|
||||
row = $('<div>', {id: id, 'class': 'submission-row'}).hide().prependTo(table);
|
||||
if (table.find('>div').length >= {{ paginator.per_page }})
|
||||
table.find('>div:last-child').hide('slow', function () {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
if (force || !doing_ajax) {
|
||||
if (!force) doing_ajax = true;
|
||||
$.ajax({
|
||||
url: '{{ url('submission_single_query') }}',
|
||||
data: {id: id, show_problem: show_problem}
|
||||
}).done(function (data) {
|
||||
var was_shown = row.is(':visible');
|
||||
row.html(data);
|
||||
register_time(row.find('.time-with-rel'));
|
||||
if (!was_shown) {
|
||||
row.slideDown('slow');
|
||||
}
|
||||
if (!force)
|
||||
setTimeout(function () {
|
||||
doing_ajax = false;
|
||||
}, 1000);
|
||||
}).fail(function () {
|
||||
console.log('Failed to update submission: ' + id);
|
||||
if (!force) doing_ajax = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var stats_outdated = false;
|
||||
var last_stat_update = Date.now();
|
||||
var stats_update_interval = {{ stats_update_interval|default(0) * 1000 }};
|
||||
|
||||
function update_stats() {
|
||||
if (Date.now() - last_stat_update < stats_update_interval)
|
||||
return;
|
||||
$.ajax({
|
||||
url: '?results'
|
||||
}).done(function (data) {
|
||||
last_stat_update = Date.now();
|
||||
stats_graph(data);
|
||||
}).fail(function () {
|
||||
console.log('Failed to update statistics table!' + id);
|
||||
}).always(function () {
|
||||
stats_outdated = false;
|
||||
});
|
||||
}
|
||||
|
||||
$(window).on('dmoj:window-visible', function () {
|
||||
if (stats_outdated)
|
||||
update_stats();
|
||||
});
|
||||
|
||||
var $body = $(document.body);
|
||||
var receiver = new EventReceiver(
|
||||
"{{ EVENT_DAEMON_LOCATION }}", "{{ EVENT_DAEMON_POLL_LOCATION }}",
|
||||
['submissions'], last_msg, function (message) {
|
||||
if (current_contest && message.contest != current_contest)
|
||||
return;
|
||||
if (dynamic_user_id && message.user != dynamic_user_id ||
|
||||
dynamic_problem_id && message.problem != dynamic_problem_id)
|
||||
return;
|
||||
if (message.type == 'update-submission') {
|
||||
if (message.state == 'test-case' && $body.hasClass('window-hidden'))
|
||||
return;
|
||||
update_submission(message);
|
||||
} else if (message.type == 'done-submission') {
|
||||
update_submission(message, true);
|
||||
|
||||
if (!statistics.length) return;
|
||||
if ($('body').hasClass('window-hidden'))
|
||||
return stats_outdated = true;
|
||||
update_stats();
|
||||
}
|
||||
}
|
||||
);
|
||||
receiver.onwsclose = function (event) {
|
||||
if (event.code == 1001) {
|
||||
console.log('Navigated away');
|
||||
return;
|
||||
}
|
||||
console.log('You probably should refresh?');
|
||||
// $('.ws-closed').show().find('a').click(function () {
|
||||
// window.location.reload();
|
||||
// });
|
||||
};
|
||||
return receiver;
|
||||
}
|
||||
</script>
|
||||
{% endcompress %}
|
||||
|
||||
<script type="text/javascript">
|
||||
{% if dynamic_update and last_msg %}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
load_dynamic_update({{last_msg}});
|
||||
});
|
||||
</script>
|
||||
{% if request.in_contest_mode %}
|
||||
window.current_contest = '{{request.participation.contest.key}}';
|
||||
{% else %}
|
||||
window.current_contest = null;
|
||||
{% endif %}
|
||||
{% if dynamic_user_id %}
|
||||
window.dynamic_user_id = {{dynamic_user_id}};
|
||||
{% else %}
|
||||
window.dynamic_user_id = null;
|
||||
{% endif %}
|
||||
{% if dynamic_problem_id %}
|
||||
window.dynamic_problem_id = {{dynamic_problem_id}};
|
||||
{% else %}
|
||||
window.dynamic_problem_id = null;
|
||||
{% endif %}
|
||||
{% if show_problem %}
|
||||
window.show_problem = 1;
|
||||
{% else %}
|
||||
window.show_problem = 0;
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if results_json %}
|
||||
window.results_json = {{ results_json }};
|
||||
{% endif %}
|
||||
</script>
|
||||
|
||||
{% compress js %}
|
||||
<script type="text/javascript" src="{{ static('event.js') }}"></script>
|
||||
{% if request.user.is_authenticated and perms.judge.rejudge_submission %}
|
||||
<script type="text/javascript">
|
||||
window.rejudge_submission = function (id, e) {
|
||||
if ((typeof e !== 'undefined' && e.ctrlKey) ||
|
||||
confirm('Are you sure you want to rejudge?')) {
|
||||
$.ajax({
|
||||
url: '{{ url('submission_rejudge') }}',
|
||||
type: "POST",
|
||||
data: {
|
||||
id: id
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<script src="{{ static('libs/chart.js/Chart.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var info_float = $('.info-float');
|
||||
var container = $('#content-right');
|
||||
if (window.bad_browser) {
|
||||
container.css('float', 'right');
|
||||
} else if (!featureTest('position', 'sticky')) {
|
||||
fix_div(info_float, 55);
|
||||
$(window).resize(function () {
|
||||
info_float.width(container.width());
|
||||
});
|
||||
info_float.width(container.width());
|
||||
}
|
||||
|
||||
function escapeRegExp(string) {
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
}
|
||||
|
||||
function idAndTextMatcher(params, data) {
|
||||
if ($.trim(params.term) === '')
|
||||
return data;
|
||||
var regex = new RegExp(escapeRegExp(params.term), 'i');
|
||||
return data.text.search(regex) >= 0 || data.id.search(regex) >= 0 ? data : null;
|
||||
}
|
||||
|
||||
$('#status').select2({
|
||||
multiple: 1,
|
||||
placeholder: '{{ _('Filter by status...') }}',
|
||||
matcher: idAndTextMatcher,
|
||||
}).css({'visibility': 'visible'});
|
||||
|
||||
$('#language').select2({
|
||||
multiple: 1,
|
||||
placeholder: '{{ _('Filter by language...') }}',
|
||||
matcher: idAndTextMatcher,
|
||||
}).css({'visibility': 'visible'});
|
||||
});
|
||||
|
||||
// Draw the statistics graph.
|
||||
{% if results_json %}
|
||||
var chart = null;
|
||||
function stats_graph(raw_data) {
|
||||
var colors = {{ results_colors_json }};
|
||||
|
||||
var ctx = $('#status-graph').find('canvas')[0].getContext('2d');
|
||||
var font = $('body').css('font-family');
|
||||
if (chart !== null) {
|
||||
chart.destroy();
|
||||
}
|
||||
chart = new Chart(ctx, {
|
||||
type: 'pie',
|
||||
data: {
|
||||
datasets: [{
|
||||
data: raw_data.categories.map(function(entry) {
|
||||
return entry.count;
|
||||
}),
|
||||
backgroundColor: raw_data.categories.map(function(entry) {
|
||||
return colors[entry.code];
|
||||
}),
|
||||
}],
|
||||
labels: raw_data.categories.map(function(entry) {
|
||||
return entry.name;
|
||||
}),
|
||||
},
|
||||
options: {
|
||||
animation: false,
|
||||
scaleFontFamily: font,
|
||||
tooltips: {
|
||||
titleFontFamily: font,
|
||||
bodyFontFamily: font,
|
||||
},
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
$('#total-submission-count').text(raw_data.total);
|
||||
}
|
||||
|
||||
$(function () {
|
||||
stats_graph(window.results_json);
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
function load_dynamic_update(last_msg) {
|
||||
var _collect = function (e) {
|
||||
return e.value;
|
||||
};
|
||||
var language_filter = $.map($('select#language option[selected]'), _collect);
|
||||
var status_filter = $.map($('select#status option[selected]'), _collect);
|
||||
|
||||
var table = $('#submissions-table');
|
||||
var statistics = $("#statistics-table");
|
||||
var doing_ajax = false;
|
||||
var first = parseInt(table.find('>div:first-child').attr('id'));
|
||||
|
||||
var update_submission = function (message, force) {
|
||||
if (language_filter.length && 'language' in message &&
|
||||
language_filter.indexOf(message.language) == -1)
|
||||
return;
|
||||
if (status_filter.length && 'status' in message &&
|
||||
status_filter.indexOf(message.status) == -1)
|
||||
return;
|
||||
var id = message.id;
|
||||
var row = table.find('div#' + id);
|
||||
if (row.length < 1) {
|
||||
if (id < first)
|
||||
return;
|
||||
first = id;
|
||||
row = $('<div>', {id: id, 'class': 'submission-row'}).hide().prependTo(table);
|
||||
if (table.find('>div').length >= {{ paginator.per_page }})
|
||||
table.find('>div:last-child').hide('slow', function () {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
if (force || !doing_ajax) {
|
||||
if (!force) doing_ajax = true;
|
||||
$.ajax({
|
||||
url: '{{ url('submission_single_query') }}',
|
||||
data: {id: id, show_problem: show_problem}
|
||||
}).done(function (data) {
|
||||
var was_shown = row.is(':visible');
|
||||
row.html(data);
|
||||
register_time(row.find('.time-with-rel'));
|
||||
if (!was_shown) {
|
||||
row.slideDown('slow');
|
||||
}
|
||||
if (!force)
|
||||
setTimeout(function () {
|
||||
doing_ajax = false;
|
||||
}, 1000);
|
||||
}).fail(function () {
|
||||
console.log('Failed to update submission: ' + id);
|
||||
if (!force) doing_ajax = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var stats_outdated = false;
|
||||
var last_stat_update = Date.now();
|
||||
var stats_update_interval = {{ stats_update_interval|default(0) * 1000 }};
|
||||
|
||||
function update_stats() {
|
||||
if (Date.now() - last_stat_update < stats_update_interval)
|
||||
return;
|
||||
$.ajax({
|
||||
url: '?results'
|
||||
}).done(function (data) {
|
||||
last_stat_update = Date.now();
|
||||
stats_graph(data);
|
||||
}).fail(function () {
|
||||
console.log('Failed to update statistics table!' + id);
|
||||
}).always(function () {
|
||||
stats_outdated = false;
|
||||
});
|
||||
}
|
||||
|
||||
$(window).on('dmoj:window-visible', function () {
|
||||
if (stats_outdated)
|
||||
update_stats();
|
||||
});
|
||||
|
||||
var $body = $(document.body);
|
||||
var receiver = new EventReceiver(
|
||||
"{{ EVENT_DAEMON_LOCATION }}", "{{ EVENT_DAEMON_POLL_LOCATION }}",
|
||||
['submissions'], last_msg, function (message) {
|
||||
if (current_contest && message.contest != current_contest)
|
||||
return;
|
||||
if (dynamic_user_id && message.user != dynamic_user_id ||
|
||||
dynamic_problem_id && message.problem != dynamic_problem_id)
|
||||
return;
|
||||
if (message.type == 'update-submission') {
|
||||
if (message.state == 'test-case' && $body.hasClass('window-hidden'))
|
||||
return;
|
||||
update_submission(message);
|
||||
} else if (message.type == 'done-submission') {
|
||||
update_submission(message, true);
|
||||
|
||||
if (!statistics.length) return;
|
||||
if ($('body').hasClass('window-hidden'))
|
||||
return stats_outdated = true;
|
||||
update_stats();
|
||||
}
|
||||
}
|
||||
);
|
||||
receiver.onwsclose = function (event) {
|
||||
if (event.code == 1001) {
|
||||
console.log('Navigated away');
|
||||
return;
|
||||
}
|
||||
console.log('You probably should refresh?');
|
||||
// $('.ws-closed').show().find('a').click(function () {
|
||||
// window.location.reload();
|
||||
// });
|
||||
};
|
||||
return receiver;
|
||||
}
|
||||
</script>
|
||||
{% endcompress %}
|
||||
|
||||
{% if dynamic_update and last_msg %}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
load_dynamic_update({{last_msg}});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title_ruler %}{% endblock %}
|
||||
|
@ -263,133 +263,133 @@
|
|||
{% block title_row %}{% endblock %}
|
||||
|
||||
{% block three_col_media %}
|
||||
{% if perms.judge.change_submission and perms.judge.rejudge_submission %}
|
||||
<style>
|
||||
td.sub-prop, col.sub-prop {
|
||||
width: 22%
|
||||
}
|
||||
|
||||
col.sub-info, td.sub-info {
|
||||
width: 78%
|
||||
}
|
||||
|
||||
#status, #language {
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
|
||||
{% if perms.judge.change_submission and perms.judge.rejudge_submission %}
|
||||
<style>
|
||||
.total {
|
||||
text-align: center;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
td.sub-prop, col.sub-prop {
|
||||
width: 22%
|
||||
}
|
||||
|
||||
#status-graph {
|
||||
padding: 1em 0em;
|
||||
}
|
||||
col.sub-info, td.sub-info {
|
||||
width: 78%
|
||||
}
|
||||
|
||||
#status-graph canvas {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#status, #language {
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
|
||||
<style>
|
||||
.total {
|
||||
text-align: center;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
#status-graph {
|
||||
padding: 1em 0em;
|
||||
}
|
||||
|
||||
#status-graph canvas {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block middle_title %}
|
||||
<div class="page-title">
|
||||
<div class="page-title">
|
||||
<div class="tabs" style="border: none;">
|
||||
<h2>{{content_title}}</h2>
|
||||
<h2>{{content_title}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block middle_content %}
|
||||
<div class="submission">
|
||||
<div class="ws-closed">
|
||||
<a href="javascript:void(0)">{{ _('You were disconnected. Refresh to show latest updates.') }}</a>
|
||||
</div>
|
||||
|
||||
<div id="submissions-table">
|
||||
{% set profile_id = request.profile.id if request.user.is_authenticated else 0 %}
|
||||
{% for submission in submissions %}
|
||||
<div class="submission-row" id="{{ submission.id }}">
|
||||
{% with problem_name=show_problem and submission.problem.i18n_name %}
|
||||
{% include "submission/row.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if page_obj.num_pages > 1 %}
|
||||
<div style="margin-top:10px;">{% include "list-pages.html" %}</div>
|
||||
{% endif %}
|
||||
<div class="submission">
|
||||
<div class="ws-closed">
|
||||
<a href="javascript:void(0)">{{ _('You were disconnected. Refresh to show latest updates.') }}</a>
|
||||
</div>
|
||||
|
||||
<div id="submissions-table">
|
||||
{% set profile_id = request.profile.id if request.user.is_authenticated else 0 %}
|
||||
{% for submission in submissions %}
|
||||
<div class="submission-row" id="{{ submission.id }}">
|
||||
{% with problem_name=show_problem and submission.problem.i18n_name %}
|
||||
{% include "submission/row.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if page_obj.num_pages > 1 %}
|
||||
<div style="margin-top:10px;">{% include "list-pages.html" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block right_sidebar %}
|
||||
{% if results_json %}
|
||||
{% if results_json %}
|
||||
<div class="right-sidebar">
|
||||
<div class="submission">
|
||||
<div class="sidebox">
|
||||
<h3>{{ _('Filter submissions') }} <i class="fa fa-search"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
<form id="filter-form" name="form" action="" method="get">
|
||||
<div class="filter-form-group">
|
||||
<label for="status"><i>{{ _('Status') }}</i></label>
|
||||
<select id="status" name="status" multiple>
|
||||
{% for id, name in all_statuses %}
|
||||
<option {% if id in selected_statuses %}selected{% endif %}
|
||||
value="{{ id }}">{{ name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-form-group">
|
||||
<label for="language"><i>{{ _('Language') }}</i></label>
|
||||
<select id="language" name="language" multiple>
|
||||
{% for code, name in all_languages %}
|
||||
<option {% if code in selected_languages %}selected{% endif %}
|
||||
value="{{ code }}">{{ name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-submit-group">
|
||||
<a id="go" onclick="form.submit()" class="button small">{{ _('Go') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebox">
|
||||
<div id="statistics-table">
|
||||
<h3>{{ _('Statistics') }} <i class="fa fa-pie-chart"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
<div id="status-graph">
|
||||
<canvas width="230" height="170"></canvas>
|
||||
</div>
|
||||
<div class="total">
|
||||
{{ _('Total:') }} <span id="total-submission-count"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="submission">
|
||||
<div class="sidebox">
|
||||
<h3>{{ _('Filter submissions') }} <i class="fa fa-search"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
<form id="filter-form" name="form" action="" method="get">
|
||||
<div class="filter-form-group">
|
||||
<label for="status"><i>{{ _('Status') }}</i></label>
|
||||
<select id="status" name="status" multiple>
|
||||
{% for id, name in all_statuses %}
|
||||
<option {% if id in selected_statuses %}selected{% endif %}
|
||||
value="{{ id }}">{{ name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-form-group">
|
||||
<label for="language"><i>{{ _('Language') }}</i></label>
|
||||
<select id="language" name="language" multiple>
|
||||
{% for code, name in all_languages %}
|
||||
<option {% if code in selected_languages %}selected{% endif %}
|
||||
value="{{ code }}">{{ name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-submit-group">
|
||||
<a id="go" onclick="form.submit()" class="button small">{{ _('Go') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebox">
|
||||
<div id="statistics-table">
|
||||
<h3>{{ _('Statistics') }} <i class="fa fa-pie-chart"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
<div id="status-graph">
|
||||
<canvas width="230" height="170"></canvas>
|
||||
</div>
|
||||
<div class="total">
|
||||
{{ _('Total:') }} <span id="total-submission-count"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block left_sidebar %}
|
||||
<div class="left-sidebar">
|
||||
{{ make_tab_item('all_submissions_list', 'fa fa-list', all_submissions_link, _('All')) }}
|
||||
{% if my_submissions_link or tab == 'my_submissions_tab' %}
|
||||
{{ make_tab_item('my_submissions_tab', 'fa fa-user', my_submissions_link, _('Mine')) }}
|
||||
{% endif %}
|
||||
{% if best_submissions_link %}
|
||||
{{ make_tab_item('best_submissions_list', 'fa fa-bar-chart', best_submissions_link, _('Best')) }}
|
||||
{% endif %}
|
||||
{% if page_type == 'user_submissions_tab' %}
|
||||
{{ make_tab_item('user_submissions_tab', 'fa fa-user', None, _("%(user)s", user=tab_username)) }}
|
||||
{% endif %}
|
||||
{% if perms.judge.change_submission %}
|
||||
{{ make_tab_item('admin', 'fa fa-edit', url('admin:judge_submission_changelist'), _('Admin')) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="left-sidebar">
|
||||
{{ make_tab_item('all_submissions_list', 'fa fa-list', all_submissions_link, _('All')) }}
|
||||
{% if my_submissions_link or tab == 'my_submissions_tab' %}
|
||||
{{ make_tab_item('my_submissions_tab', 'fa fa-user', my_submissions_link, _('Mine')) }}
|
||||
{% endif %}
|
||||
{% if best_submissions_link %}
|
||||
{{ make_tab_item('best_submissions_list', 'fa fa-bar-chart', best_submissions_link, _('Best')) }}
|
||||
{% endif %}
|
||||
{% if page_type == 'user_submissions_tab' %}
|
||||
{{ make_tab_item('user_submissions_tab', 'fa fa-user', None, _("%(user)s", user=tab_username)) }}
|
||||
{% endif %}
|
||||
{% if perms.judge.change_submission %}
|
||||
{{ make_tab_item('admin', 'fa fa-edit', url('admin:judge_submission_changelist'), _('Admin')) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,94 +1,94 @@
|
|||
{% set can_view = submission_layout(submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
||||
<div class="sub-result {{ submission._result_class if in_hidden_subtasks_contest else submission.result_class }}">
|
||||
<div class="score">
|
||||
{%- if submission.is_graded -%}
|
||||
{%- if submission.status in ('IE', 'CE', 'AB') -%}
|
||||
---
|
||||
{%- else -%}
|
||||
{{ submission.case_points|floatformat(0) }} / {{ submission.case_total|floatformat(0) }}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
<i class="fa fa-spinner fa-pulse"></i>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
<div class="state">
|
||||
{% if in_hidden_subtasks_contest and submission.is_graded %}
|
||||
<span>
|
||||
{% set ns = namespace(is_first=False) %}
|
||||
{% for batch in submission.batches %}
|
||||
{% if batch.id %}
|
||||
{{ '+' if ns.is_first else '' }}
|
||||
{% set ns.is_first = True %}
|
||||
<span class={{'green' if batch.AC else 'red'}}>
|
||||
{{ batch.points|floatformat(0) }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% else %}
|
||||
{% if not in_hidden_subtasks_contest or submission.status in ('IE', 'CE', 'AB') %}
|
||||
<span title="{{ submission.long_status }}" class="status">{{ submission.short_status }}</span> |
|
||||
{% endif %}
|
||||
<span class="language">{{ submission.language.short_display_name }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="score">
|
||||
{%- if submission.is_graded -%}
|
||||
{%- if submission.status in ('IE', 'CE', 'AB') -%}
|
||||
---
|
||||
{%- else -%}
|
||||
{{ submission.case_points|floatformat(0) }} / {{ submission.case_total|floatformat(0) }}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
<i class="fa fa-spinner fa-pulse"></i>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
<div class="state">
|
||||
{% if in_hidden_subtasks_contest and submission.is_graded %}
|
||||
<span>
|
||||
{% set ns = namespace(is_first=False) %}
|
||||
{% for batch in submission.batches %}
|
||||
{% if batch.id %}
|
||||
{{ '+' if ns.is_first else '' }}
|
||||
{% set ns.is_first = True %}
|
||||
<span class={{'green' if batch.AC else 'red'}}>
|
||||
{{ batch.points|floatformat(0) }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% else %}
|
||||
{% if not in_hidden_subtasks_contest or submission.status in ('IE', 'CE', 'AB') %}
|
||||
<span title="{{ submission.long_status }}" class="status">{{ submission.short_status }}</span> |
|
||||
{% endif %}
|
||||
<span class="language">{{ submission.language.short_display_name }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="sub-info{% if submission.status == 'G' %} sub-info-grading{% endif %}">
|
||||
{% if show_problem %}
|
||||
<div class="name"><a href="{{ url('problem_detail', submission.problem.code) }}">{{ problem_name }}</a></div>
|
||||
{% if show_problem %}
|
||||
<div class="name"><a href="{{ url('problem_detail', submission.problem.code) }}">{{ problem_name }}</a></div>
|
||||
{% endif %}
|
||||
<div>
|
||||
{{ link_user(submission.user) }}
|
||||
<span class="time">{{ relative_time(submission.date) }}</span>
|
||||
{% if not request.in_contest_mode and submission.contest_object_id %}
|
||||
<a href="{{ url('contest_view', submission.contest_object.key) }}"
|
||||
class="submission-contest">
|
||||
<i title="{{ submission.contest_object.name }}" class="fa fa-dot-circle-o"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<div>
|
||||
{{ link_user(submission.user) }}
|
||||
<span class="time">{{ relative_time(submission.date) }}</span>
|
||||
{% if not request.in_contest_mode and submission.contest_object_id %}
|
||||
<a href="{{ url('contest_view', submission.contest_object.key) }}"
|
||||
class="submission-contest">
|
||||
<i title="{{ submission.contest_object.name }}" class="fa fa-dot-circle-o"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if submission.status == 'G' and not in_hidden_subtasks_contest %}
|
||||
<div class="sub-testcase">
|
||||
{%- if submission.current_testcase > 0 -%}
|
||||
{{ _('Point %(point)s / Case #%(case)s', point=submission.points|floatformat(1), case=submission.current_testcase) }}
|
||||
{%- else -%}
|
||||
...
|
||||
{%- endif -%}
|
||||
</div>
|
||||
<div class="sub-testcase">
|
||||
{%- if submission.current_testcase > 0 -%}
|
||||
{{ _('Point %(point)s / Case #%(case)s', point=submission.points|floatformat(1), case=submission.current_testcase) }}
|
||||
{%- else -%}
|
||||
...
|
||||
{%- endif -%}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if can_view %}
|
||||
<div class="sub-prop"><div>
|
||||
<a href="{{ url('submission_status', submission.id) }}">
|
||||
<i class="fa fa-eye fa-fw"></i><span class="label">{{ _('view') }}</span>
|
||||
</a>
|
||||
{% if perms.judge.rejudge_submission %} ·
|
||||
<a href="#" onclick="rejudge_submission({{ submission.id }}, event);return false">
|
||||
<i class="fa fa-refresh fa-fw"></i><span class="label">{{ _('rejudge') }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if perms.judge.change_submission %} ·
|
||||
<a href="{{ url('admin:judge_submission_change', submission.id) }}">
|
||||
<i class="fa fa-cog fa-fw"></i><span class="label">{{ _('admin') }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div></div>
|
||||
<div class="sub-prop"><div>
|
||||
<a href="{{ url('submission_status', submission.id) }}">
|
||||
<i class="fa fa-eye fa-fw"></i><span class="label">{{ _('view') }}</span>
|
||||
</a>
|
||||
{% if perms.judge.rejudge_submission %} ·
|
||||
<a href="#" onclick="rejudge_submission({{ submission.id }}, event);return false">
|
||||
<i class="fa fa-refresh fa-fw"></i><span class="label">{{ _('rejudge') }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if perms.judge.change_submission %} ·
|
||||
<a href="{{ url('admin:judge_submission_change', submission.id) }}">
|
||||
<i class="fa fa-cog fa-fw"></i><span class="label">{{ _('admin') }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="sub-usage">
|
||||
{% if submission.status in ('QU', 'P', 'G', 'CE', 'IE', 'AB') or in_hidden_subtasks_contest %}
|
||||
<div class="time">---</div>
|
||||
<div class="memory">---</div>
|
||||
{% if submission.status in ('QU', 'P', 'G', 'CE', 'IE', 'AB') or in_hidden_subtasks_contest %}
|
||||
<div class="time">---</div>
|
||||
<div class="memory">---</div>
|
||||
{% else %}
|
||||
{% if "TLE" != submission.result %}
|
||||
<div title="{{ submission.time or 0 }}s" class="time">
|
||||
{{ (submission.time or 0)|floatformat(2) }}s
|
||||
</div>
|
||||
{% else %}
|
||||
{% if "TLE" != submission.result %}
|
||||
<div title="{{ submission.time or 0 }}s" class="time">
|
||||
{{ (submission.time or 0)|floatformat(2) }}s
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="time">---</div>
|
||||
{% endif %}
|
||||
<div class="memory">{{ (submission.memory_bytes|filesizeformat(True)).replace('i', '') }}</div>
|
||||
<div class="time">---</div>
|
||||
{% endif %}
|
||||
<div class="memory">{{ (submission.memory_bytes|filesizeformat(True)).replace('i', '') }}</div>
|
||||
{% endif %}
|
||||
</div>
|
|
@ -1,64 +1,64 @@
|
|||
{% extends "submission/info-base.html" %}
|
||||
{% block media %}
|
||||
<style>
|
||||
.line {
|
||||
position: relative;
|
||||
}
|
||||
<style>
|
||||
.line {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.highlighter {
|
||||
position: absolute;
|
||||
width: 9999px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.highlighter {
|
||||
position: absolute;
|
||||
width: 9999px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
a:active .line .highlighter {
|
||||
background: rgba(255, 212, 0, 0.48);
|
||||
}
|
||||
a:active .line .highlighter {
|
||||
background: rgba(255, 212, 0, 0.48);
|
||||
}
|
||||
|
||||
.copy-clipboard {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
.copy-clipboard {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div style="clear: both"></div>
|
||||
<br>
|
||||
<div><a href="{{ url('submission_status', submission.id) }}">{{ _('View status') }}</a></div>
|
||||
<div><a href="{{ url('submission_source_raw', submission.id) }}">{{ _('View raw source') }}</a></div>
|
||||
{% if request.user == submission.user.user or perms.judge.resubmit_other %}
|
||||
<div><a href="{{ url('problem_submit', submission.problem.code, submission.id) }}">{{ _('Resubmit') }}</a></div>
|
||||
{% endif %}
|
||||
{% if perms.judge.rejudge_submission %}
|
||||
<div>
|
||||
<form action="{{ url('submission_rejudge') }}" method="post">
|
||||
{% csrf_token %}
|
||||
<a href="#" onclick="parentNode.submit()">{{ _('Rejudge') }}</a>
|
||||
<input type="hidden" name="id" value="{{ submission.id }}">
|
||||
<input type="hidden" name="path" value="{{ url('submission_status', submission.id) }}">
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
<div class="source-wrap">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td class="source-ln" style="width: 0">
|
||||
<div>
|
||||
{% for line in raw_source.split('\n') %}
|
||||
<a href="#line-{{ loop.index }}" name="line-{{ loop.index }}">
|
||||
<pre class="line">{{ loop.index }}</pre>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</td>
|
||||
<td class="source-code">{{ highlighted_source }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="clear: both"></div>
|
||||
<br>
|
||||
<div><a href="{{ url('submission_status', submission.id) }}">{{ _('View status') }}</a></div>
|
||||
<div><a href="{{ url('submission_source_raw', submission.id) }}">{{ _('View raw source') }}</a></div>
|
||||
{% if request.user == submission.user.user or perms.judge.resubmit_other %}
|
||||
<div><a href="{{ url('problem_submit', submission.problem.code, submission.id) }}">{{ _('Resubmit') }}</a></div>
|
||||
{% endif %}
|
||||
{% if perms.judge.rejudge_submission %}
|
||||
<div>
|
||||
<form action="{{ url('submission_rejudge') }}" method="post">
|
||||
{% csrf_token %}
|
||||
<a href="#" onclick="parentNode.submit()">{{ _('Rejudge') }}</a>
|
||||
<input type="hidden" name="id" value="{{ submission.id }}">
|
||||
<input type="hidden" name="path" value="{{ url('submission_status', submission.id) }}">
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
<div class="source-wrap">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td class="source-ln" style="width: 0">
|
||||
<div>
|
||||
{% for line in raw_source.split('\n') %}
|
||||
<a href="#line-{{ loop.index }}" name="line-{{ loop.index }}">
|
||||
<pre class="line">{{ loop.index }}</pre>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</td>
|
||||
<td class="source-code">{{ highlighted_source }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,205 +1,205 @@
|
|||
{% if submission.contest_or_none %}
|
||||
{% set prefix_length = submission.contest_or_none.problem.output_prefix_override %}
|
||||
{% set prefix_length = submission.contest_or_none.problem.output_prefix_override %}
|
||||
{% else %}
|
||||
{% set prefix_length = None %}
|
||||
{% set prefix_length = None %}
|
||||
{% endif %}
|
||||
{% set is_pretest = submission.is_pretested %}
|
||||
|
||||
{% if submission.status != 'IE' %}
|
||||
{% if submission.status == 'QU' %}
|
||||
<h4>{{ _('We are waiting for a suitable judge to process your submission...') }}</h4>
|
||||
{% elif submission.status == 'P' %}
|
||||
<h4>{{ _('Your submission is being processed...') }}</h4>
|
||||
{% elif submission.status == 'CE' %}
|
||||
<h3><i class="fa fa-exclamation-circle fa-fw"></i>{{ _('Compilation Error') }}</h3>
|
||||
<pre>{{ submission.error|ansi2html }}</pre>
|
||||
{% if submission.status == 'QU' %}
|
||||
<h4>{{ _('We are waiting for a suitable judge to process your submission...') }}</h4>
|
||||
{% elif submission.status == 'P' %}
|
||||
<h4>{{ _('Your submission is being processed...') }}</h4>
|
||||
{% elif submission.status == 'CE' %}
|
||||
<h3><i class="fa fa-exclamation-circle fa-fw"></i>{{ _('Compilation Error') }}</h3>
|
||||
<pre>{{ submission.error|ansi2html }}</pre>
|
||||
{% else %}
|
||||
{% if submission.error %}
|
||||
<h3><i class="fa fa-exclamation-triangle fa-fw"></i>{{ _('Compilation Warnings') }}</h3>
|
||||
<pre>{{ submission.error|ansi2html }}</pre>
|
||||
<hr><br>
|
||||
{% endif %}
|
||||
{% if is_pretest %}
|
||||
<h3><i class="fa fa-check-square-o fa-fw"></i>{{ _('Pretest Execution Results') }}</h3>
|
||||
{% else %}
|
||||
{% if submission.error %}
|
||||
<h3><i class="fa fa-exclamation-triangle fa-fw"></i>{{ _('Compilation Warnings') }}</h3>
|
||||
<pre>{{ submission.error|ansi2html }}</pre>
|
||||
<hr><br>
|
||||
{% endif %}
|
||||
{% if is_pretest %}
|
||||
<h3><i class="fa fa-check-square-o fa-fw"></i>{{ _('Pretest Execution Results') }}</h3>
|
||||
{% else %}
|
||||
<h3><i class="fa fa-check-square-o fa-fw"></i>{{ _('Execution Results') }}</h3>
|
||||
{% endif %}
|
||||
|
||||
<h3><i class="fa fa-check-square-o fa-fw"></i>{{ _('Execution Results') }}</h3>
|
||||
{% endif %}
|
||||
|
||||
{% for batch in batches %}
|
||||
{% if batch.id not in hidden_subtasks %}
|
||||
<div style="margin-top: 0.5em;">
|
||||
{% if batch.id %}
|
||||
<b>{{ _('Batch ') }}#{{ batch.id }} ({{batch.points|floatformat}} / {{batch.total|floatformat}}): </b>
|
||||
{% endif %}
|
||||
{% for case in batch.cases %}
|
||||
<span class="case-{{ case.status }} case-icons">
|
||||
{% if case.status == 'AC' %}
|
||||
<i id="icon-{{case.id}}" class="icofont-check-circled" title="{{ _('Case') }} #{{ loop.index }} - {{ case.status }}"></i>
|
||||
{% elif case.status != 'SC' %}
|
||||
<i id="icon-{{case.id}}" class="icofont-close-circled" title="{{ _('Case') }} #{{ loop.index }} - {{ case.status }}"></i>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div style="margin-top: 0.5em;">
|
||||
{% if batch.id %}
|
||||
<b>{{ _('Batch ') }}#{{ batch.id }} (??? / {{batch.total|floatformat}})</b>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<br>
|
||||
|
||||
<table class="testcases-table">
|
||||
{% if submission.is_graded and submission.result != 'AB' and not hidden_subtasks %}
|
||||
<thead>
|
||||
<tr id="overall-row" class="case-row overall-result-{{submission.result}}">
|
||||
<td><span class="col-title">{{_('Overall: ')}}</span>
|
||||
{% if request.in_contest_mode and submission.contest_or_none %}
|
||||
{% with contest=submission.contest_or_none %}
|
||||
{{ _('%(points)s/%(total)s', 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 %}
|
||||
</td>
|
||||
|
||||
<td><span class="case-{{submission.result}}">{{submission.long_status}}</span></td>
|
||||
|
||||
<td><span class="col-title">{{_('Point: ')}}</span>
|
||||
{{ submission.case_points|floatformat(1) }}/{{ submission.case_total|floatformat(0) }}
|
||||
|
||||
</td>
|
||||
|
||||
<td><span class="col-title">{{_('Time: ')}}</span>
|
||||
{% if submission.result == "TLE" %}
|
||||
<span>---</span>
|
||||
{% else %}
|
||||
<span title="{{ submission.time }}s">{{ (submission.time * 1000)|floatformat(0) }} ms</span>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
|
||||
<td><span class="col-title">{{_('Memory: ')}}</span>{{ submission.memory|kbdetailformat }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
{% endif %}
|
||||
|
||||
<tbody>
|
||||
{% for batch in batches %}
|
||||
{% if batch.id not in hidden_subtasks %}
|
||||
<div style="margin-top: 0.5em;">
|
||||
{% if batch.id %}
|
||||
<b>{{ _('Batch ') }}#{{ batch.id }} ({{batch.points|floatformat}} / {{batch.total|floatformat}}): </b>
|
||||
{% endif %}
|
||||
{% for case in batch.cases %}
|
||||
<span class="case-{{ case.status }} case-icons">
|
||||
{% if case.status == 'AC' %}
|
||||
<i id="icon-{{case.id}}" class="icofont-check-circled" title="{{ _('Case') }} #{{ loop.index }} - {{ case.status }}"></i>
|
||||
{% elif case.status != 'SC' %}
|
||||
<i id="icon-{{case.id}}" class="icofont-close-circled" title="{{ _('Case') }} #{{ loop.index }} - {{ case.status }}"></i>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div style="margin-top: 0.5em;">
|
||||
{% if batch.id %}
|
||||
<b>{{ _('Batch ') }}#{{ batch.id }} (??? / {{batch.total|floatformat}})</b>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<br>
|
||||
|
||||
<table class="testcases-table">
|
||||
{% if submission.is_graded and submission.result != 'AB' and not hidden_subtasks %}
|
||||
<thead>
|
||||
<tr id="overall-row" class="case-row overall-result-{{submission.result}}">
|
||||
<td><span class="col-title">{{_('Overall: ')}}</span>
|
||||
{% if request.in_contest_mode and submission.contest_or_none %}
|
||||
{% with contest=submission.contest_or_none %}
|
||||
{{ _('%(points)s/%(total)s', 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 %}
|
||||
</td>
|
||||
|
||||
<td><span class="case-{{submission.result}}">{{submission.long_status}}</span></td>
|
||||
|
||||
<td><span class="col-title">{{_('Point: ')}}</span>
|
||||
{{ submission.case_points|floatformat(1) }}/{{ submission.case_total|floatformat(0) }}
|
||||
|
||||
</td>
|
||||
|
||||
<td><span class="col-title">{{_('Time: ')}}</span>
|
||||
{% if submission.result == "TLE" %}
|
||||
<span>---</span>
|
||||
{% else %}
|
||||
<span title="{{ submission.time }}s">{{ (submission.time * 1000)|floatformat(0) }} ms</span>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
|
||||
<td><span class="col-title">{{_('Memory: ')}}</span>{{ submission.memory|kbdetailformat }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
{% endif %}
|
||||
|
||||
<tbody>
|
||||
{% for batch in batches %}
|
||||
{% if batch.id not in hidden_subtasks %}
|
||||
{% if batch.id not in hidden_subtasks %}
|
||||
{% if batch.id %}
|
||||
{% set batch_AC = (batch.points == batch.total) %}
|
||||
<tr class="case-row background-{{'d6e8f7' if batch.points == batch.total else 'bisque'}}">
|
||||
<td>
|
||||
<b>{{ _('Batch ') }}#{{ batch.id }}</b>
|
||||
</td>
|
||||
<td>
|
||||
{% if batch_AC %}
|
||||
<span class="fa fa-check case-AC"></span>
|
||||
{% else %}
|
||||
<span class="fa fa-times case-WA"></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<span class="col-title">
|
||||
{{_('Point')}}:
|
||||
</span>
|
||||
{{ _('%(points)s/%(total)s', points=batch.points|floatformat(1), total=batch.total|floatformat(0)) }}
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% set batch_AC = (batch.points == batch.total) %}
|
||||
<tr class="case-row background-{{'d6e8f7' if batch.points == batch.total else 'bisque'}}">
|
||||
<td>
|
||||
<b>{{ _('Batch ') }}#{{ batch.id }}</b>
|
||||
</td>
|
||||
<td>
|
||||
{% if batch_AC %}
|
||||
<span class="fa fa-check case-AC"></span>
|
||||
{% else %}
|
||||
<span class="fa fa-times case-WA"></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<span class="col-title">
|
||||
{{_('Point')}}:
|
||||
</span>
|
||||
{{ _('%(points)s/%(total)s', points=batch.points|floatformat(1), total=batch.total|floatformat(0)) }}
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% for case in batch.cases %}
|
||||
<tr id="{{ case.id }}" class="case-row toggle closed">
|
||||
<tr id="{{ case.id }}" class="case-row toggle closed">
|
||||
<td>
|
||||
{%- if can_see_testcases -%}
|
||||
<i class="fa fa-chevron-right fa-fw"></i>
|
||||
{%- endif -%}
|
||||
{%- if batch.id -%}
|
||||
<b>{{ _('Case') }} #{{ loop.index }}:</b>
|
||||
{%- elif is_pretest -%}
|
||||
<b>{{ _('Pretest') }} #{{ loop.index }}:</b>
|
||||
{%- else -%}
|
||||
<b>{{ _('Test case') }} #{{ loop.index }}:</b>
|
||||
{%- endif -%}
|
||||
{%- if can_see_testcases -%}
|
||||
<i class="fa fa-chevron-right fa-fw"></i>
|
||||
{%- endif -%}
|
||||
{%- if batch.id -%}
|
||||
<b>{{ _('Case') }} #{{ loop.index }}:</b>
|
||||
{%- elif is_pretest -%}
|
||||
<b>{{ _('Pretest') }} #{{ loop.index }}:</b>
|
||||
{%- else -%}
|
||||
<b>{{ _('Test case') }} #{{ loop.index }}:</b>
|
||||
{%- endif -%}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span title="{{ case.long_status }}" class="case-{{ case.status }}">
|
||||
{%- if case.status == 'SC' %}—{% else %}{{ case.long_status }}{% endif -%}
|
||||
</span>
|
||||
<span title="{{ case.long_status }}" class="case-{{ case.status }}">
|
||||
{%- if case.status == 'SC' %}—{% else %}{{ case.long_status }}{% endif -%}
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td><span class="col-title">{{_('Point')}}: </span>
|
||||
{{ case.points|floatformat }}/{{ case.total|floatformat }}
|
||||
{{ case.points|floatformat }}/{{ case.total|floatformat }}
|
||||
</td>
|
||||
<td>
|
||||
{%- if case.status != 'SC' -%}
|
||||
{%- if case.status == 'TLE' -%}
|
||||
<span><span class="col-title">{{_('Time')}}: ></span>{{ (time_limit * 1000)|floatformat(0) }} ms</span>
|
||||
{%- else -%}
|
||||
<span title="{{ case.time }}s"><span class="col-title">{{_('Time')}}: </span>{{ (case.time * 1000)|floatformat(0) }} ms</span>
|
||||
{%- endif -%}
|
||||
{%- if case.status != 'SC' -%}
|
||||
{%- if case.status == 'TLE' -%}
|
||||
<span><span class="col-title">{{_('Time')}}: ></span>{{ (time_limit * 1000)|floatformat(0) }} ms</span>
|
||||
{%- else -%}
|
||||
<span title="{{ case.time }}s"><span class="col-title">{{_('Time')}}: </span>{{ (case.time * 1000)|floatformat(0) }} ms</span>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
</td>
|
||||
|
||||
<td>{% if case.status != 'SC' %}<span class="col-title">{{_('Memory')}}: </span> {{ case.memory|kbdetailformat }}{% endif %}</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
{% if can_see_testcases %}
|
||||
<tr id="{{ case.id }}-output" style="display:none" class="case-feedback toggled">
|
||||
<td colspan="5">
|
||||
<div class="case-info">
|
||||
{% set curr_data = cases_data[case.case] %}
|
||||
{% if curr_data != null %}
|
||||
<strong>{{ _('Input:') }}</strong>
|
||||
<pre class="case-output">{{ curr_data['input']|linebreaksbr }}</pre>
|
||||
{% endif %}
|
||||
|
||||
<strong>{{ _('Output:') }}</strong>
|
||||
<pre class="case-output">{{ case.output|linebreaksbr }}</pre>
|
||||
{% if can_see_testcases %}
|
||||
<tr id="{{ case.id }}-output" style="display:none" class="case-feedback toggled">
|
||||
<td colspan="5">
|
||||
<div class="case-info">
|
||||
{% set curr_data = cases_data[case.case] %}
|
||||
{% if curr_data != null %}
|
||||
<strong>{{ _('Input:') }}</strong>
|
||||
<pre class="case-output">{{ curr_data['input']|linebreaksbr }}</pre>
|
||||
{% endif %}
|
||||
|
||||
{% if curr_data != null %}
|
||||
<strong>{{ _('Answer:') }}</strong>
|
||||
<pre class="case-output">{{ curr_data['answer']|linebreaksbr }}</pre>
|
||||
{% endif %}
|
||||
<strong>{{ _('Output:') }}</strong>
|
||||
<pre class="case-output">{{ case.output|linebreaksbr }}</pre>
|
||||
|
||||
{% if case.extended_feedback or case.feedback %}
|
||||
<strong>{{ _('Judge feedback:') }}</strong>
|
||||
{% if case.feedback %}
|
||||
<pre class="case-output">{{ case.feedback|linebreaksbr }}</pre>
|
||||
{% endif %}
|
||||
{% if case.extended_feedback %}
|
||||
<pre class="case-output">{{ case.extended_feedback|linebreaksbr }}</pre>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if curr_data != null %}
|
||||
<strong>{{ _('Answer:') }}</strong>
|
||||
<pre class="case-output">{{ curr_data['answer']|linebreaksbr }}</pre>
|
||||
{% endif %}
|
||||
|
||||
{% if case.extended_feedback or case.feedback %}
|
||||
<strong>{{ _('Judge feedback:') }}</strong>
|
||||
{% if case.feedback %}
|
||||
<pre class="case-output">{{ case.feedback|linebreaksbr }}</pre>
|
||||
{% endif %}
|
||||
{% if case.extended_feedback %}
|
||||
<pre class="case-output">{{ case.extended_feedback|linebreaksbr }}</pre>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody></table>
|
||||
</tbody></table>
|
||||
|
||||
{% if submission.is_graded %}
|
||||
<br>
|
||||
{% if submission.result != "AB" %}
|
||||
{% if is_pretest and submission.result == "AC" %}
|
||||
<br>
|
||||
<i>{{ _('Passing pretests does not guarantee a full score on system tests.') }}</i>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<b>{{ _('Submission aborted!') }}</b>
|
||||
{% endif %}
|
||||
<br>
|
||||
{% if submission.is_graded %}
|
||||
<br>
|
||||
{% if submission.result != "AB" %}
|
||||
{% if is_pretest and submission.result == "AC" %}
|
||||
<br>
|
||||
<i>{{ _('Passing pretests does not guarantee a full score on system tests.') }}</i>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<b>{{ _('Submission aborted!') }}</b>
|
||||
{% endif %}
|
||||
<br>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include "submission/internal-error-message.html" %}
|
||||
{% include "submission/internal-error-message.html" %}
|
||||
{% endif %}
|
||||
|
|
|
@ -1,186 +1,186 @@
|
|||
{% extends "submission/info-base.html" %}
|
||||
{% block media %}
|
||||
<style>
|
||||
.line {
|
||||
position: relative;
|
||||
}
|
||||
<style>
|
||||
.line {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.highlighter {
|
||||
position: absolute;
|
||||
width: 9999px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.highlighter {
|
||||
position: absolute;
|
||||
width: 9999px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
a:active .line .highlighter {
|
||||
background: rgba(255, 212, 0, 0.48);
|
||||
}
|
||||
a:active .line .highlighter {
|
||||
background: rgba(255, 212, 0, 0.48);
|
||||
}
|
||||
|
||||
.copy-clipboard {
|
||||
margin-top: 0;
|
||||
}
|
||||
.copy-clipboard {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.testcases-table tbody:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.testcases-table tbody:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
cursor: pointer;
|
||||
font-weight: 400;
|
||||
}
|
||||
.toggle {
|
||||
cursor: pointer;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
#source-header {
|
||||
font-size: 1.54em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
#source-header {
|
||||
font-size: 1.54em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.case-icons i {
|
||||
font-size: large;
|
||||
font-weight: bolder;
|
||||
cursor: pointer;
|
||||
}
|
||||
@media(max-width: 799px) {
|
||||
.source-ln {
|
||||
display: none;
|
||||
}
|
||||
.source-code {
|
||||
-webkit-text-size-adjust: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
.source-wrap {
|
||||
padding: 0.7em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.case-icons i {
|
||||
font-size: large;
|
||||
font-weight: bolder;
|
||||
cursor: pointer;
|
||||
}
|
||||
@media(max-width: 799px) {
|
||||
.source-ln {
|
||||
display: none;
|
||||
}
|
||||
.source-code {
|
||||
-webkit-text-size-adjust: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
.source-wrap {
|
||||
padding: 0.7em;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block content_js_media %}
|
||||
<script type="text/javascript" src="{{ static('event.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
function setup_icons() {
|
||||
$(".case-icons i").each(function() {
|
||||
$(this).on("click", function() {
|
||||
var id = "tr#" + $(this).attr("id").split("-")[1];
|
||||
$(id).click();
|
||||
$([document.documentElement, document.body]).animate({
|
||||
scrollTop: $(id).offset().top - 50
|
||||
}, 800);
|
||||
});
|
||||
});
|
||||
<script type="text/javascript" src="{{ static('event.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
function setup_icons() {
|
||||
$(".case-icons i").each(function() {
|
||||
$(this).on("click", function() {
|
||||
var id = "tr#" + $(this).attr("id").split("-")[1];
|
||||
$(id).click();
|
||||
$([document.documentElement, document.body]).animate({
|
||||
scrollTop: $(id).offset().top - 50
|
||||
}, 800);
|
||||
});
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
setup_icons();
|
||||
});
|
||||
</script>
|
||||
{% if not submission.is_graded and last_msg %}
|
||||
<script type="text/javascript">$(function () {
|
||||
var blocked = false, request = false;
|
||||
var list = $('#test-cases');
|
||||
|
||||
function update() {
|
||||
if (blocked) {
|
||||
request = true;
|
||||
return;
|
||||
}
|
||||
$(function() {
|
||||
setup_icons();
|
||||
request = false;
|
||||
blocked = true;
|
||||
$.ajax({
|
||||
url: '{{ url('submission_testcases_query') }}',
|
||||
data: {id: '{{ submission.id }}'}
|
||||
}).done(function (data) {
|
||||
data = $(data);
|
||||
list.find(".open").each(function() {
|
||||
var id = $(this).attr("id");
|
||||
data.find("#" + id).removeClass("closed").addClass("open");
|
||||
data.find("#" + id + "-output").show();
|
||||
});
|
||||
list.empty().html(data).find('.toggle').each(function () {
|
||||
register_toggle($(this));
|
||||
});
|
||||
setup_icons();
|
||||
setTimeout(function () {
|
||||
blocked = false;
|
||||
if (request)
|
||||
update();
|
||||
}, 500);
|
||||
}).fail(function (data) {
|
||||
console.log('Failed to update testcases!');
|
||||
});
|
||||
|
||||
if ($(window).scrollTop() + $(window).height() > $(document).height() - 100)
|
||||
$("html, body").animate({scrollTop: $(document).height()}, 0);
|
||||
}
|
||||
|
||||
var receiver = new EventReceiver(
|
||||
"{{ EVENT_DAEMON_LOCATION }}", "{{ EVENT_DAEMON_POLL_LOCATION }}",
|
||||
['sub_{{ submission.id_secret }}'], {{ last_msg }}, function (message) {
|
||||
switch (message.type) {
|
||||
case 'internal-error':
|
||||
case 'grading-end':
|
||||
case 'compile-error':
|
||||
$('#abort-button').remove();
|
||||
$('#grading-label').remove();
|
||||
case 'test-case':
|
||||
case 'grading-begin':
|
||||
case 'processing':
|
||||
update();
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
</script>
|
||||
{% if not submission.is_graded and last_msg %}
|
||||
<script type="text/javascript">$(function () {
|
||||
var blocked = false, request = false;
|
||||
var list = $('#test-cases');
|
||||
|
||||
function update() {
|
||||
if (blocked) {
|
||||
request = true;
|
||||
return;
|
||||
}
|
||||
request = false;
|
||||
blocked = true;
|
||||
$.ajax({
|
||||
url: '{{ url('submission_testcases_query') }}',
|
||||
data: {id: '{{ submission.id }}'}
|
||||
}).done(function (data) {
|
||||
data = $(data);
|
||||
list.find(".open").each(function() {
|
||||
var id = $(this).attr("id");
|
||||
data.find("#" + id).removeClass("closed").addClass("open");
|
||||
data.find("#" + id + "-output").show();
|
||||
});
|
||||
list.empty().html(data).find('.toggle').each(function () {
|
||||
register_toggle($(this));
|
||||
});
|
||||
setup_icons();
|
||||
setTimeout(function () {
|
||||
blocked = false;
|
||||
if (request)
|
||||
update();
|
||||
}, 500);
|
||||
}).fail(function (data) {
|
||||
console.log('Failed to update testcases!');
|
||||
});
|
||||
|
||||
if ($(window).scrollTop() + $(window).height() > $(document).height() - 100)
|
||||
$("html, body").animate({scrollTop: $(document).height()}, 0);
|
||||
}
|
||||
|
||||
var receiver = new EventReceiver(
|
||||
"{{ EVENT_DAEMON_LOCATION }}", "{{ EVENT_DAEMON_POLL_LOCATION }}",
|
||||
['sub_{{ submission.id_secret }}'], {{ last_msg }}, function (message) {
|
||||
switch (message.type) {
|
||||
case 'internal-error':
|
||||
case 'grading-end':
|
||||
case 'compile-error':
|
||||
$('#abort-button').remove();
|
||||
$('#grading-label').remove();
|
||||
case 'test-case':
|
||||
case 'grading-begin':
|
||||
case 'processing':
|
||||
update();
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div style="clear: both"></div>
|
||||
<br>
|
||||
{% if request.user == submission.user.user or perms.judge.resubmit_other %}
|
||||
<div><a href="{{ url('problem_submit', submission.problem.code, submission.id) }}">{{ _('Resubmit') }}</a></div>
|
||||
{% endif %}
|
||||
{% if perms.judge.rejudge_submission %}
|
||||
<div>
|
||||
<form action="{{ url('submission_rejudge') }}" method="post">
|
||||
{% csrf_token %}
|
||||
<a href="#" onclick="parentNode.submit()">{{ _('Rejudge') }}</a>
|
||||
<input type="hidden" name="id" value="{{ submission.id }}">
|
||||
<input type="hidden" name="path" value="{{ url('submission_status', submission.id) }}">
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<br>
|
||||
<h3 id="source-header" class="toggle closed"><i class="fa fa-chevron-right fa-fw"></i>{{_('Source code')}}</h3>
|
||||
<div class="source-wrap toggled" style="display: none; margin-bottom: 1em">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td class="source-ln" style="width: 0">
|
||||
<div>
|
||||
{% for line in raw_source.split('\n') %}
|
||||
<a href="#line-{{ loop.index }}" name="line-{{ loop.index }}">
|
||||
<pre class="line">{{ loop.index }}</pre>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</td>
|
||||
<td class="source-code">{{ highlighted_source }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="clear: both"></div>
|
||||
<br>
|
||||
{% if request.user == submission.user.user or perms.judge.resubmit_other %}
|
||||
<div><a href="{{ url('problem_submit', submission.problem.code, submission.id) }}">{{ _('Resubmit') }}</a></div>
|
||||
{% endif %}
|
||||
{% if perms.judge.rejudge_submission %}
|
||||
<div>
|
||||
<form action="{{ url('submission_rejudge') }}" method="post">
|
||||
{% csrf_token %}
|
||||
<a href="#" onclick="parentNode.submit()">{{ _('Rejudge') }}</a>
|
||||
<input type="hidden" name="id" value="{{ submission.id }}">
|
||||
<input type="hidden" name="path" value="{{ url('submission_status', submission.id) }}">
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="test-cases">{% include "submission/status-testcases.html" %}</div>
|
||||
{% if not submission.is_graded %}
|
||||
{% if perms.judge.abort_any_submission %}
|
||||
<div id="abort-button">
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
<form action="{{ url('submission_abort', submission.id) }}" method="post">
|
||||
{% csrf_token %}
|
||||
<input style="float:left" type="submit" value="{{ _('Abort') }}" class="button">
|
||||
<br><br>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
<br>
|
||||
<h3 id="source-header" class="toggle closed"><i class="fa fa-chevron-right fa-fw"></i>{{_('Source code')}}</h3>
|
||||
<div class="source-wrap toggled" style="display: none; margin-bottom: 1em">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td class="source-ln" style="width: 0">
|
||||
<div>
|
||||
{% for line in raw_source.split('\n') %}
|
||||
<a href="#line-{{ loop.index }}" name="line-{{ loop.index }}">
|
||||
<pre class="line">{{ loop.index }}</pre>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</td>
|
||||
<td class="source-code">{{ highlighted_source }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="test-cases">{% include "submission/status-testcases.html" %}</div>
|
||||
{% if not submission.is_graded %}
|
||||
{% if perms.judge.abort_any_submission %}
|
||||
<div id="abort-button">
|
||||
<br>
|
||||
<hr>
|
||||
<br>
|
||||
<form action="{{ url('submission_abort', submission.id) }}" method="post">
|
||||
{% csrf_token %}
|
||||
<input style="float:left" type="submit" value="{{ _('Abort') }}" class="button">
|
||||
<br><br>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,17 +1,17 @@
|
|||
{% extends "tabs-base.html" %}
|
||||
|
||||
{% block tabs %}
|
||||
{{ make_tab('all_submissions_list', 'fa-list', all_submissions_link, _('All')) }}
|
||||
{% if my_submissions_link or tab == 'my_submissions_tab' %}
|
||||
{{ make_tab('my_submissions_tab', 'fa-user', my_submissions_link, _('Mine')) }}
|
||||
{% endif %}
|
||||
{% if best_submissions_link %}
|
||||
{{ make_tab('best_submissions_list', 'fa-bar-chart', best_submissions_link, _('Best')) }}
|
||||
{% endif %}
|
||||
{% if tab == 'user_submissions_tab' %}
|
||||
{{ make_tab('user_submissions_tab', 'fa-user', None, _("%(user)s's", user=tab_username)) }}
|
||||
{% endif %}
|
||||
{% if perms.judge.change_submission %}
|
||||
{{ make_tab('admin', 'fa-edit', url('admin:judge_submission_changelist'), _('Admin')) }}
|
||||
{% endif %}
|
||||
{{ make_tab('all_submissions_list', 'fa-list', all_submissions_link, _('All')) }}
|
||||
{% if my_submissions_link or tab == 'my_submissions_tab' %}
|
||||
{{ make_tab('my_submissions_tab', 'fa-user', my_submissions_link, _('Mine')) }}
|
||||
{% endif %}
|
||||
{% if best_submissions_link %}
|
||||
{{ make_tab('best_submissions_list', 'fa-bar-chart', best_submissions_link, _('Best')) }}
|
||||
{% endif %}
|
||||
{% if tab == 'user_submissions_tab' %}
|
||||
{{ make_tab('user_submissions_tab', 'fa-user', None, _("%(user)s's", user=tab_username)) }}
|
||||
{% endif %}
|
||||
{% if perms.judge.change_submission %}
|
||||
{{ make_tab('admin', 'fa-edit', url('admin:judge_submission_changelist'), _('Admin')) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,73 +1,73 @@
|
|||
<h4>
|
||||
{{_('Contest submissions of')}} {{link_user(profile)}} <a href="{{url('contest_user_submissions', contest.key, profile.user.username, problem.code)}}">#</a>
|
||||
</h4>
|
||||
<hr>
|
||||
{% if best_subtasks and subtasks %}
|
||||
<table class="lightbox-submissions"><tbody>
|
||||
{% for subtask in subtasks %}
|
||||
<tr>
|
||||
{% set cur_subtask = best_subtasks[subtask] %}
|
||||
<td class="lightbox-submissions-time">
|
||||
<b>{{_('Subtask')}} {{subtask}}:</b>
|
||||
</td>
|
||||
<td class="lightbox-submissions-time case-{{'AC' if cur_subtask.points == cur_subtask.total else ('TLE' if cur_subtask.points == '???' else 'WA')}}">
|
||||
{{ cur_subtask.points }} / {{ cur_subtask.total }}
|
||||
</td>
|
||||
{% if cur_subtask.contest_time %}
|
||||
<td>
|
||||
({{ cur_subtask.contest_time }})
|
||||
</td>
|
||||
{% endif %}
|
||||
{% if cur_subtask.submission %}
|
||||
{% set can_view = submission_layout(cur_subtask.submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
||||
{% if can_view %}
|
||||
<td>
|
||||
→ <a href="{{url('submission_status', cur_subtask.submission.id)}}">{{ cur_subtask.submission.id }}</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td class="lightbox-submissions-time">
|
||||
<b>{{_('Total')}}:</b>
|
||||
</td>
|
||||
<td style="border-top: 1px solid" class="case-{{'AC' if points == total else 'WA'}}">
|
||||
{{ points }} / {{ total }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<hr>
|
||||
{% endif %}
|
||||
{% if submissions %}
|
||||
<table class="lightbox-submissions"><tbody>
|
||||
{% for submission in submissions %}
|
||||
<tr>
|
||||
{% set can_view = submission_layout(submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
||||
<td class="lightbox-submissions-time">
|
||||
{% if submission.contest_time %}
|
||||
{{submission.contest_time}}
|
||||
{% else %}
|
||||
{% trans time=submission.date|date(_("g:i a d/m/Y")) %}
|
||||
{{ time }}
|
||||
{% endtrans %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="case-{{submission.result}}">{{submission.display_point}}</td>
|
||||
<td class="case-{{submission.result}}">({{submission.short_status}})</td>
|
||||
<td>
|
||||
{% if submission.contest.is_pretest %}
|
||||
[{{_('pretests')}}]
|
||||
{% else %}
|
||||
[{{_('main tests')}}]
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if can_view %}
|
||||
<td>
|
||||
→ <a href="{{url('submission_status', submission.id)}}">{{submission.id}}</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody></table>
|
||||
<h4>
|
||||
{{_('Contest submissions of')}} {{link_user(profile)}} <a href="{{url('contest_user_submissions', contest.key, profile.user.username, problem.code)}}">#</a>
|
||||
</h4>
|
||||
<hr>
|
||||
{% if best_subtasks and subtasks %}
|
||||
<table class="lightbox-submissions"><tbody>
|
||||
{% for subtask in subtasks %}
|
||||
<tr>
|
||||
{% set cur_subtask = best_subtasks[subtask] %}
|
||||
<td class="lightbox-submissions-time">
|
||||
<b>{{_('Subtask')}} {{subtask}}:</b>
|
||||
</td>
|
||||
<td class="lightbox-submissions-time case-{{'AC' if cur_subtask.points == cur_subtask.total else ('TLE' if cur_subtask.points == '???' else 'WA')}}">
|
||||
{{ cur_subtask.points }} / {{ cur_subtask.total }}
|
||||
</td>
|
||||
{% if cur_subtask.contest_time %}
|
||||
<td>
|
||||
({{ cur_subtask.contest_time }})
|
||||
</td>
|
||||
{% endif %}
|
||||
{% if cur_subtask.submission %}
|
||||
{% set can_view = submission_layout(cur_subtask.submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
||||
{% if can_view %}
|
||||
<td>
|
||||
→ <a href="{{url('submission_status', cur_subtask.submission.id)}}">{{ cur_subtask.submission.id }}</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td class="lightbox-submissions-time">
|
||||
<b>{{_('Total')}}:</b>
|
||||
</td>
|
||||
<td style="border-top: 1px solid" class="case-{{'AC' if points == total else 'WA'}}">
|
||||
{{ points }} / {{ total }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<hr>
|
||||
{% endif %}
|
||||
{% if submissions %}
|
||||
<table class="lightbox-submissions"><tbody>
|
||||
{% for submission in submissions %}
|
||||
<tr>
|
||||
{% set can_view = submission_layout(submission, profile_id, request.user, editable_problem_ids, completed_problem_ids) %}
|
||||
<td class="lightbox-submissions-time">
|
||||
{% if submission.contest_time %}
|
||||
{{submission.contest_time}}
|
||||
{% else %}
|
||||
{% trans time=submission.date|date(_("g:i a d/m/Y")) %}
|
||||
{{ time }}
|
||||
{% endtrans %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="case-{{submission.result}}">{{submission.display_point}}</td>
|
||||
<td class="case-{{submission.result}}">({{submission.short_status}})</td>
|
||||
<td>
|
||||
{% if submission.contest.is_pretest %}
|
||||
[{{_('pretests')}}]
|
||||
{% else %}
|
||||
[{{_('main tests')}}]
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if can_view %}
|
||||
<td>
|
||||
→ <a href="{{url('submission_status', submission.id)}}">{{submission.id}}</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody></table>
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue