Unverified Commit e4b2e87d authored by benguedj's avatar benguedj Committed by GitHub
Browse files

fix: 馃悰 Corrige l'envoie des scores du test epds (#536)

parent f5467649
......@@ -22,16 +22,16 @@ export const EPDS_ADD_RESPONSE = gql`
$genre: ENUM_REPONSESEPDS_GENRE!
$compteur: Int!
$score: Int!
$reponse1: Int!
$reponse2: Int!
$reponse3: Int!
$reponse4: Int!
$reponse5: Int!
$reponse6: Int!
$reponse7: Int!
$reponse8: Int!
$reponse9: Int!
$reponse10: Int!
$reponseNum1: Int!
$reponseNum2: Int!
$reponseNum3: Int!
$reponseNum4: Int!
$reponseNum5: Int!
$reponseNum6: Int!
$reponseNum7: Int!
$reponseNum8: Int!
$reponseNum9: Int!
$reponseNum10: Int!
) {
createReponsesEpd(
input: {
......@@ -39,20 +39,21 @@ export const EPDS_ADD_RESPONSE = gql`
genre: $genre
compteur: $compteur
score: $score
reponse_1: $reponse1
reponse_2: $reponse2
reponse_3: $reponse3
reponse_4: $reponse4
reponse_5: $reponse5
reponse_6: $reponse6
reponse_7: $reponse7
reponse_8: $reponse8
reponse_9: $reponse9
reponse_10: $reponse10
reponse_1: $reponseNum1
reponse_2: $reponseNum2
reponse_3: $reponseNum3
reponse_4: $reponseNum4
reponse_5: $reponseNum5
reponse_6: $reponseNum6
reponse_7: $reponseNum7
reponse_8: $reponseNum8
reponse_9: $reponseNum9
reponse_10: $reponseNum10
}
}
) {
reponsesEpd {
id
created_at
}
}
......
......@@ -74,16 +74,16 @@ const EpdsLightResult: React.FC<Props> = ({
variables: {
compteur: newCounter,
genre: genderValue,
reponse_1: answersScores[0],
reponse_2: answersScores[1],
reponse_3: answersScores[2],
reponse_4: answersScores[3],
reponse_5: answersScores[4],
reponse_6: answersScores[5],
reponse_7: answersScores[6],
reponse_8: answersScores[7],
reponse_9: answersScores[8],
reponse_10: answersScores[9],
reponseNum1: answersScores[0],
reponseNum10: answersScores[9],
reponseNum2: answersScores[1],
reponseNum3: answersScores[2],
reponseNum4: answersScores[3],
reponseNum5: answersScores[4],
reponseNum6: answersScores[5],
reponseNum7: answersScores[6],
reponseNum8: answersScores[7],
reponseNum9: answersScores[8],
score: result,
},
});
......
......@@ -166,7 +166,7 @@ export const getEachQuestionScore = (
const questionPoint = question.answers.find(
(answer) => answer.isChecked
)?.points;
if (questionPoint) scores.push(questionPoint);
if (questionPoint !== undefined) scores.push(questionPoint);
});
return scores;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment