This commit is contained in:
nemunaire 2020-03-08 01:06:44 +01:00
commit 0a79763f69
17 changed files with 459 additions and 158 deletions

View file

@ -3,13 +3,13 @@
<h2>Accès à votre compte</h2>
<div class="form-group">
<label for="login">CRI login</label>
<input class="form-control" id="login" ng-model="auth.username" placeholder="Entrer votre login" autofocus>
<input class="form-control" id="login" ng-model="auth.username" placeholder="Entrer votre login" autofocus disabled>
</div>
<div class="form-group">
<label for="password">Mot de passe</label>
<input type="password" class="form-control" id="password" ng-model="auth.password" placeholder="Mot de passe">
<input type="password" class="form-control" id="password" ng-model="auth.password" placeholder="Mot de passe" disabled>
</div>
<button type="submit" class="btn btn-primary">
<button type="submit" class="btn btn-secondary disabled" disabled>
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" ng-show="pleaseWait"></span>
Me connecter
</button>

View file

@ -0,0 +1,46 @@
<h2>
<span class="text-muted">{{ survey.title }}</span>
<small>
<span class="badge badge-danger" ng-if="survey.start_availability > now">Prévu</span>
<span class="badge badge-warning" ng-if="survey.start_availability <= now && survey.end_availability >= now">En cours</span>
<span class="badge badge-danger" ng-if="survey.end_availability < now">Clos</span>
</small>
</h2>
<h3>
{{ question.title }}
</h3>
<form class="mb-5" ng-submit="submitCorrections()" ng-cloak>
<div class="card mb-2" ng-repeat="response in responses">
<div class="card-body">
<button class="btn btn-success ml-1 float-right" ng-click="submitCorrection()"><svg class="bi bi-check" width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M15.854 5.646a.5.5 0 010 .708l-7 7a.5.5 0 01-.708 0l-3.5-3.5a.5.5 0 11.708-.708L8.5 12.293l6.646-6.647a.5.5 0 01.708 0z" clip-rule="evenodd"></path></svg></button>
<p class="card-text" style="white-space: pre-line" ng-bind="response.value"></p>
<div class="form-group">
<div class="input-group mb-1">
<input class="form-control" type="number" ng-model="response.score" integer>
<div class="input-group-append">
<span class="input-group-text">/100</span>
</div>
</div>
</div>
<div class="form-group">
<textarea class="form-control" rows="1" ng-model="response.score_explaination" placeholder="Appréciation"></textarea>
</div>
<div class="form-group row" ng-if="response.time_scored">
<label class="col-2 col-form-label col-form-label-sm">Correction effectuée&nbsp;:</label>
<div class="col-10">
<input type="text" class="form-control-plaintext form-control-sm" value="{{ response.time_scored | date:'medium'}}" readonly>
</div>
</div>
<div class="form-group row" ng-if="response.time_scored">
<label class="col-2 col-form-label col-form-label-sm">Correcteur&nbsp;:</label>
<div class="col-10">
<input type="text" class="form-control-plaintext form-control-sm" value="{{ response.id_corrector }}" readonly>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary" ng-disabled="submitInProgress">Soumettre les corrections</button>
</form>

View file

@ -1,5 +1,5 @@
<div class="jumbotron mt-2">
<img class="float-right" src="https://photos.cri.epita.fr/thumb/mercie_d" alt="avatar" style="max-height: 150px">
<div class="jumbotron mt-2" ng-if="isLogged">
<img class="float-right" src="https://photos.cri.epita.fr/thumb/{{ isLogged.login }}" alt="avatar" style="max-height: 150px">
<h1>
Bienvenue {{ isLogged.login }}&nbsp;!
</h1>
@ -7,20 +7,17 @@
<p class="lead">Voici la liste des questionnaires&nbsp;:</p>
<table class="table" ng-controller="SurveysController">
<thead>
<tr>
<th>Intitulé</th>
<th>État</th>
<th>Date</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="survey in surveys">
<td>{{ survey }}</td>
</tr>
</tbody>
</table>
<survey-list surveys="surveys" islogged="isLogged"></survey-list>
</div>
<div class="mt-2" ng-if="!isLogged">
<h3>Cours</h3>
<ul>
<li><a href="adlin" target="_self">ADministration Linux avancée</a></li>
<li><a href="fic" target="_self">FIC</a></li>
<li><a href="virli" target="_self">Virtualisation légère</a></li>
</ul>
<h3>Questionnaires</h3>
<survey-list surveys="surveys"></survey-list>
</div>

View file

@ -0,0 +1,25 @@
<h2>
{{ survey.title }}
<small>
<span class="badge badge-danger" ng-if="survey.start_availability > now">Prévu</span>
<span class="badge badge-warning" ng-if="survey.start_availability <= now && survey.end_availability >= now">En cours</span>
<span class="badge badge-danger" ng-if="survey.end_availability < now">Clos</span>
</small>
</h2>
<table class="table table-hover table-striped mb-5" ng-controller="QuestionsController" ng-if="survey.id" ng-cloak>
<thead>
<tr>
<th>Question</th>
<th>Réponses</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(qid,question) in questions" ng-click="showResponses()" ng-controller="ResponsesController">
<td ng-bind="question.title"></td>
<td>{{ responses.length }}</td>
<td></td>
</tr>
</tbody>
</table>

View file

