Skip to content

Commit 18c040e

Browse files
[TECH] Suppression des paramètres non utilisés de l'algo flash (PIX-15475).
#10678
2 parents af0eaa6 + 4143c8f commit 18c040e

File tree

41 files changed

+466
-1531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+466
-1531
lines changed

admin/app/components/administration/certification/flash-algorithm-configuration/form.gjs

-26
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ import { t } from 'ember-intl';
1818
}}</:label>
1919
</PixInput>
2020

21-
<PixInput {{on "input" @updateNumberValues}} @id="warmUpLength" @value={{@form.warmUpLength}} type="number" min="0">
22-
<:label>{{t "pages.administration.certification.flash-algorithm-configuration.form.warmUpLength"}}</:label>
23-
</PixInput>
24-
2521
<PixInput
2622
{{on "input" @updateNumberValues}}
2723
@id="challengesBetweenSameCompetence"
@@ -44,28 +40,6 @@ import { t } from 'ember-intl';
4440
<:label>{{t "pages.administration.certification.flash-algorithm-configuration.form.variationPercent"}}</:label>
4541
</PixInput>
4642

47-
<PixInput
48-
{{on "input" @updateNumberValues}}
49-
@id="variationPercentUntil"
50-
@value={{@form.variationPercentUntil}}
51-
type="number"
52-
min="0"
53-
>
54-
<:label>{{t
55-
"pages.administration.certification.flash-algorithm-configuration.form.variationPercentUntil"
56-
}}</:label>
57-
</PixInput>
58-
59-
<PixInput
60-
{{on "input" @updateNumberValues}}
61-
@id="doubleMeasuresUntil"
62-
@value={{@form.doubleMeasuresUntil}}
63-
type="number"
64-
min="0"
65-
>
66-
<:label>{{t "pages.administration.certification.flash-algorithm-configuration.form.doubleMeasuresUntil"}}</:label>
67-
</PixInput>
68-
6943
<PixCheckbox
7044
{{on "input" @updateCheckboxValues}}
7145
@id="limitToOneQuestionPerTube"

admin/app/components/administration/certification/flash-algorithm-configuration/index.gjs

