Skip to content

Commit

Permalink
[FEATURE] Renvoyer le nombre de challenges possibles dans le simulate…
Browse files Browse the repository at this point in the history
…ur (PIX-15216).

 #10639
  • Loading branch information
pix-service-auto-merge authored Nov 26, 2024
2 parents c561ebd + 7e6a76f commit 833f9e4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ async function simulateFlashAssessmentScenario(
errorRate: answer.errorRate,
answerStatus: answer.answerStatus,
capacity: answer.capacity,
numberOfAvailableChallenges: answer.numberOfAvailableChallenges,
})),
}) + '\n';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class AssessmentSimulatorSingleMeasureStrategy {
capacity,
reward,
answerStatus,
numberOfAvailableChallenges: possibleChallenges.length,
},
],
challengeAnswers: [newAnswer],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ describe('Acceptance | Controller | scenario-simulator-controller', function ()
expect(parsedResponse[0].simulationReport[0].reward).to.exist;
expect(parsedResponse[0].simulationReport[0].errorRate).to.exist;
expect(parsedResponse[0].simulationReport[0].answerStatus).to.exist;
expect(parsedResponse[0].simulationReport[0].numberOfAvailableChallenges).to.exist;
});

describe('when there is no connected user', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ describe('Integration | Application | scenario-simulator-controller', function (
sinon.stub(pickAnswerStatusService, 'pickAnswerStatusForCapacity');
sinon.stub(pickChallengeService, 'chooseNextChallenge');

challenge1 = domainBuilder.buildChallenge({ id: 'chall1', successProbabilityThreshold: 0.65 });
reward1 = 0.2;
errorRate1 = 0.3;
capacity1 = 0.4;
simulationResults = [
{
challenge: challenge1,
reward: reward1,
errorRate: errorRate1,
capacity: capacity1,
},
];

httpTestServer = new HttpTestServer();
await httpTestServer.register(moduleUnderTest);
});
Expand All @@ -52,9 +39,11 @@ describe('Integration | Application | scenario-simulator-controller', function (
errorRate: errorRate1,
capacity: capacity1,
answerStatus: 'ok',
numberOfAvailableChallenges: 1,
},
];
});

context('When configuring the challenge pick probability', function () {
it('should call simulateFlashAssessmentScenario usecase with correct arguments', async function () {
// given
Expand Down Expand Up @@ -108,6 +97,7 @@ describe('Integration | Application | scenario-simulator-controller', function (
reward: reward1,
difficulty: challenge1.difficulty,
discriminant: challenge1.discriminant,
numberOfAvailableChallenges: 1,
},
],
},
Expand Down Expand Up @@ -164,6 +154,7 @@ describe('Integration | Application | scenario-simulator-controller', function (
reward: reward1,
difficulty: challenge1.difficulty,
discriminant: challenge1.discriminant,
numberOfAvailableChallenges: 1,
},
],
},
Expand Down Expand Up @@ -221,6 +212,7 @@ describe('Integration | Application | scenario-simulator-controller', function (
reward: reward1,
difficulty: challenge1.difficulty,
discriminant: challenge1.discriminant,
numberOfAvailableChallenges: 1,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ describe('Unit | Domain | Models | AssessmentSimulatorSingleMeasureStrategy', fu
errorRate: expectedErrorRate,
reward: expectedReward,
answerStatus: answerForSimulator,
numberOfAvailableChallenges: 2,
},
],
challengeAnswers: [
Expand Down Expand Up @@ -248,6 +249,7 @@ describe('Unit | Domain | Models | AssessmentSimulatorSingleMeasureStrategy', fu
errorRate: expectedErrorRate,
reward: expectedReward,
answerStatus: answerForSimulator,
numberOfAvailableChallenges: 2,
},
],
challengeAnswers: [
Expand Down

0 comments on commit 833f9e4

Please sign in to comment.