Compare commits

...

2 Commits

Author SHA1 Message Date
df7d1784d3
feat(contest/submissions): problem title in chooser
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-23 11:25:39 +08:00
571d5cddc3
feat(submission): display contest 2023-02-23 11:16:15 +08:00
4 changed files with 26 additions and 6 deletions

View File

@ -426,8 +426,11 @@ function echoMySubmissions() {
$options = [];
$options[] = ['value' => 'all', 'text' => '所有题目'];
for ($i = 0; $i < count($problems); $i++) {
$letter = chr(ord('A') + $i);
$options[] = ['value' => $letter, 'text' => "{$letter}"];
$problem = UOJContestProblem::query($problems[$i]);
$options[] = [
'value' => $problem->getLetter(),
'text' => $problem->getTitle(['with' => 'letter', 'simplify' => true]),
];
}
$chosen = UOJRequest::get('p');
@ -455,7 +458,7 @@ function echoMySubmissions() {
'show_all_submissions_status' => Cookie::get('show_all_submissions') !== null,
'options' => $options,
'chosen' => $chosen,
'conds' => $conds
'conds' => $conds,
]);
}

View File

@ -265,7 +265,11 @@ if (isset($hack_form)) {
<div class="row mt-3 submission-layout d-md-grid">
<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 class="submission-left-col">

View File

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

View File

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