admin: new page to see score details

This commit is contained in:
nemunaire 2019-01-17 13:51:44 +01:00
commit 024ae04f45
3 changed files with 59 additions and 2 deletions

View file

@ -1,6 +1,9 @@
<h1>
{{ team.name }}
<button type="button" ng-click="showStats()" class="float-right btn btn- btn-primary" ng-if="team.id">
<button type="button" ng-click="showScore()" class="float-right btn btn-primary mr-1" ng-if="team.id">
Score
</button>
<button type="button" ng-click="showStats()" class="float-right btn btn-primary mr-1" ng-if="team.id">
<span class="glyphicon glyphicon-list" aria-hidden="true"></span>
Statistiques
</button>
@ -98,7 +101,7 @@
<tbody>
<tr ng-repeat="row in history" ng-class="{'bg-ffound': row.kind == 'flag_found', 'bg-mfound': row.kind == 'mcq_found', 'bg-wchoices': row.kind == 'wchoices', 'bg-success': row.kind == 'solved', 'bg-info': row.kind == 'hint', 'bg-warning': row.kind == 'tries'}">
<td>
<nobr>{{ row.time | date:"mediumTime" }}</nobr><br>{{ row.kind }}
<nobr title="{{ row.time }}">{{ row.time | date:"mediumTime" }}</nobr><br>{{ row.kind }}
</td>
<td>
<span ng-if="row.primary_title">

View file

@ -0,0 +1,39 @@
<h1>
<a href="teams/{{team.id}}">{{ team.name }}</a>
<small class="text-muted">Détails des scores</small>
</h1>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
<table ng-controller="TeamScoreController" class="table table-hover table-striped table-bordered bg-dark text-light">
<thead>
<th>Exercice</th>
<th>Raison</th>
<th>Points</th>
<th>Calcul</th>
<th>Date</th>
</thead>
<tbody>
<tr ng-repeat="row in scores | filter: query | orderBy:'time'" ng-class="{'bg-ffound': row.reason == 'First blood', 'bg-wchoices': row.reason == 'Display choices', 'bg-success': row.reason == 'Validation', 'bg-info': row.reason == 'Hint', 'bg-warning': row.reason == 'Tries'}">
<td>
<a ng-repeat="exercice in exercices" ng-if="exercice.id == row.id_exercice" href="exercices/{{ row.id_exercice }}">{{ exercice.title }}</a>
</td>
<td>
{{ row.reason }}
</td>
<td>
{{ row.points * row.coeff }}
</td>
<td>
{{ row.points }} * {{ row.coeff }}
</td>
<td>
<nobr title="{{ row.time }}">{{ row.time | date:"mediumTime" }}</nobr>
</td>
</tr>
<tfoot>
<th></th>
<th></th>
<th>{{ my.score }}</th>
</thead>
</tbody>
</table>