-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ admin: create flash algorithm config component
- Loading branch information
1 parent
9fd5100
commit 3d03481
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
admin/app/components/administration/certification/flash-algorithm-configuration.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import PixBlock from '@1024pix/pix-ui/components/pix-block'; | ||
import PixButton from '@1024pix/pix-ui/components/pix-button'; | ||
import PixInput from '@1024pix/pix-ui/components/pix-input'; | ||
import PixMessage from '@1024pix/pix-ui/components/pix-message'; | ||
import { on } from '@ember/modifier'; | ||
import { action } from '@ember/object'; | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { t } from 'ember-intl'; | ||
|
||
export default class FlashAlgorithmConfiguration extends Component { | ||
@tracked form = { | ||
maximumAssessmentLength: 0, | ||
warmUpLength: 0, | ||
challengesBetweenSameCompetence: 0, | ||
variationPercent: 0, | ||
variationPercentUntil: 0, | ||
doubleMeasuresUntil: 0, | ||
limitToOneQuestionPerTube: false, | ||
enablePassageByAllCompetences: false, | ||
}; | ||
|
||
@action | ||
onCreateFlashAlgorithmConfiguration(event) { | ||
event.preventDefault(); | ||
console.log('creating configuration', this.form) | ||
} | ||
|
||
@action | ||
updateNumberValues(event) { | ||
this.form = {...this.form, [event.target.id]: event.target.value} | ||
} | ||
|
||
@action | ||
updateCheckboxValues(event) { | ||
this.form = {...this.form, [event.target.id]: event.target.checked} | ||
} | ||
|
||
<template> | ||
<PixBlock class="page-section"> | ||
|
||
<h2 class="page-section__title"> | ||
Configuration de l’algorithme de déroulé du test | ||
</h2> | ||
|
||
<form class="flash-algorithm-configuration-form"> | ||
<PixInput {{on "input" this.updateNumberValues}} @id="maximumAssessmentLength" @value={{this.form.maximumAssessmentLength}} type="number"> | ||
<:label>Nombre de questions</:label> | ||
</PixInput> | ||
|
||
<PixInput {{on "input" this.updateNumberValues}} @id="warmUpLength" @value={{this.form.warmUpLength}} type="number"> | ||
<:label>Nombre de questions d'entrainement</:label> | ||
</PixInput> | ||
|
||
<PixInput {{on "input" this.updateNumberValues}} @id="challengesBetweenSameCompetence" @value={{this.form.challengesBetweenSameCompetence}} type="number"> | ||
<:label>Nombre de questions entre 2 questions de la même compétence</:label> | ||
</PixInput> | ||
|
||
<PixInput {{on "input" this.updateNumberValues}} @id="variationPercent" @value={{this.form.variationPercent}} type="number"> | ||
<:label>Capage de la capacité (en % )</:label> | ||
</PixInput> | ||
|
||
<PixInput {{on "input" this.updateNumberValues}} @id="variationPercentUntil" @value={{this.form.variationPercentUntil}} type="number"> | ||
<:label>Nombre de questions pour le capage de la capacité</:label> | ||
</PixInput> | ||
|
||
<PixInput {{on "input" this.updateNumberValues}} @id="doubleMeasuresUntil" @value={{this.form.doubleMeasuresUntil}} type="number"> | ||
<:label>Nombre de questions pour la double mesure</:label> | ||
</PixInput> | ||
|
||
<PixInput {{on "input" this.updateCheckboxValues}} @id="limitToOneQuestionPerTube" @value={{this.form.limitToOneQuestionPerTube}} type="checkbox"> | ||
<:label>Limiter à une question par sujet</:label> | ||
</PixInput> | ||
|
||
<PixInput {{on "input" this.updateCheckboxValues}} @id="enablePassageByAllCompetences" @value={{this.form.enablePassageByAllCompetences}} type="checkbox"> | ||
<:label>Forcer le passage par les 16 compétences</:label> | ||
</PixInput> | ||
|
||
<PixButton | ||
class="scoring-simulator__form-button" | ||
@type="submit" | ||
@triggerAction={{this.onCreateFlashAlgorithmConfiguration}} | ||
>{{t "pages.administration.certification.scoring-simulator.actions.submit"}}</PixButton> | ||
</form> | ||
</PixBlock> | ||
</template> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters