Skip to content

Commit

Permalink
tech: add debug logs for get-next-challenge-for-v3-certification
Browse files Browse the repository at this point in the history
Co-authored-by: <[email protected]>
  • Loading branch information
HEYGUL committed Sep 19, 2024
1 parent 512f68b commit eeb781a
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
* @typedef {import('./index.js').CertificationCandidateForSupervisingRepository} CertificationCandidateForSupervisingRepository
*/

import Debug from 'debug';

import { AssessmentEndedError } from '../../../../shared/domain/errors.js';
import { CertificationChallenge, FlashAssessmentAlgorithm } from '../../../../shared/domain/models/index.js';

const debugGetNextChallengeForV3Certification = Debug('pix:certif:v3:get-next-challenge');

/**
* @param {Object} params
* @param {AnswerRepository} params.answerRepository
Expand Down Expand Up @@ -86,6 +90,11 @@ const getNextChallengeForV3Certification = async function ({
const challengesForCandidate = candidate.accessibilityAdjustmentNeeded
? challengesWithoutSkillsWithAValidatedLiveAlert.filter((challenge) => challenge.isAccessible)
: challengesWithoutSkillsWithAValidatedLiveAlert;
debugGetNextChallengeForV3Certification(
candidate.accessibilityAdjustmentNeeded
? `Candidate needs accessibility adjustment, possible challenges have been filtered (${challengesForCandidate.length} out of ${challengesWithoutSkillsWithAValidatedLiveAlert} selected`
: `Candidate does need any adjustment, all ${challengesWithoutSkillsWithAValidatedLiveAlert.length} have been selected`,
);

const possibleChallenges = assessmentAlgorithm.getPossibleNextChallenges({
assessmentAnswers: allAnswers,
Expand Down

0 comments on commit eeb781a

Please sign in to comment.