Explore the community › Forums › Lectora › Lectora Questions & Answers › Disable next button until all questions on page answered correctly › Reply To: Disable next button until all questions on page answered correctly
Hi Pip – This is something I’ve done quite often with my courses. It may be easier to create a variable that adds to a count each time a question is answered correctly. For example on each Submit button, you could add (in this order; X=the number of questions on the page):
- onClick Modify Variable “questions_correct” -> Add to variable “1” IF Question_0001 is correct.
- onClick Change State -> Next -> enable IF “questions_correct” = “X”
- onClick Change State -> Submit IF question_ooo1 is correct
You may also want to change the onShow Set State action to account for a person having already visited a page. For example,
- onShow Set State -> Next -> disabled IF “questions _correct” < “X” ELSE Set State -> Next -> enabled
- onShow Set State -> Submit button 1 -> disable IF questions_correct = “X” (duplicate for each submit button)
I’ve attached a sample with 3 questions that includes feedback for each question set up via the question itself. Hope this helps!