diff options
Diffstat (limited to 'services')
| -rw-r--r-- | services/app/src/App.php | 4 | ||||
| -rw-r--r-- | services/app/templates/admin_answer_list.html.twig | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/services/app/src/App.php b/services/app/src/App.php index b2ffba0..aef1b12 100644 --- a/services/app/src/App.php +++ b/services/app/src/App.php @@ -954,7 +954,9 @@ final class App 'error' => 'not_found', ])->withStatus(404); } - if ($quiz->isRankingHidden()) { + $currentUser = $this->getCurrentUser($request); + $isAdmin = $currentUser !== null ? $currentUser->is_admin : false; + if ($quiz->isRankingHidden() && !$isAdmin) { return $this->makeJsonResponse($response, [ 'error' => 'forbidden', ])->withStatus(403); diff --git a/services/app/templates/admin_answer_list.html.twig b/services/app/templates/admin_answer_list.html.twig index 68f0089..5d07d92 100644 --- a/services/app/templates/admin_answer_list.html.twig +++ b/services/app/templates/admin_answer_list.html.twig @@ -38,4 +38,9 @@ {% endfor %} </tbody> </table> + + <div> + <canvas id="chart" data-quiz-id="{{ quiz.quiz_id }}"></canvas> + <script type="module" src="{{ base_path() }}/assets/chart.js"></script> + </div> {% endblock %} |
