go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/projects/kana-server/pkg/static/_views/home.html (about)

     1  <!--
     2  Copyright (c) 2023 - Present. Will Charczuk. All rights reserved.
     3  Use of this source code is governed by a MIT license that can be found in the LICENSE file at the root of the repository.
     4  -->
     5  {{ define "home" }} {{ template "header" . }}
     6  {{ $dateFormat := "2006-01-02 15:04Z"}}
     7  <div class="container stats">
     8    <ul class="bp3-breadcrumbs">
     9      <li><a class="bp3-breadcrumb bp3-breadcrumb-current" href="/home">Home</a></li>
    10    </ul>
    11    <div class="row">
    12      <div class="twelve columns">
    13        <p>To start a new quiz, click the <a href="/quiz.new"
    14            class="bp3-button bp3-minimal bp3-intent-success bp3-icon-add" title="Start New Quiz"></a>
    15          button in the upper righthand side.</p>
    16      </div>
    17    </div>
    18    <div class="home-stats row">
    19      <div class="three columns bp3-card">
    20        <h3 class="align-center">{{ .TotalQuizzes }}</h3>
    21        <h6 class="align-center">Total Quizzes</h6>
    22      </div>
    23      <div class="three columns bp3-card">
    24        <h3 class="align-center">{{ .TotalQuizResults }}</h3>
    25        <h6 class="align-center">Total Answers</h6>
    26      </div>
    27      <div class="three columns bp3-card">
    28        <h3 class="align-center">{{ .TotalQuizResultsCorrect }}</h3>
    29        <h6 class="align-center">Total Correct</h6>
    30      </div>
    31      <div class="three columns bp3-card">
    32        <h3 class="align-center">{{ .TotalQuizCorrectPct | printf "%0.2f" }}%</h3>
    33        <h6 class="align-center">Total Correct</h6>
    34      </div>
    35  
    36    </div>
    37    <div class="row">
    38      <div class="twelve columns">
    39        <table class="bp3-html-table bp3-html-table-condensed bp3-html-table-striped u-full-width u-max-full-width">
    40          <thead>
    41            <tr>
    42              <th>Taken</th>
    43              <th>Prompts</th>
    44              <th>Max Questions</th>
    45              <th>Prompts</th>
    46              <th>History</th>
    47              <th>Total</th>
    48              <th>Correct</th>
    49              <th>Pct. Correct</th>
    50              <th>P90 Elapsed</th>
    51              <th>Min/Max Elapsed</th>
    52            </tr>
    53          </thead>
    54          <tbody>
    55            {{ range $index, $quiz := .Quizzes }}
    56            {{ $stats := $quiz.Stats }}
    57            <tr>
    58              <td><a href="/home/{{$quiz.ID }}">{{ $quiz.CreatedUTC | time_format $dateFormat }}</a></td>
    59              <td>{{ template "quiz_settings" $quiz }}</td>
    60              <td>{{ if $quiz.MaxQuestions}}{{$quiz.MaxQuestions}}{{ else }}<span>-</span>{{end}}</td>
    61              <td>{{ $quiz.MaxPrompts }}</td>
    62              <td>{{ $quiz.MaxRepeatHistory }}</td>
    63              <td>{{ $stats.Total }}</td>
    64              <td>{{ $stats.Correct }}</td>
    65              <td>{{ $stats.PercentCorrect | printf "%.2f" }}%</td>
    66              <td>{{ $stats.ElapsedP90 | duration_round_millis }}</td>
    67              <td>{{ $stats.ElapsedMin | duration_round_millis }} / {{ $stats.ElapsedMax | duration_round_millis }}</td>
    68            </tr>
    69            {{ else }}
    70            <tr>
    71              <td colspan="12">No Quizzes Taken</td>
    72            </tr>
    73            {{ end }}
    74          </tbody>
    75        </table>
    76      </div>
    77    </div>
    78  </div>
    79  {{ template "footer" . }}
    80  {{ end }}