Created
February 20, 2023 14:23
-
-
Save YonatanKra/a1241a29c455afa26617a147e675f62a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function verifyAnswer(question) { | |
const answer = prepareAnswerFromTextFields(); | |
const response = {}; | |
const questionIndex = QUESTIONS.findIndex(x => x.id === question.toString()); | |
response.error = !ANSWERS[questionIndex].includes(answer); | |
if (response.error) { | |
error(response.error); | |
} else { | |
success(); | |
addNextQuestion(QUESTIONS[questionIndex + 1]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment