admin: Can gain points for each question answered // partial exercice solved
This commit is contained in:
parent
4ca2bc106a
commit
8e196136c3
8 changed files with 30 additions and 5 deletions
|
@ -310,6 +310,7 @@ func ApplySettings(config *settings.Settings) {
|
|||
fic.SubmissionCostBase = config.SubmissionCostBase
|
||||
fic.SubmissionUniqueness = config.SubmissionUniqueness
|
||||
fic.CountOnlyNotGoodTries = config.CountOnlyNotGoodTries
|
||||
fic.QuestionGainRatio = config.QuestionGainRatio
|
||||
|
||||
if config.DiscountedFactor != fic.DiscountedFactor {
|
||||
fic.DiscountedFactor = config.DiscountedFactor
|
||||
|
@ -329,6 +330,7 @@ func ResetSettings() error {
|
|||
WChoiceCurCoefficient: 1,
|
||||
GlobalScoreCoefficient: 1,
|
||||
DiscountedFactor: 0,
|
||||
QuestionGainRatio: 0,
|
||||
UnlockedStandaloneExercices: 10,
|
||||
UnlockedStandaloneExercicesByThemeStepValidation: 1,
|
||||
UnlockedStandaloneExercicesByStandaloneExerciceValidation: 0,
|
||||
|
|
|
@ -104,6 +104,12 @@
|
|||
<input type="text" class="form-control form-control-sm" id="submissionCostBase" ng-model="config.submissionCostBase" float ng-class="{'border-primary': config.submissionCostBase != dist_config.submissionCostBase}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm row" title="Accorder des points aux exercices partiellement résolu, par questions validée. Ce champ est le pourcentage de points que peut rapporter la complétion de toutes les questions d'un exercice. Par exemple avec 25%, un exercice avec 10 questions, chaque question validée rapportera GAIN * 25% / 10">
|
||||
<label for="questionGainRatio" class="col-sm-8 col-form-label col-form-label-sm text-right text-truncate" ng-class="{'text-primary font-weight-bold': config.questionGainRatio != dist_config.questionGainRatio}">Gain par questions</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control form-control-sm" id="questionGainRatio" ng-model="config.questionGainRatio" float ng-class="{'border-primary': config.questionGainRatio != dist_config.questionGainRatio}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<th>Date</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="row in scores | filter: query | orderBy:'time'" ng-class="{'bg-danger': row.reason == 'Bonus flag', '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'}">
|
||||
<tr ng-repeat="row in scores | filter: query | orderBy:'time'" ng-class="{'bg-danger': row.reason == 'Bonus flag', 'bg-ffound': row.reason == 'First blood', 'bg-wchoices': row.reason == 'Display choices', 'bg-success': row.reason == 'Validation', 'bg-info': row.reason == 'Hint', 'bg-secondary': row.reason.startsWith('Response '), '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>
|
||||
|
@ -23,9 +23,12 @@
|
|||
<td>
|
||||
{{ row.points * row.coeff }}
|
||||
</td>
|
||||
<td>
|
||||
<td ng-if="!row.reason.startsWith('Response ')">
|
||||
{{ row.points }} * {{ row.coeff }}
|
||||
</td>
|
||||
<td ng-if="row.reason.startsWith('Response ')">
|
||||
{{ row.points }} * {{ settings.questionGainRatio }} / {{ settings.questionGainRatio / row.coeff }}
|
||||
</td>
|
||||
<td>
|
||||
<nobr title="{{ row.time }}">{{ row.time | date:"mediumTime" }}</nobr>
|
||||
</td>
|
||||
|
|
Reference in a new issue