diff --git a/web/app/models/UOJContestProblem.php b/web/app/models/UOJContestProblem.php index 470bd7c3..5713bd59 100644 --- a/web/app/models/UOJContestProblem.php +++ b/web/app/models/UOJContestProblem.php @@ -54,13 +54,14 @@ public function getTitle(array $cfg = []) { $title = parent::getTitle(['with' => null] + $cfg); if ($cfg['simplify']) { $letter = $this->getLetter(); - if (strStartWith($title, $letter)) { - $title = substr($title, strlen($letter)); - if (strStartWith($title, '.')) { - $title = substr($title, 1); - } - $title = trim($title); - } + if (strStartWith($title, $letter)) { + if (strStartWith($title, $letter . '.')) { + $title = substr($title, strlen($letter) + 1); + } else if (strStartWith($title, $letter . ' - ')) { + $title = substr($title, strlen($letter) + 3); + } + $title = trim($title); + } } if ($cfg['with'] == 'letter') { if (!isset($letter)) { @@ -162,4 +163,4 @@ public function additionalSubmissionComponentsCannotBeSeenByUser(array $user = n return []; } } -} \ No newline at end of file +}