Quiz Scoresheet is the project in which it is used to control the quiz scores. And later it gives the names of the winner and scores and also lists the rank of every team.
Explaining the code :-
The first frame of the project is to collect the data from the users about the quiz.
For eg. quiz type, category, year, school/university name and also about marking scheme like marks awarded for answering direct question and pass over question and also for rapid fire questions.
To retrieve the data and store it in variables is a simple task, we just have to use the getText() method store the returned the values in the variables.
On this frame you will get three buttons, cancel for exit, clear for clearing the written data in the text fields and team selector for bring up the team selector frame and storing the values.
Now we have the team selector frame in which names of the participant is taken and stored it in the variables. And again we have used the getText() method.
After filling names we can start the quiz and start recording the quiz scores.
Here we have used have used some good amount of code that we can discuss on.
Firstly, I have used the key events to give the score to a particular team in the particular round.
So, To give the score for direct question you can just press the up arrow key and if the answered question was pass over than press the right arrow key. And for rapid fire round to give score for right answer press the up arrow key and for negative marking press the right arrow key. And every time you award the score to team its total score is updated in the real time.
To achieve these functionality I have used the Key Events.
There are two major buttons, one is for creating the rank list and another is creating new scoresheet.
To create a new scoresheet is simple as I only have to setText(null) to all the text fields and initialize all the variables to null and also empty the table in which rank list is stored.
After clicking the rank list, it will give the new frame in which teams are arranged in order of their rank and scores.