Skip to content
Advertisement

Java quiz with multi choices in answers

I’m trying to develop a java quiz, here’s the basic idea: A quiz contains n questions, and a question has 0 to n true answers, I have to link that to a database, so my tables are:

Table Quiz:

JavaScript

Table Question:

JavaScript

Table answer:

JavaScript

So my java classes are:

JavaScript

My Question class:

JavaScript

and the same for Answer:

JavaScript

The main JFrame contains a JCombobox with the list of available quizzes, when the choice is done, a button that send the idQuiz to get the List of questions of the chosen quiz. In my quiz JFrame, I made a function that’s filling the question JLabel with a next button, and the multiple choises of this question with a JRadioButton to select.

I have a little problem to get the list of true answers, the user must choose all of true answers, not only one if there is more than one true question. Has someone an idea about that? Thanks.

Advertisement

Answer

I’m afraid you will need the help of Destructor The Destroyer Of Worlds.

He will attack the answers the user marked as correct one by one until the fate of the user is decided.

First, you need this very important class:

JavaScript

Now we have to actually get all our information somewhere, so:

JavaScript

Then comes the fun part:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement