Implement MCQ
This commit is contained in:
parent
7267af8513
commit
00f196bac3
4 changed files with 221 additions and 4 deletions
|
|
@ -14,7 +14,13 @@
|
|||
<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>
|
||||
<p class="card-text" style="white-space: pre-line" ng-bind="response.value" ng-if="question.kind == 'text'"></p>
|
||||
<div class="card-text" ng-if="question.kind == 'mcq'" ng-controller="ProposalsController">
|
||||
<div class="form-group form-check" ng-repeat="proposal in proposals">
|
||||
<input type="checkbox" disabled class="form-check-input" id="p{{proposal.id}}" ng-checked="response.value.indexOf(proposal.id) != -1">
|
||||
<label class="form-check-label" for="p{{proposal.id}}">{{ proposal.label }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="input-group mb-1">
|
||||
|
|
|
|||
|
|
@ -86,7 +86,23 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p class="card-text text-center text-danger" ng-if="question.kind == 'mcq'">QCM non implémentés</p>
|
||||
<div ng-controller="ProposalsController" ng-if="question.kind == 'mcq'">
|
||||
<div class="form-group form-check" ng-if="!question.edit" ng-repeat="proposal in proposals">
|
||||
<input type="checkbox" class="form-check-input" id="p{{proposal.id}}" ng-model="question['p' + proposal.id]" ng-disabled="survey.readonly">
|
||||
<label class="form-check-label" for="p{{proposal.id}}">{{ proposal.label }}</label>
|
||||
</div>
|
||||
<div class="form-group row" ng-if="question.edit" ng-repeat="proposal in proposals">
|
||||
<div class="col">
|
||||
<input type="text" class="form-control" id="pi{{proposal.id}}" placeholder="Label" ng-model="proposal.label">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-success ml-1" ng-click="saveProposal()" ng-if="question.edit && question.kind == 'mcq'"><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>
|
||||
<button type="button" class="btn btn-danger ml-1" ng-click="deleteProposal()" ng-if="question.edit && question.kind == 'mcq'"><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>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-info ml-1" ng-click="addProposal()" ng-if="question.edit && question.kind == 'mcq'"><svg class="bi bi-plus" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M8 3.5a.5.5 0 01.5.5v4a.5.5 0 01-.5.5H4a.5.5 0 010-1h3.5V4a.5.5 0 01.5-.5z" clip-rule="evenodd"></path><path fill-rule="evenodd" d="M7.5 8a.5.5 0 01.5-.5h4a.5.5 0 010 1H8.5V12a.5.5 0 01-1 0V8z" clip-rule="evenodd"></path></svg> Ajouter des proposals
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<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}} :</strong> {{ question.response.score_explaination }}</p>
|
||||
</div>
|
||||
|
|
|
|||
Reference in a new issue