How to create reoccuring question-quiz?

Hi! Recently I’ve been attempting to make a game that has to quiz you on certain things and your memorization, however, I’ve been having some trouble figuring out how to implement it where if you get a question wrong, it’ll progress through the rest of the questions (just mainly simple sequenced show choices commands) but once done, the minigame will re-show those questions that the player missed and ask the player to attempt again until they get it right, like another attempt. Is it possible to do such? Any help is very much appreciated!
When you ask the question the first time, make the right/wrong choices set a switch to true or false.

Then at the end you have a loop and have a conditional branch for each of those switches - if they're still false, ask the question again.
When you ask the question the first time, make the right/wrong choices set a switch to true or false.

Then at the end you have a loop and have a conditional branch for each of those switches - if they're still false, ask the question again.
Ah! I see, but could you elaborate on how that would look like/be structured?
Loop
-- Conditional: QuestionAnswered is ON
---- Break loop
--ELSE
----Text box: "What question has the most number of questions in this question?"
----Show choice: Yes, No
------if yes:
--------QuestionAnswered: ON
------if no:
--------(do nothing)
End Loop
QuestionAnswered: OFF
(repeat for additional questions.)

Edit:
My b. Should have put this in a code box. Deal with the assault of hyphens instead.
Edit 2: fixed a typo
Loop
-- Conditional: QuestionAnswered is ON
---- Break loop
--ELSE
----Text box: "What question has the most number of questions in this question?"
----Show choice: Yes, No
------if yes:
--------QuestionAnswered: OFF
------if no:
--------(do nothing)
End Loop
QuestionAnswered: OFF
(repeat loop section for additional questions.)

Edit:
My b. Should have put this in a code box. Deal with the assault of hyphens instead.
Lol! I understand it now, thank you so much for this! :LZYwink:
Loop
-- Conditional: QuestionAnswered is ON
---- Break loop
--ELSE
----Text box: "What question has the most number of questions in this question?"
----Show choice: Yes, No
------if yes:
--------QuestionAnswered: OFF
------if no:
--------(do nothing)
End Loop
QuestionAnswered: OFF
(repeat loop section for additional questions.)

Edit:
My b. Should have put this in a code box. Deal with the assault of hyphens instead.
This code doesn't seem correct to me, the loop never exits this way.

I’ll write what I think is the solution that most closely resembles the ones already proposed. I'll give you an example with 2 questions and add a control variable to determine if all answers are correct. You can also use this variable as a score for the correct answers. The last 2 switches that reset the quiz to its initial state can be omitted if you don't intend to repeat the same questions.
@ISC I'm not sure I understand what you are getting at by saying it never exits "this way" .
There is a typo in my post, that much is correct, I wrote OFF when the switch should be turned On. I'll fix that, but surely you could just point that out instead of saying "that'll never work" 😛

Your solution may work, but it's way clunkier by necessitating a distinct switch for every single question. This is unnecessary and messy way of handling things.
I'm not sure why you're using switches any way, when you are already tracking the quiz progress through a variable.
"
@ISC I'm not sure I understand what you are getting at by saying it never exits "this way" .
There is a typo in my post, that much is correct, I wrote OFF when the switch should be turned On. I'll fix that, but surely you could just point that out instead of saying "that'll never work" 😛

Your solution may work, but it's way clunkier by necessitating a distinct switch for every single question. This is unnecessary and messy way of handling things.
I'm not sure why you're using switches any way, when you are already tracking the quiz progress through a variable.

I didn’t say that it would never work, I wrote that exiting the loop the way you had written it wasn’t possible.

May I ask where you would add the other questions? Because honestly, I can't understand where you would add the following questions
Looks like you're both trying to do something a bit different.

@TheAM-Dol made it so that a single question is repeatedly shown until the correct answer is selected, and the event only moves on to the next question afterwards.

@ISC made it so that all questions are presented first (each only once), and if not all are answered correctly, then all the incorrect ones are shown again.

