From 050b65de6ba50784c32ecf0432ddfd6a80b17311 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 6 Mar 2024 21:30:00 +0900 Subject: show quizzes even if they are not started --- services/app/src/App.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'services/app/src') diff --git a/services/app/src/App.php b/services/app/src/App.php index ac8ca14..55f6ae3 100644 --- a/services/app/src/App.php +++ b/services/app/src/App.php @@ -227,7 +227,7 @@ final class App ResponseInterface $response, QuizRepository $quizRepo, ): ResponseInterface { - $quizzes = $quizRepo->listStarted(); + $quizzes = $quizRepo->listAll(); return $this->render($request, $response, 'quiz_list.html.twig', [ 'page_title' => '問題一覧', @@ -251,7 +251,7 @@ final class App AnswerRepository $answerRepo, ): ResponseInterface { $quiz = $quizRepo->findBySlug($qslug); - if ($quiz === null || !$quiz->isStarted()) { + if ($quiz === null) { throw new HttpNotFoundException($request); } if ($quiz->isRankingHidden()) { @@ -277,7 +277,7 @@ final class App AnswerRepository $answerRepo, ): ResponseInterface { $quiz = $quizRepo->findBySlug($qslug); - if ($quiz === null || !$quiz->isStarted()) { + if ($quiz === null) { throw new HttpNotFoundException($request); } if ($quiz->isRankingHidden()) { @@ -377,7 +377,7 @@ final class App ): ResponseInterface { $anum = (int)$anum; $quiz = $quizRepo->findBySlug($qslug); - if ($quiz === null || !$quiz->isStarted()) { + if ($quiz === null) { throw new HttpNotFoundException($request); } $answer = $answerRepo->findByQuizIdAndAnswerNumber($quiz->quiz_id, answer_number: $anum); @@ -917,7 +917,7 @@ final class App ): ResponseInterface { $qid = (int)$qid; $quiz = $quizRepo->findById($qid); - if ($quiz === null || !$quiz->isStarted()) { + if ($quiz === null) { return $this->makeJsonResponse($response, [ 'error' => 'not_found', ])->withStatus(404); -- cgit v1.2.3-70-g09d2