add admin's permission to view submission in contests

This commit is contained in:
Dinh 2020-01-22 15:23:00 -06:00
parent 5562db7ecd
commit ab7bdf1eef
2 changed files with 3 additions and 5 deletions

View file

@ -170,7 +170,6 @@ def get_problem_data(submission):
problem_data = {case.order: get_input_answer(case, archive)
for case in testcases}
return problem_data
@ -184,7 +183,6 @@ class SubmissionStatus(SubmissionDetailBase):
context['batches'] = group_test_cases(submission.test_cases.all())
context['time_limit'] = submission.problem.time_limit
context['cases_data'] = get_problem_data(submission)
try:
lang_limit = submission.problem.language_limits.get(
language=submission.language)

View file

@ -36,7 +36,7 @@
<table>{% for case in batch.cases %}
<tr id="{{ case.id }}" class="case-row toggle closed">
<td>
{%- if (prefix_length is none or prefix_length > 0) -%}
{%- if ((prefix_length is none or prefix_length > 0) or (request.user.is_superuser)) -%}
<i class="fa fa-chevron-right fa-fw"></i>
{%- endif -%}
{%- if batch.id -%}
@ -72,11 +72,11 @@
{% endif %}
</tr>
{% if (prefix_length is none or prefix_length > 0) %}
{% if ((prefix_length is none or prefix_length > 0) or (request.user.is_superuser)) %}
<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]%}
{% set curr_data = cases_data[case.case] %}
<strong>{{ _('Input:') }}</strong>
<pre class="case-output">{{ curr_data['input']|linebreaksbr }}</pre>
<strong>{{ _('Your output:') }}</strong>