go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/projects/kana-server/pkg/static/_views/home_quiz_stats.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_quiz_stats" }} {{ template "header" . }} 6 {{ $dateFormat := "2006-01-02 15:04Z"}} 7 {{ $stats := .Stats }} 8 {{ $promptStats := .PromptStats }} 9 <div class="container stats"> 10 <ul class="bp3-breadcrumbs"> 11 <li><a class="bp3-breadcrumb" href="/home">Home</a></li> 12 <li><span class="bp3-breadcrumb bp3-breadcrumb-current">{{ .ID }}</span></li> 13 </ul> 14 <div class="row"> 15 <div class="twelve columns"> 16 <table class="bp3-html-table bp3-html-table-condensed bp3-html-table-striped u-full-width u-max-full-width"> 17 <thead> 18 <tr> 19 <th>Taken</th> 20 <th>Prompts</th> 21 <th>Questions</th> 22 <th>Prompts</th> 23 <th>History</th> 24 <th>Total</th> 25 <th>Correct</th> 26 <th>Pct. Correct</th> 27 <th>P90 Elapsed</th> 28 <th>Min/Max Elapsed</th> 29 </tr> 30 </thead> 31 <tbody> 32 <tr> 33 <td>{{ .CreatedUTC | time_format $dateFormat }}</td> 34 <td>{{ template "quiz_settings" }}</td> 35 <td>{{ .MaxQuestions}}</td> 36 <td>{{ .MaxPrompts }}</td> 37 <td>{{ .MaxRepeatHistory }}</td> 38 <td>{{ $stats.Total }}</td> 39 <td>{{ $stats.Correct }}</td> 40 <td>{{ $stats.PercentCorrect | printf "%.2f" }}%</td> 41 <td>{{ $stats.ElapsedP90 | duration_round_millis }}</td> 42 <td>{{ $stats.ElapsedMin | duration_round_millis }} / {{ $stats.ElapsedMax | duration_round_millis }}</td> 43 </tr> 44 </tbody> 45 </table> 46 </div> 47 </div> 48 <div class="row"> 49 <div class="twelve columns"> 50 <table class="bp3-html-table bp3-html-table-condensed bp3-html-table-striped u-full-width u-max-full-width"> 51 <thead> 52 <tr> 53 <th>Prompt</th> 54 <th>Pct. Correct</th> 55 <th>Weight</th> 56 <th>Total</th> 57 <th>Correct</th> 58 <th>Elapsed Min.</th> 59 <th>Elapsed Avg.</th> 60 <th>Elapsed P90</th> 61 <th>Elapsed Max</th> 62 </tr> 63 </thead> 64 <tbody> 65 {{ range $prompt := $promptStats }} 66 <tr> 67 <td>{{ $prompt.Prompt }}</td> 68 <td>{{ $prompt.PercentCorrect | printf "%.2f" }}%</td> 69 <td>{{ $prompt.Weight | printf "%.2f" }}</td> 70 <td>{{ $prompt.Total }}</td> 71 <td>{{ $prompt.Correct }}</td> 72 <td>{{ $prompt.ElapsedMin | duration_round_millis }}</td> 73 <td>{{ $prompt.ElapsedAverage | duration_round_millis }}</td> 74 <td>{{ $prompt.ElapsedP90 | duration_round_millis }}</td> 75 <td>{{ $prompt.ElapsedMax | duration_round_millis }}</td> 76 </tr> 77 {{ else }} 78 <tr> 79 <td colspan="9">No Responses</td> 80 </tr> 81 {{ end }} 82 </tbody> 83 </table> 84 </div> 85 </div> 86 <div class="row"> 87 <div class="twelve columns"> 88 <table class="bp3-html-table bp3-html-table-condensed bp3-html-table-striped u-full-width u-max-full-width"> 89 <thead> 90 <tr> 91 <th>Prompted</th> 92 <th>Answered</th> 93 <th>Elapsed</th> 94 <th>Prompt</th> 95 <th>Expected</th> 96 <th>Actual</th> 97 <th>Correct</th> 98 </tr> 99 </thead> 100 <tbody> 101 {{ range $result := .Results }} 102 <tr> 103 <td>{{ $result.CreatedUTC | time_format $dateFormat }}</td> 104 <td>{{ $result.AnsweredUTC | time_format $dateFormat }}</td> 105 <td>{{ $result.Elapsed | duration_round_millis }}</td> 106 <td>{{ $result.Prompt }}</td> 107 <td>{{ $result.Expected }}</td> 108 <td>{{ $result.Actual }}</td> 109 <td> 110 {{ if $result.Correct }} 111 <span class="text-intent-success">Correct</span> 112 {{ else }} 113 <span class="text-intent-danger">Incorrect</span> 114 {{ end }} 115 </td> 116 </tr> 117 {{ else }} 118 <tr> 119 <td colspan="9">No Responses</td> 120 </tr> 121 {{ end }} 122 </tbody> 123 </table> 124 </div> 125 </div> 126 </div> 127 {{ template "footer" }}{{ end }}