Skip to content
Parameswar Kurakula edited this page Nov 28, 2017 · 1 revision

QUIZ GENERATOR-DESIGN

A tool that will enable one to generate a quiz test questionnaire containing the specified number of questions from the question bank. It also enables the user to modify the content of the question bank i.e., the user will be able to add a new question, delete an existing question or modify one. He can also print the generated test and key to that test in separate files after generating. The user will be able to add three types of questions viz., Multiple-choice question, fill in the blank and true/false. There are also different subjects to select from before generating the quiz. Likewise, he can choose a subject’s question bank before changing content. In addition, the user can choose the number of questions to be contained in the generated quiz. The quiz generated will contain the user-specified number of questions randomly picked from the subject’s question bank. The user will be able to view the entire quiz alongside its answers before converting it into a printable text file. If you are using it for the first time, you might want to register. All the quizzes generated will have your username and the number of quizzes you have created on the file so that you can just look into whichever quizzes you have created when you visit this PC again.

DESIGN AND IMPLEMENTATION Classes:

Main, Eswar (GUI Implementation), question, Readfile, Writefile, Print (to get Quiz), Creden.

Main.class:

VARIABLES: public static int Cpp, java, html, css, python3:

All these variables denote question count in each subject. They are declared static so that they can be accessed and modified from anywhere.
public static int t:
This variable denotes number of quizzes generated in one run of the application.
public static ArrayList(s):
They contain the questions (object) in each subject.

METHODS: public static void main():

Contains references to Readfile, which is used to read all the files and store the questions into ArrayLists. It creates Eswar (JFrame) object from where GUI takes its role of executing until end. Before the end Writefile object is created and all changes made to the question bank content will be written to files.

Eswar.class:

VARIABLES: Private static int g:

It denotes the number of questions user wishes to print. It is declared static so that it can be used in Print class directly.
Eswar e:
An object reference is replicated in the same class to help set location of JOptionPanes (pop ups) along the app.
Other buttons, labels and Textfields:
These are created here because they are used in more than two functions in this class.
METHODS:
This class is all about GUI (Graphical user Interface). It extends JFrame. All the methods in this class are chained and connected well such that when a method is called, a frame related to that action is set up and all the components of the existing method are disposed. This chain starts in the constructor of this class. The action a method performs is implicit with its name. The following are the methods present:
Void welcome():
The login page.
Void check():
Checks login credentials.
Void enter():
Main menu of the application.
void chooseSubject():
Frame to choose a subject to generate quiz.
Void selectNumber()
Frame to choose the number of questions to select.
Void chooseAction():
Frame to choose which subject’s question bank you want to modify and what exactly you wanted to do.
Void insert()
Frame to choose what type of question you wanted to insert.
Void mcq():
Frame which allows user to enter a multiple choice question.
Void blank():
Frame which allows user to enter a blank type question.
Void tf():
Frame which allows user to enter a true or false type question.
Void anotherAction():
performs an action which is just performed again.
Void delete():
Frame which allows user to choose a question to view to delete.
Void modify():
Frame which allows user to choose a question to view and modify.
Void modifyadd()
Creates a Frame based on the type of the question selected and allows user to modify that.
Void view():
Creates a frame to view question before deleting it.
Void display():
Displays the generated quiz in the textareas and allows user to print it.
Void signup():
Creates a signup page.
Boolean contain(String a,String b):
Checks if the given credentials exist in the register or not.
Boolean usercontain(String a):
Checks if the username already exists.

Question.class:

This class defines a question in a specific format. It has a constructor which takes the question type and creates question accordingly.

VARIABLES :

String type,ques:
For the type and question statement.
String str[]:
For the options, blank, etc.

Readfile.class:

METHODS: Readfile(String s):

Reads a specific file and stores it in corresponding Arraylist based on the string given.

Writefile.class:

METHODS:

Writefile(String s):
Writes a specific file with data from a corresponding Arraylist based on the string given.

Print.java:

VARIABLES:

Formatters, BufferedReaders:
To write and read from that written file.
Random rand:
To generate random numbers.
printTest(String s):
Writes a quiz into a specific file after picking questions randomly from the file specified by the given string.
generateRandom():
Generates random numbers and stores them in an arraylist.
Reader getreader():
Writes returns a reader of created file.
Creden.class:
Defines a credential.
Clone this wiki locally