@ -1,12 +1,9 @@
<button class="btn btn-primary ml-1 float-right" ng-click="editSurvey()" ng-if="user.is_admin && !survey.edit"><svg class="bi bi-pencil" width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M13.293 3.293a1 1 0 011.414 0l2 2a1 1 0 010 1.414l-9 9a1 1 0 01-.39.242l-3 1a1 1 0 01-1.266-1.265l1-3a1 1 0 01.242-.391l9-9zM14 4l2 2-9 9-3 1 1-3 9-9z" clip-rule="evenodd"></path><path fill-rule="evenodd" d="M14.146 8.354l-2.5-2.5.708-.708 2.5 2.5-.708.708zM5 12v.5a.5.5 0 00.5.5H6v.5a.5.5 0 00.5.5H7v.5a.5.5 0 00.5.5H8v-1.5a.5.5 0 00-.5-.5H7v-.5a.5.5 0 00-.5-.5H5z" clip-rule="evenodd"></path></svg></button>
<a href="surveys/{{ survey.id }}/responses" class="btn btn-success ml-1 float-right" ng-if="user.is_admin"><svg class="bi bi-documents" width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M5 4h8a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2zm0 1a1 1 0 00-1 1v10a1 1 0 001 1h8a1 1 0 001-1V6a1 1 0 00-1-1H5z" clip-rule="evenodd"></path><path d="M7 2h8a2 2 0 012 2v10a2 2 0 01-2 2v-1a1 1 0 001-1V4a1 1 0 00-1-1H7a1 1 0 00-1 1H5a2 2 0 012-2z"></path></svg></a>
<h2>
{{ survey.title }}
<small>
<span class="badge badge-danger" ng-if="survey.start_availability > now">Prévu</span>
<span class="badge badge-warning" ng-if="survey.start_availability <= now && survey.end_availability >= now">En cours</span>
<span class="badge badge-danger" ng-if="survey.end_availability < now">Clos</span>
<span class="badge badge-success">Validé</span>
<span class="badge badge-info">Corrigé</span>
<survey-badges survey="survey"></survey-badges>
</small>
</h2>
@ -40,6 +37,13 @@
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="corrected" ng-model="survey.corrected">
<label class="form-check-label" for="corrected">
Marqué comme corrigé
</label>
</div>
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-primary">Enregistrer</button>
@ -50,6 +54,7 @@
</form>
<form class="mb-5" ng-submit="submitAnswers()" ng-controller="QuestionsController" ng-if="survey.id" ng-cloak>
<div class="card mb-2" ng-repeat="(qid,question) in questions">
<div class="card-body">
<button class="btn btn-danger ml-1 float-right" ng-click="deleteQuestion()" ng-if="user.is_admin"><svg class="bi bi-trash-fill" width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.5 3a1 1 0 00-1 1v1a1 1 0 001 1H5v9a2 2 0 002 2h6a2 2 0 002-2V6h.5a1 1 0 001-1V4a1 1 0 00-1-1H12a1 1 0 00-1-1H9a1 1 0 00-1 1H4.5zm3 4a.5.5 0 01.5.5v7a.5.5 0 01-1 0v-7a.5.5 0 01.5-.5zM10 7a.5.5 0 01.5.5v7a.5.5 0 01-1 0v-7A.5.5 0 0110 7zm3 .5a.5.5 0 00-1 0v7a.5.5 0 001 0v-7z" clip-rule="evenodd"></path></svg></button>
@ -72,7 +77,8 @@
</div>
</div>
<textarea class="form-control" ng-if="!question.edit && question.kind == 'text'" rows="6" ng-model="question.value" placeholder="{{ question.placeholder }}"></textarea>
<textarea class="form-control" ng-if="!question.edit && question.kind == 'text' && !survey.readonly" rows="6" ng-model="question.value" placeholder="{{ question.placeholder }}"></textarea>
<p class="card-text alert alert-secondary" style="white-space: pre-line" ng-bind="question.value" ng-if="!question.edit && survey.readonly"></p>
<div class="form-group row" ng-if="question.edit && question.kind == 'text'">
<label class="col-2 col-form-label" for="q{{qid}}placeholder">Placeholder</label>
<div class="col">
@ -81,6 +87,8 @@
</div>
<p class="card-text text-center text-danger" ng-if="question.kind == 'mcq'">QCM non implémentés</p>
<p class="card-text alert alert-success" style="white-space: pre-line" ng-if="!question.edit && (question.response.score_explaination || question.response.score)"><strong>{{question.response.score}}&nbsp;:</strong> {{ question.response.score_explaination }}</p>
</div>
</div>

View file

@ -1,28 +1 @@
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Intitulé</th>
<th>État</th>
<th>Date</th>
<th>Score</th>
</tr>
</thead>
<tbody style="cursor: pointer;">
<tr ng-repeat="survey in surveys" ng-if="survey.shown" ng-click="show(survey.id)">
<td>{{ survey.title }}</td>
<td class="bg-info" ng-if="survey.start_availability > now">Prévu</td>
<td class="bg-warning" ng-if="survey.start_availability <= now && survey.end_availability >= now">En cours</td>
<td class="bg-success" ng-if="survey.end_availability < now">Terminé</td>
<td ng-if="survey.start_availability > now">{{ survey.start_availability | date: "medium" }}</td>
<td ng-if="survey.start_availability <= now">{{ survey.end_availability | date: "medium" }}</td>
<td>N/A</td>
</tr>
</tbody>
<tfoot ng-if="user.is_admin">
<tr>
<td colspan="4">
<a href="surveys/new" class="btn btn-sm btn-primary">Ajouter un questionnaire</a>
</td>
</tr>
</tfoot>
</table>
<survey-list surveys="surveys" islogged="isLogged" isadmin="user.is_admin"></survey-list>