From 6ab2c07ada8ac8a8d19893cdf05a5c81b3594e37 Mon Sep 17 00:00:00 2001 From: Bastien Seree Date: Thu, 24 Oct 2024 10:50:09 +0200 Subject: [PATCH] Cyberleague: [#114] Fix isActionAllowed for next_question action --- backend/web/server/plugins/cyberleague/actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/web/server/plugins/cyberleague/actions.js b/backend/web/server/plugins/cyberleague/actions.js index 1f2dfd82de..85dfb8574c 100644 --- a/backend/web/server/plugins/cyberleague/actions.js +++ b/backend/web/server/plugins/cyberleague/actions.js @@ -126,7 +126,7 @@ const isActionAllowed = async ({action, dataId, user, ...rest}) => { if (action == 'smartdiet_next_question') { //if current answer is not answered - if (!lodash.includes(ANSWERS,score.answers[answerIndex])) { + if (!lodash.includes(lodash.keys(ANSWERS),score.answers[answerIndex].answer)) { throw new ForbiddenError(`Il faut répondre à la question avant de pouvoir passer à la suivante`) }