feat(submission): display contest

This commit is contained in:
Baoshuo Ren 2023-02-23 11:16:15 +08:00
parent 513cf6c290
commit 571d5cddc3
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
3 changed files with 20 additions and 3 deletions

View File

@ -265,7 +265,11 @@ if (isset($hack_form)) {
<div class="row mt-3 submission-layout d-md-grid"> <div class="row mt-3 submission-layout d-md-grid">
<div class="submission-right-col"> <div class="submission-right-col">
<?php UOJSubmission::cur()->echoStatusCard(['show_actual_score' => $perm['score'], 'id_hidden' => true], Auth::user()) ?> <?php UOJSubmission::cur()->echoStatusCard([
'show_actual_score' => $perm['score'],
'contest_problem_letter' => true,
'id_hidden' => true,
], Auth::user()) ?>
</div> </div>
<div class="submission-left-col"> <div class="submission-left-col">

View File

@ -621,9 +621,10 @@ class UOJSubmission {
} }
$rows = [ $rows = [
'id' => 'ID',
'submitter' => UOJLocale::get('problems::submitter'), 'submitter' => UOJLocale::get('problems::submitter'),
'id' => 'ID',
'problem' => UOJLocale::get('problems::problem'), 'problem' => UOJLocale::get('problems::problem'),
'contest' => UOJLocale::get('contests::contest'),
'result' => UOJLocale::get('problems::result'), 'result' => UOJLocale::get('problems::result'),
'used_time' => UOJLocale::get('problems::used time'), 'used_time' => UOJLocale::get('problems::used time'),
'used_memory' => UOJLocale::get('problems::used memory'), 'used_memory' => UOJLocale::get('problems::used memory'),

View File

@ -256,6 +256,8 @@ trait UOJSubmissionLikeTrait {
'time_format' => 'normal', 'time_format' => 'normal',
'time_font_size' => 'small', 'time_font_size' => 'small',
'unknown_char' => '/', 'unknown_char' => '/',
'contest_problem_letter' => false,
'problem_title' => [],
]; ];
switch ($name) { switch ($name) {
@ -264,11 +266,21 @@ trait UOJSubmissionLikeTrait {
break; break;
case 'problem': case 'problem':
if ($this->problem) { if ($this->problem) {
echo $this->problem->getLink(isset($cfg['problem_title']) ? $cfg['problem_title'] : []); if ($cfg['contest_problem_letter']) {
echo $this->problem->getLink($cfg['problem_title'] + ['with' => 'letter', 'simplify' => true]);
} else {
echo $this->problem->getLink($cfg['problem_title']);
}
} else { } else {
echo '<span class="text-danger">?</span>'; echo '<span class="text-danger">?</span>';
} }
break; break;
case 'contest':
if ($this->problem && $this->problem->contest) {
echo $this->problem->contest->getLink();
} else {
echo '<span class="text-danger">?</span>';
}
case 'submitter': case 'submitter':
case 'owner': case 'owner':
case 'hacker': case 'hacker':