Online Quiz Application

Running the project
Special Features
Lessons Learned
User Guide
Page Flow
Source Code
Deploying the application


Project:  Online Quiz application.
This three tier web application was coded using the NetBeans 4.0 Java IDE, J2SE 1.4, and ObjectStrore 6.1.2.  The application uses JSP pages for the presentation tier, a Java servlet for the middle (logic) tier, and the ObjectStore object oriented database for the third tier.
A working version of the application is completely contained in the file Quiz.war. To run the application you need Java 1.4, an Apache/Tomcat web server, and ObjectStore installed and running on the same machine.  Simply copy the Quiz.war file to the .../tomcat/webapps/ directory and restart Tomcat.  The application should then be accessible by browsing to http://[host or IP]:[Tomcat port]/Quiz/ (example: http://localhost:8084/Quiz/).
When the application is run for the first time a database file (quiz.odb) is created in .../tomcat/webapps/Quiz/.  The database is created with a default administrative user that you will use to access the instructor interface of the application.  The administrative user credentials are:
User ID:  admin
Password:  admin
There are also two test students that are automatically populated:
User ID   PWD   Name
mm          mm      Mohammad Meah
mark        mark    Mark Jones
Features:
Login knows if you are student or admin.
Name of user appears in header
'Administrator' appears in header when logged on as 'admin'
Administrator can:
Add new students (default password for new students is their User ID)
Can create a question bank by adding, updating, and deleting questions
Can create two types of questions, True/False and Multiple Choice
Create quizzes from the question bank
Create multiple quizzes
Assign quizzes to students
view quizzes
Students can:
take quizzes
view their grades
 Quizzes are graded immediately

Possible features:
With more time the plan was to implement a change password page, the ability to sort and create quizzes based on the book, chapter, and section information recorded for each question.  Reports for the instructor that show grades by student and a report that shows statistics on how often each question is answered correctly.

Lessons Learned:
Edit the ANT script in NetBeans to run persistent classes through the ObjectStore postprocessor during the project build process
Use ObjectStore classes such as com.odi.util.OSHashtable instead of java.util.Hashtable so that our classes can be made persistence capable
Though the 'Gradebook' example uses a client/server piece to communicate with the database we found that this step is not needed if ObjectStore is on the same machine as the web server.
It is useful to implement the Cloneable interface for persistant classes.  This will let you pass copies of objects to the presentation layer of the application without getting a stale refference exception and will also let you store copies of these objects in other objects.
To delete objects you must override the 'preDestroyPersistant()' method in the persistant classes that may get deleted.  Each field in a class that is not a primitive must be destroyed before you can destroy the containing object in ObjectStore.
You can't use objects of a persistant class outside of a database transaction.


 User Guide

Introduction
Login
Instructor Options
Student Options
Logout

To start the application browse to http://[host or IP]:[Tomcat port]/Quiz/ (example: http://localhost:8084/Quiz/) on the server where the application is deployed.  The first page is shown below.



To login click the 'Login' link on the left side of the page.
The login page is shown below.  To login as a student, use the username and password that has been assigned to you.  To login in as the Administrator/Insturctor use the special username/password of "admin/admin".



If loggin in as the Instructor you will see the following home page.  It lists some statictics about the contents of the Quiz database and shows options for updating/viewing the question bank, creating quizzes, adding students, and viewing reports.



The 'Question Bank' link will take you to the page below, where you can add new questions to the question bank, or list the existing questions.



The following page is the form for adding a new True/False question to the question bank.  The Book, Chapter, and Section text boxes describe the reference where the answer to the question can be found.  The answer is either true or false.



The following page is the form for adding a new Multiple Choice question to the question bank.  The Book, Chapter, and Section text boxes describe the reference where the answer to the question can be found.  You supply four possible answers to the question and then check the box or boxes next to the answers that are correct.  There can be one or more correct answers.



The following page is a view of the 'list questions' function.  Each question is listed along with the correct answers.



Once you have populated the question bank with some questions you can begin to group your questions into quizzes.  The following page shows the list of available quizzes and the links for creating new quizzes and assigning quizzes to specific students.



When you click on 'Create Quiz' the form shown below allows you to name and describe the new quiz, and then select the questions from the question bank that you want included in the quiz.  In the example below only the two True/False questions are selected.



Once you have created a question bank and some quizzes you are ready to add students to the database.  The following page is shown when you click on the 'Students' link on the left side of the page.  From here you can add new students, assign students to take quizzes and view the students in the database.



To create a new student click the 'Create Student' link.  The form displayed takes the students name and user ID.  By default the students password is set to the same string as the user ID.



Now that you have questions, quizzes, and students in the data base it is time to assign quizzes to be taken by students.  The following page can be accessed from either the 'Quizzes' link or the 'Students' navagation link on the left.  To assign the quiz select the quiz and student from the drop down lists and click 'submit'.



When students login the have a slightly different view.  The page below is the student home page.  From here students can take quizzes or view their grades.



Clicking the 'Quizzes' navagation link will list the quizzes that have been assigned to the student by the Instructor.



To take a quiz, click on the quiz that you want to take on the page above.  The quiz questions will be displayed in a form as shown below.  Complete each question and then click submit.



Once the student submits the quiz it is immediately graded and the results are shown to the student as shown below.  In this example the student answered one out of two questions correctly for a score of 50%.



The 'Grades' navagation link will show the current grades for all quizzes that have been assigned to the student.  Quizzes that have not yet been taken will show a grade of '0.0'.



And when you are ready to leave the application simply click the 'Logout' navagation link on the left side of the page.  The logout confirmation page is shown below.




Page Flows






Source Code
The NetBeans 4.0 project folder contains all source for this project.  The JSP source can be found in the 'web' directory in the project folder.  The Java class source can be found in the 'src' directory.