This RPG maker version is different from mine, and we also have a language difference, but I'm trying to understand what you're trying to do.
My thoughts are: You have variable 8 set to a random. I don't see what the reason for that is.
Also we have 2 variables, 7 and 8.
If I understand what you're trying to do, couldn't you just have 1 variable? Make it variable 7. Call it "Library Password Count."
At the start of the event, instead of this random thing with variable 8, set Library Password Count to zero.
At each conditional branch on the quiz, if the player answers correctly, add 1 to Library Password Count. At the end of the quiz, if Library Password Count == 3, get "You pass!" Else, "Study Harder."
Would that work?
EDIT: I see now you want the questions to be random too. There are a number of approaches for that. If that version of RPG Maker uses labels, you can use labels to jump around through the events sheet. Like, if Library Question == 3, Jump to Label "Library Question 3." Then you could use a new variable like "Question 3 Answered," set to 0 or 1. Or, a switch, instead. So then if the question is answered already, it will not play the condition, and instead Jump to Label "Question Randomizer," or something like that.
There are a lot of approaches you could have for the randomization aspect.
You've nested the conditional branches for each possibility inside each other, so only the first one will ever really be checked. The value can't be 1, 2 and 3 at the same time.
And the last conditional will run every time you interact. Since both branches have text in them, it will always say either one text or the other, regardless of your progress.
😀 Nothing wrong with that! I've moved on from plenty of "cool ideas" for events sheets, only to come back a few weeks later and make them even cooler. As long as it works now and you can be happy with it, that's what matters.
Good luck!