I think the latter is what OP wanted, though I'm not entirely sure.
@ISC I'm not sure I understand what you are getting at by saying it never exits "this way" .
There is a typo in my post, that much is correct, I wrote OFF when the switch should be turned On. I'll fix that, but surely you could just point that out instead of saying "that'll never work" 😛

Your solution may work, but it's way clunkier by necessitating a distinct switch for every single question. This is unnecessary and messy way of handling things.
I'm not sure why you're using switches any way, when you are already tracking the quiz progress through a variable.

Could you show me how you would solve the OP's request with just one variable instead of switches? Could you give me an example where I only get question number 3 wrong out of 5? I'm interested for a project I'm working


The only wrong answer must be number 3
Could you show me how you would solve the OP's request with just one variable instead of switches?
You've shown it before - each question is a different multiple of ten on the variable, and you divide by the appropriate amount then check whether that digit is 0 or 1 on the variable for whether the answer is complete or not (long-hand bitwise operations).

(unless I'm confusing you with someone else)
Could you show me how you would solve the OP's request with just one variable instead of switches?
i was going to explain that you could get away with it using bitwise operations, but turan already mentioned it while i was setting it up 🤣
regardless, it can take only one variable and no switches to do it if you ignore that youre essentially turning a variable into 5 switches to do it

Spoiler: event
Code:
◆Text:None, Window, Bottom
:    :Quiz time!
◆Control Variables:#0069 = 0
◆Loop
  ◆If:Script:!($gameVariables.value(69) & 0b10000)
    ◆Text:None, Window, Bottom
    :    :How many fingers are on one hand?
    ◆Show Choices:5, 4 (Window, Right, #1, #2)
    :When 5
      ◆Control Variables:#0069 = $gameVariables.value(69) | 0b10000
      ◆
    :When 4
      ◆
    :End
    ◆
  :End
  ◆If:Script:!($gameVariables.value(69) & 0b01000)
    ◆Text:None, Window, Bottom
    :    :How many days are in a week?
    ◆Show Choices:7, 6 (Window, Right, #1, #2)
    :When 7
      ◆Control Variables:#0069 = $gameVariables.value(69) | 0b01000
      ◆
    :When 6
      ◆
    :End
    ◆
  :End
  ◆If:Script:!($gameVariables.value(69) & 0b00100)
    ◆Text:None, Window, Bottom
    :    :How many weeks are in a week?
    ◆Show Choices:1, 52 (Window, Right, #1, #2)
    :When 1
      ◆Control Variables:#0069 = $gameVariables.value(69) | 0b00100
      ◆
    :When 52
      ◆
    :End
    ◆
  :End
  ◆If:Script:!($gameVariables.value(69) & 0b00010)
    ◆Text:None, Window, Bottom
    :    :Licks it takes to get to the center of a tootsie pop?
    ◆Show Choices:3, Trick Question (Window, Right, #1, #2)
    :When 3
      ◆
    :When Trick Question
      ◆Control Variables:#0069 = $gameVariables.value(69) | 0b00010
      ◆
    :End
    ◆
  :End
  ◆If:Script:!($gameVariables.value(69) & 0b00001)
    ◆Text:None, Window, Bottom
    :    :Questions are in this quiz?
    ◆Show Choices:5, 4 (Window, Right, #1, #2)
    :When 5
      ◆Control Variables:#0069 = $gameVariables.value(69) | 0b00001
      ◆
    :When 4
      ◆
    :End
    ◆
  :End
  ◆If:#0069 = 31
    ◆Break Loop
    ◆
  :End
  ◆
:Repeat Above
i was going to explain that you could get away with it using bitwise operations
Yup, and it's even simpler if you use the actual bitwise operators in script fields - but it could be done by someone who doesn't know how those work by just using Control Variables also.

It just takes a few more event commands in each branch.
I didn’t know about bitwise operations, this practice will save me a lot of work. Thank you so much!
@ATT_Turan
@Robro33

Original thread: https://forums.rpgmakerweb.com/threads/how-to-create-reoccuring-question-quiz.172147/