From f4c7e6082b8718aaa5981177f5e4393d2246799c Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Wed, 23 Oct 2024 14:50:50 +0800 Subject: [PATCH 1/8] =?UTF-8?q?chore(complementary):=20Remove=20"=E9=81=A9?= =?UTF-8?q?=E7=94=A8=E9=A1=8C=E7=9B=AE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is too verbose. --- templates/complementary/index.html.twig | 6 ------ 1 file changed, 6 deletions(-) diff --git a/templates/complementary/index.html.twig b/templates/complementary/index.html.twig index 455272e..2858597 100644 --- a/templates/complementary/index.html.twig +++ b/templates/complementary/index.html.twig @@ -22,12 +22,6 @@
{{ schema.id }}
{{ schema.description|striptags }} - -

適用題目:{{ schema.questions - |sort - |map((question) => "\##{question.id}") - |join('、') - ?: '無' }}

下載 SQL 檔案 From 1775bbd19c91a1554dff9f3a422d91fe9d320d2d Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Wed, 23 Oct 2024 15:07:47 +0800 Subject: [PATCH 2/8] fix(repository): De-duplicate the question Fixed #77 --- src/Repository/SolutionEventRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Repository/SolutionEventRepository.php b/src/Repository/SolutionEventRepository.php index 6baf376..a3c1f90 100644 --- a/src/Repository/SolutionEventRepository.php +++ b/src/Repository/SolutionEventRepository.php @@ -149,7 +149,7 @@ public function listLeaderboard(?Group $group, string $interval): array $qb = $this->createQueryBuilder('e') ->from(User::class, 'u') - ->select('u AS user', 'COUNT(e.id) AS count') + ->select('u AS user', 'COUNT(DISTINCT e.question) AS count') ->where('e.submitter = u') ->andWhere('e.status = :status') ->andWhere('e.createdAt >= :startedFrom') From 5bfaddb9381b48c54940b55e9ef8712e19c6f54c Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Wed, 23 Oct 2024 23:47:01 +0800 Subject: [PATCH 3/8] refactor(challenge): Use native function for truncating --- .../components/Challenge/CommentModule/Comment.html.twig | 6 +----- .../ResultPresenterModule/EventPresenter.html.twig | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/templates/components/Challenge/CommentModule/Comment.html.twig b/templates/components/Challenge/CommentModule/Comment.html.twig index 37c75eb..6311023 100644 --- a/templates/components/Challenge/CommentModule/Comment.html.twig +++ b/templates/components/Challenge/CommentModule/Comment.html.twig @@ -16,11 +16,7 @@