-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ export default class FlashAlgorithmConfiguration extends Component {
1212
@service pixToast;
1313
@tracked form = {
1414
maximumAssessmentLength: this.args.model.maximumAssessmentLength,
15-
warmUpLength: this.args.model.warmUpLength,
1615
challengesBetweenSameCompetence: this.args.model.challengesBetweenSameCompetence,
1716
variationPercent: this.args.model.variationPercent,
18-
variationPercentUntil: this.args.model.variationPercentUntil,
19-
doubleMeasuresUntil: this.args.model.doubleMeasuresUntil,
2017
limitToOneQuestionPerTube: this.args.model.limitToOneQuestionPerTube,
2118
enablePassageByAllCompetences: this.args.model.enablePassageByAllCompetences,
2219
};
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import Model, { attr } from '@ember-data/model';
22

33
export default class FlashAlgorithmConfiguration extends Model {
4-
@attr('number') warmUpLength;
54
@attr('number') maximumAssessmentLength;
65
@attr('number') challengesBetweenSameCompetence;
76
@attr('number') variationPercent;
8-
@attr('number') variationPercentUntil;
9-
@attr('number') doubleMeasuresUntil;
107
@attr('boolean') limitToOneQuestionPerTube;
118
@attr('boolean') enablePassageByAllCompetences;
12-
@attr('array') forcedCompetences;
13-
@attr('array') minimumEstimatedSuccessRateRanges;
149
}

admin/tests/integration/components/administration/certification/flash-algorithm-configuration_test.gjs

-15
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ module('Integration | Component | administration/certification/flash-algorithm-
1111
// given
1212
const flashAlgorithmConfiguration = {
1313
maximumAssessmentLength: 1,
14-
warmUpLength: 2,
1514
challengesBetweenSameCompetence: 3,
1615
variationPercent: 4,
17-
variationPercentUntil: 5,
18-
doubleMeasuresUntil: 6,
1916
limitToOneQuestionPerTube: true,
2017
enablePassageByAllCompetences: false,
2118
};
@@ -29,21 +26,12 @@ module('Integration | Component | administration/certification/flash-algorithm-
2926
const maximumAssessmentLength = await screen.getByRole('spinbutton', {
3027
name: t('pages.administration.certification.flash-algorithm-configuration.form.maximumAssessmentLength'),
3128
}).value;
32-
const warmUpLength = await screen.getByRole('spinbutton', {
33-
name: t('pages.administration.certification.flash-algorithm-configuration.form.warmUpLength'),
34-
}).value;
3529
const challengesBetweenSameCompetence = await screen.getByRole('spinbutton', {
3630
name: t('pages.administration.certification.flash-algorithm-configuration.form.challengesBetweenSameCompetence'),
3731
}).value;
3832
const variationPercent = await screen.getByRole('spinbutton', {
3933
name: t('pages.administration.certification.flash-algorithm-configuration.form.variationPercent'),
4034
}).value;
41-
const variationPercentUntil = await screen.getByRole('spinbutton', {
42-
name: t('pages.administration.certification.flash-algorithm-configuration.form.variationPercentUntil'),
43-
}).value;
44-
const doubleMeasuresUntil = await screen.getByRole('spinbutton', {
45-
name: t('pages.administration.certification.flash-algorithm-configuration.form.doubleMeasuresUntil'),
46-
}).value;
4735
const limitToOneQuestionPerTube = await screen.getByRole('checkbox', {
4836
name: t('pages.administration.certification.flash-algorithm-configuration.form.limitToOneQuestionPerTube'),
4937
}).checked;
@@ -52,11 +40,8 @@ module('Integration | Component | administration/certification/flash-algorithm-
5240
}).checked;
5341

5442
assert.strictEqual(maximumAssessmentLength, '1');
55-
assert.strictEqual(warmUpLength, '2');
5643
assert.strictEqual(challengesBetweenSameCompetence, '3');
5744
assert.strictEqual(variationPercent, '4');
58-
assert.strictEqual(variationPercentUntil, '5');
59-
assert.strictEqual(doubleMeasuresUntil, '6');
6045
assert.true(limitToOneQuestionPerTube);
6146
assert.false(enablePassageByAllCompetences);
6247
});

admin/tests/unit/adapters/flash-algorithm-configuration-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module('Unit | Adapters | flash-algorithm-configuration', function (hooks) {
2525
module('#createRecord', () => {
2626
test('should call the post url with the correct payload', async function (assert) {
2727
// given
28-
const flashAlgorithmConfiguration = { warmUpLength: 2 };
28+
const flashAlgorithmConfiguration = { enablePassageByAllCompetences: true };
2929
const payload = { data: flashAlgorithmConfiguration };
3030
const adapter = this.owner.lookup('adapter:flash-algorithm-configuration');
3131
sinon.stub(adapter, 'ajax');

admin/tests/unit/components/administration/certification/flash-algorithm-configuration-test.js

-6
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ module('Unit | Component | authenticated/certifications/flash-algorithm-configur
2828

2929
const flashAlgorithmConfiguration = {
3030
maximumAssessmentLength: 0,
31-
warmUpLength: 1,
3231
challengesBetweenSameCompetence: 2,
3332
variationPercent: 3,
34-
variationPercentUntil: 4,
35-
doubleMeasuresUntil: 5,
3633
limitToOneQuestionPerTube: true,
3734
enablePassageByAllCompetences: true,
3835
};
@@ -72,11 +69,8 @@ module('Unit | Component | authenticated/certifications/flash-algorithm-configur
7269

7370
const flashAlgorithmConfiguration = {
7471
maximumAssessmentLength: 0,
75-
warmUpLength: 1,
7672
challengesBetweenSameCompetence: 2,
7773
variationPercent: 3,
78-
variationPercentUntil: 4,
79-
doubleMeasuresUntil: 5,
8074
limitToOneQuestionPerTube: true,
8175
enablePassageByAllCompetences: true,
8276
};

admin/translations/en.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -402,13 +402,10 @@
402402
"title": "Configuration de l’algorithme de déroulé du test",
403403
"form": {
404404
"challengesBetweenSameCompetence": "Nombre de questions entre 2 questions de la même compétence",
405-
"doubleMeasuresUntil": "Nombre de questions pour la double mesure",
406405
"enablePassageByAllCompetences": "Forcer le passage par les 16 compétences",
407406
"limitToOneQuestionPerTube": "Limiter à une question par sujet",
408407
"maximumAssessmentLength": "Nombre de questions",
409-
"variationPercent": "Capage de la capacité (en % )",
410-
"variationPercentUntil": "Nombre de questions pour le capage de la capacité",
411-
"warmUpLength": "Nombre de questions d'entraînement"
408+
"variationPercent": "Capage de la capacité (en % )"
412409
}
413410
},
414411
"sco-whitelist": {

admin/translations/fr.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,10 @@
412412
"title": "Configuration de l’algorithme de déroulé du test",
413413
"form": {
414414
"challengesBetweenSameCompetence": "Nombre de questions entre 2 questions de la même compétence",
415-
"doubleMeasuresUntil": "Nombre de questions pour la double mesure",
416415
"enablePassageByAllCompetences": "Forcer le passage par les 16 compétences",
417416
"limitToOneQuestionPerTube": "Limiter à une question par sujet",
418417
"maximumAssessmentLength": "Nombre de questions",
419-
"variationPercent": "Capage de la capacité (en % )",
420-
"variationPercentUntil": "Nombre de questions pour le capage de la capacité",
421-
"warmUpLength": "Nombre de questions d'entraînement"
418+
"variationPercent": "Capage de la capacité (en % )"
422419
}
423420
},
424421
"sco-whitelist": {

api/db/database-builder/factory/build-flash-algorithm-configuration.js

-10
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,19 @@ import { config } from '../../../src/shared/config.js';
22
import { databaseBuffer } from '../database-buffer.js';
33

44
const buildFlashAlgorithmConfiguration = function ({
5-
warmUpLength = null,
6-
forcedCompetences = [],
75
maximumAssessmentLength = config.v3Certification.numberOfChallengesPerCourse,
86
challengesBetweenSameCompetence = null,
9-
minimumEstimatedSuccessRateRanges = [],
107
limitToOneQuestionPerTube = null,
118
enablePassageByAllCompetences = false,
12-
doubleMeasuresUntil = null,
139
variationPercent = null,
14-
variationPercentUntil = null,
1510
createdAt = new Date(),
1611
} = {}) {
1712
const values = {
18-
warmUpLength,
1913
maximumAssessmentLength,
2014
challengesBetweenSameCompetence,
21-
forcedCompetences: JSON.stringify(forcedCompetences),
22-
minimumEstimatedSuccessRateRanges: JSON.stringify(minimumEstimatedSuccessRateRanges),
2315
limitToOneQuestionPerTube,
2416
enablePassageByAllCompetences,
25-
doubleMeasuresUntil,
2617
variationPercent,
27-
variationPercentUntil,
2818
createdAt,
2919
};
3020

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const TABLE_NAME = 'flash-algorithm-configurations';
2+
const WARM_UP_LENGTH_COLUMN_NAME = 'warmUpLength';
3+
const FORCED_COMPETENCES_COLUMN_NAME = 'forcedCompetences';
4+
const MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME = 'minimumEstimatedSuccessRateRanges';
5+
const DOUBLE_MEASURES_UNTIL_COLUMN_NAME = 'doubleMeasuresUntil';
6+
const VARIATION_PERCENT_UNTIL_COLUMN_NAME = 'variationPercentUntil';
7+
8+
const up = function (knex) {
9+
return knex.schema.table(TABLE_NAME, (table) => {
10+
table.dropColumn(WARM_UP_LENGTH_COLUMN_NAME);
11+
table.dropColumn(FORCED_COMPETENCES_COLUMN_NAME);
12+
table.dropColumn(MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME);
13+
table.dropColumn(DOUBLE_MEASURES_UNTIL_COLUMN_NAME);
14+
table.dropColumn(VARIATION_PERCENT_UNTIL_COLUMN_NAME);
15+
table.comment(`Configuration parameters used to alter the behaviour of the flash algorithm.`);
16+
});
17+
};
18+
19+
const down = function (knex) {
20+
return knex.schema.table(TABLE_NAME, (table) => {
21+
table.integer(WARM_UP_LENGTH_COLUMN_NAME);
22+
table.jsonb(FORCED_COMPETENCES_COLUMN_NAME);
23+
table.jsonb(MINIMUM_ESTIMATED_SUCCESS_RATE_RANGES_COLUMN_NAME);
24+
table.integer(DOUBLE_MEASURES_UNTIL_COLUMN_NAME);
25+
table.integer(VARIATION_PERCENT_UNTIL_COLUMN_NAME);
26+
});
27+
};
28+
29+
export { down, up };

api/db/seeds/data/team-certification/data-builder.js

-5
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,11 @@ async function _createScoCertificationCenter({ databaseBuilder }) {
118118

119119
function _createV3CertificationConfiguration({ databaseBuilder }) {
120120
databaseBuilder.factory.buildFlashAlgorithmConfiguration({
121-
warmUpLength: null,
122-
forcedCompetences: [],
123121
maximumAssessmentLength: 32,
124122
challengesBetweenSameCompetence: null,
125-
minimumEstimatedSuccessRateRanges: [],
126123
limitToOneQuestionPerTube: true,
127124
enablePassageByAllCompetences: true,
128-
doubleMeasuresUntil: null,
129125
variationPercent: 0.5,
130-
variationPercentUntil: null,
131126
createdAt: new Date('1977-10-19'),
132127
});
133128
}

api/lib/domain/usecases/get-next-challenge-for-campaign-assessment.js

-3
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ const _hasAnsweredToAllChallenges = ({ possibleChallenges }) => {
6565

6666
const _createDefaultAlgorithmConfiguration = () => {
6767
return new FlashAssessmentAlgorithmConfiguration({
68-
warmUpLength: 0,
69-
forcedCompetences: [],
7068
limitToOneQuestionPerTube: false,
71-
minimumEstimatedSuccessRateRanges: [],
7269
enablePassageByAllCompetences: false,
7370
});
7471
};

api/scripts/certification/next-gen/generate-flash-algorithm-configuration.js

-48
This file was deleted.

api/src/certification/flash-certification/application/flash-assessment-configuration-route.js

-4
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ const register = async (server) => {
3535
],
3636
validate: {
3737
payload: Joi.object({
38-
warmUpLength: Joi.number().integer().min(0).allow(null).optional(),
39-
forcedCompetences: Joi.array().items(Joi.string()).optional(),
4038
maximumAssessmentLength: Joi.number().integer().min(0).allow(null).optional(),
4139
challengesBetweenSameCompetence: Joi.number().integer().min(0).allow(null).optional(),
4240
limitToOneQuestionPerTube: Joi.boolean().optional(),
4341
enablePassageByAllCompetences: Joi.boolean().optional(),
44-
doubleMeasuresUntil: Joi.number().min(0).allow(null).optional(),
4542
variationPercent: Joi.number().min(0).max(1).allow(null).optional(),
46-
variationPercentUntil: Joi.number().min(0).allow(null).optional(),
4743
}),
4844
},
4945
handler: flashAssessmentConfigurationController.createFlashAssessmentConfiguration,

0 commit comments

Comments
 (0)