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

#374486 Score: 0
Profile photo of Jason Dalrymple
Jason Dalrymple
Member
beginner
intermediate
profile
wise owl
curious george
contributor
friend finder
advanced
picture perfect
54 pts
@JasonADal

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):

  1. onClick Modify Variable “questions_correct” -> Add to variable  “1” IF Question_0001 is correct.
  2. onClick Change State -> Next -> enable  IF “questions_correct” = “X”
  3. 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,

  1. onShow Set State -> Next -> disabled IF “questions _correct” < “X” ELSE Set State -> Next -> enabled
  2. 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!