From f34525ea3361b6f248e4e69df4b2e52814203f62 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Tue, 28 Oct 2025 23:54:36 -0400 Subject: [PATCH 1/2] Remove async from CTFd.pages.challenge.checkSolution --- pages/challenge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/challenge.js b/pages/challenge.js index 8edfe3f..fb58923 100644 --- a/pages/challenge.js +++ b/pages/challenge.js @@ -143,7 +143,7 @@ export async function getSolution(challengeId) { } // Function to check whether the UI should check for a challenge solution -export async function checkSolution(solutionState, challengeData, submissionStatus) { +export function checkSolution(solutionState, challengeData, submissionStatus) { if (CTFd._functions.challenge.checkSolution) { return CTFd._functions.challenge.checkSolution( solutionState, From f225e5e03c454eda59b9c4a4be93d3383eff717e Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Wed, 29 Oct 2025 00:05:59 -0400 Subject: [PATCH 2/2] Fix solved behavior for checkSolution --- pages/challenge.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/challenge.js b/pages/challenge.js index fb58923..e727b23 100644 --- a/pages/challenge.js +++ b/pages/challenge.js @@ -153,8 +153,9 @@ export function checkSolution(solutionState, challengeData, submissionStatus) { } if (solutionState == "hidden" || solutionState == "visible") { return false; - } else if (solutionState == "solved" && submissionStatus === "correct") { - return true; + } else if (solutionState == "solved") { + // If solutionState is solved we should check if the user got their submission right + return submissionStatus === "correct"; } else { // We default to true in case there is a solution state that we are not aware of return true;