chore(web/problem): show ? when difficulty not set
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-12-05 17:46:40 +08:00
parent 3f2a6feea2
commit c0484d55a5
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -142,7 +142,7 @@ class UOJProblem {
public function getDifficultyHTML() {
$difficulty = (int)$this->info['difficulty'];
$difficulty_text = in_array($difficulty, static::$difficulty) ? $difficulty : '-';
$difficulty_text = in_array($difficulty, static::$difficulty) ? $difficulty : '?';
$difficulty_color = in_array($difficulty, static::$difficulty) ? static::$difficulty_color[$difficulty] : '#7e7e7e';
return HTML::tag('span', ['class' => 'uoj-difficulty', 'style' => "color: $difficulty_color"], $difficulty_text);