qa: New service to handle QA testing by students

This commit is contained in:
nemunaire 2020-09-08 12:50:41 +02:00
commit a237936feb
37 changed files with 1476 additions and 0 deletions

View file

@ -0,0 +1,27 @@
<h2>
Défis
</h2>
<div>
<p><input type="search" class="form-control" placeholder="Filtrer" ng-model="query" ng-keypress="validateSearch($event)" autofocus></p>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}
</th>
<th>
Scénario
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="exercice in exercices | filter: query">
<td ng-repeat="field in fields" ng-click="show(exercice.id)" ng-bind-html="exercice[field]"></td>
<td>
<a ng-href="themes/{{ exercice.id_theme }}">{{ themes[exercice.id_theme].name }}</a>
</td>
</tr>
</tbody>
</table>
</div>

View file

@ -0,0 +1,105 @@
<h2>
{{exercice.title}}
<small ng-if="themes && themes[exercice.id_theme]"><a href="themes/{{ exercice.id_theme }}" title="{{themes[exercice.id_theme].authors | stripHTML}}">{{themes[exercice.id_theme].name}}</a></small>
<div class="btn-group" role="group" ng-if="themes[exercice.id_theme].exercices[exercice.id]">
<a href="exercices/{{ themes[exercice.id_theme].exercices[exercice.id].previous }}" title="Exercice précédent" ng-class="{'disabled': !themes[exercice.id_theme].exercices[exercice.id].previous}" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span></a>
<a href="exercices/{{ themes[exercice.id_theme].exercices[exercice.id].next }}" title="Exercice suivant" ng-class="{'disabled': !themes[exercice.id_theme].exercices[exercice.id].next}" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>
</div>
</h2>
<div class="row mb-3">
<div class="col-md-6" ng-bind-html="exercice.statement"></div>
<div class="col-md-6" ng-bind-html="exercice.overview"></div>
</div>
<div ng-controller="ExerciceQAController" class="mb-5">
<form ng-submit="saveQuery()" class="card mb-3">
<div class="card-header">
Qu'avez-vous pensé de ce défi ?
</div>
<div class="card-body">
<div class="form-group row" ng-repeat="(field, namedField) in namedFields">
<label for="{{ field }}" class="col-2 col-form-label col-form-label-sm">{{ namedField }}</label>
<div class="col-10">
<input type="text" class="form-control form-control-sm" id="{{ field }}" ng-model="newQuery[field]" ng-if="field != 'state' && field != 'content'">
<select class="custom-select custom-select-sm" id="{{ field }}" ng-model="newQuery[field]" ng-options="k as v for (k, v) in states" ng-if="field == 'state'"></select>
<textarea class="form-control form-control-sm" placeholder="Ajouter un commentaire" rows="2" id="{{ field }}" ng-model="newQuery[field]" ng-if="field == 'content' && !newQuery.id"></textarea>
</div>
</div>
<button type="submit" class="btn btn-primary float-right">
Soumettre
</button>
</div>
</form>
<table class="table table-bordered table-striped" ng-class="{'table-hover': queries.length, 'table-sm': queries.length}">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}
</th>
</tr>
</thead>
<tbody ng-if="queries.length">
<tr ng-repeat="(qid, q) in queries" ng-click="showComments(qid)" ng-class="{'bg-warning': qid == query_selected}">
<td ng-repeat="field in fields" ng-bind-html="q[field]"></td>
</tr>
</tbody>
<tbody ng-if="!queries.length">
<tr>
<td colspan="{{ fields.length }}" class="font-weight-bold text-info text-center">Aucun requête enregistrée</td>
</tr>
</tbody>
</table>
<div ng-if="query_selected !== null" class="card">
<div class="card-header">
<h4>{{ queries[query_selected].subject }}</h4>
</div>
<div class="card-body">
<div class="row">
<dl class="col-9 row">
<dt class="col-3">Qui ?</dt>
<dd class="col-9">{{ queries[query_selected].user }} (team #{{ queries[query_selected].id_team}})</dd>
<dt class="col-3">État</dt>
<dd class="col-9">{{ queries[query_selected].state }}</dd>
<dt class="col-3">Date de création</dt>
<dd class="col-9">{{ queries[query_selected].creation }}</dd>
<dt class="col-3">Date de résolution</dt>
<dd class="col-9">{{ queries[query_selected].solved }}</dd>
<dt class="col-3">Date de clôture</dt>
<dd class="col-9">{{ queries[query_selected].closed }}</dd>
</dl>
<div class="col-3">
<button ng-click="updateQA(queries[query_selected].id)" class="btn btn-secondary">
Mettre à jour
</button>
<button ng-click="solveQA(queries[query_selected].id)" class="btn btn-info">
Marqué comme résolu
</button>
<button ng-click="deleteQA(queries[query_selected].id)" class="btn btn-danger">
Supprimer
</button>
</div>
</div>
<table class="table table-striped">
<tr ng-repeat="comment in queries_comments">
<td>
Le {{ comment.date }}, <strong>{{ comment.user }}</strong> a écrit : {{ comment.content }}
</td>
</tr>
</table>
<form ng-submit="addComment()">
<labe for="newComment">Répondre :</label>
<textarea class="form-control" placeholder="Ajouter un commentaire" rows="2" id="newComment" ng-model="newComment.content"></textarea>
<button type="submit" class="btn btn-primary mt-1 float-right">
Ajouter le commentaire
</button>
</form>
</div>
</div>
</div>

View file

@ -0,0 +1,7 @@
<div class="jumbotron text-light bg-dark">
<h1 class="display-5">Interface QA du challenge</h1>
<div class="row">
<div class="col">
</div>
</div>
</div>

View file

@ -0,0 +1,19 @@
<h2>
Scénarios
</h2>
<p><input type="search" class="form-control" placeholder="Filtrer" ng-model="query" ng-keypress="validateSearch($event)" autofocus></p>
<table class="table table-hover table-bordered table-striped">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="theme in themes | filter: query" ng-click="show(theme.id)">
<td ng-repeat="field in fields" ng-bind-html="theme[field]"></td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,25 @@
<h2>{{theme.name}} <small class="text-muted">{{theme.authors | stripHTML}}</small></h2>
<div class="container" ng-bind-html="theme.intro"></div>
<div ng-if="theme.id" ng-controller="ExercicesListController">
<h3>
Défis ({{ exercices.length }})
</h3>
<p><input type="search" class="form-control form-control-sm" placeholder="Search" ng-model="query" autofocus></p>
<table class="table table-hover table-bordered table-striped table-sm">
<thead class="thead-dark">
<tr>
<th ng-repeat="field in fields">
{{ field }}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="exercice in exercices | filter: query" ng-click="show(exercice.id)">
<td ng-repeat="field in fields" ng-bind-html="exercice[field]"></td>
</tr>
</tbody>
</table>
</div>