Online Project
Online Project
A Project
MASTER OF SCIENCE
in
Computer Science
by
Sameer Bhutada
FALL
2013
ONLINE EXAMINATION ANDROID APPLICATION
A Project
by
Sameer Bhutada
Approved by:
____________________________
Date
ii
Student: Sameer Bhutada
I certify that this student has met the requirements for format contained in the University
format manual, and that this project is suitable for shelving in the Library and credit is to
iii
Abstract
of
by
Sameer Bhutada
very essential for universities to handle the Examinations and their results. It is very
useful for a university to test its students continuously for their mutual development. This
system is helpful for conducting Multiple Choice as well as Free Response Examinations
which can be conducted regularly as well as for surprise tests and provides immediate
results saving the precious time of faculties to check the papers and prepare mark sheets.
_______________________
Date
iv
ACKNOWLEDGEMENTS
I would like to thank Dr. Jinsong Ouyang, my project advisor for providing me a
wonderful opportunity to work on this project, which provided a great exposure to the
field of Mobile Application Development. I thank him for providing all the help, support
and necessary resources to complete the project successfully. Dr. Ouyang helped me in
understanding the project in detail and provided knowledge and expertise in the field to
In addition, I would like to thank Prof. Bob Buckley for his willingness to serve on the
committee.
Lastly, I would like to thank the entire faculty and staff of the Department of Computer
v
TABLE OF CONTENTS
Page
Acknowledgements ..............................................................................................................v
Chapter
1. INTRODUCTION ...........................................................................................................1
vi
3. GOOGLE APP ENGINE AND ANDROID FRAMEWORK .......................................14
vii
3.14 Running Android Application .............................................................................. 34
4.1 Administrator.......................................................................................................... 41
viii
4.2.6 Interface to View Examination Details ............................................................ 63
5. CONCLUSION ..............................................................................................................94
References ..........................................................................................................................97
ix
LIST OF FIGURES
Figures Page
Figure 19 Code Snippet of XML File for Text View and Button ..................................... 27
xi
Figure 42 Professor Registration Activity ........................................................................ 51
xii
Figure 63 Interface Design of Professor Edit question Page ............................................ 69
xiii
Figure 84 Code Snippet for Comparing Dates .................................................................. 86
xiv
1
Chapter 1
INTRODUCTION
The objective of the project is to develop an online examination system that will help
universities for making the examination process less tedious and easy to process. It is
very essential for universities to handle the Examinations with due attention and their
results as they are very critical for a student’s career. It is very useful for universities to
test its students continuously for their career development. The system designed is useful
for taking two types of examination – Multiple Choice Exam and Subjective (Free
Response) exams. The designed application allows the professor to take examinations
which can be conducted on regular basis (Mid Terms, Finals etc.) as well as surprise tests
anytime in the class with least possible efforts for the quiz and provides immediate results
saving the precious time to give grades and prepare the exam statistics.
The role of an Administrator is to add student and professors in the system after their
registration. Administrator can also add, delete and assign subjects to the faculties.
A professor can create exams for which they can add questions, can check the answer for
subjective questions and can view the statistics of the overall exam given by students.
A registered student can either take exams that are set by the examiner for which the time
duration is set or can choose to practice sample exams that may be provided by the
examiner.
2
App Engine. Professor and Student modules are the android applications and can be
accessed through the cellular devices that support Android Operating System. The
application requires minimum Android operating system 2.2 (API – 8 Froyo) to run.
3
Chapter 2
SYSTEM DESIGN
Student. Each module performs various set of functionalities. The functionality of all the
Create Exam
Give Exam
View Result
4
A context diagram is a data flow diagram, that defines the boundary and scope of
the system, or part of a system, showing the entities that interact with it. It shows how the
system will receive and send data to the entities involved. This diagram is a high level
view of a system.
Edit Questions
Approve Faculty
Verify Answers for Free
Approve Student Response Questions
View Statistics
Application Cloud Server
Change Password
Request/Response
Register
Give Exam
Change Password
View Result
Reques.Response Student
Once the user logs into the system, a panel is displayed on the left side. This
panel includes options to add a subject, delete a subject, assign a subject, approve the
faculty and approve students. The add subject functionality is used to add new subjects in
the system, this allows the admin to set the subject name, branch for which the subject
would be assigned along with the semester when this subject would be offered. The
delete subject functionality also works on the similar basis, where admin can delete the
subject assigned for a branch and the semester when it was offered. Assign subject
functionality is used to assign a subject to the faculty. Approve faculty and approve
student functionality is used to approve the faculty or student who registers. Once the
student/faculty registers from their app, the request comes to the admin side and as the
admin activates them, a confirmation mail is sent to the requestor with their username
and password.
6
System
Login
Add Subject
Delete Subject
Approve Faculty
User
Approve Student
Logout
System
Approve Faculty
<<include>>
User
Assign Temporary
Password
System
Approve Student
<<include>>
User
Assign Temporary
Password
User has to register before logging into the system by providing his personal
information, and semester in which he is going to take the course. The request is
submitted to the admin for approval. Once the admin verifies the information submitted
by the user, he approves the user and sends the username and password by email. User
then can log in with the username and password provided by the admin. After the user
logs into the system, he can create an exam for which he can set time, date and duration
for the exam. Now once the exam is created, the user can add questions or edit questions
to the exam. There is also a provision made to view the contents of an exam. This can be
done through the view content section. Once the students give the exam, the user then
grades the exam and sends out an email notification to all the students with their exam
name and the score received. The user can also view the overall statistics of exam given
by students.
9
System
Login
Exams
<<include>> <<include>>
<<include>> <<include>>
Professor
<<include>>
Grading
<<include>>
Change Password
Logout
System
Login
Create Exam
Add Question
Edit Questios
User <<include>>
Multiple Choice +
Free Answer
Logout
System
Login
Select Test
Answer Question
User
View Results
Logout
System
Check Multiple
Check Free Choice Answers
Response Answers
User
Calculate Marks
<<include>> <<include>>
Points = No. of points allotted for Multiple Choice question(Multiple Choice Exam)
Points = Points Alloted By Faculty for Free Response Question(Free Response Exam)
Points = No. of points allotted for Multiple Choice question+
Points Alloted By Faculty for Free Response Question(Multiple Choice Exam+Free Response Exam)
Result
-studentId Answers
-examname
-marks -examname
-studentId
+getStudentId()
-question
+setStudentId()
-answer
+getExamName() Login -marks_alloted
+setExamName()
-UserId -subject
+getMarks()
+setMarks() -Password +getExamName()
-Usertype +setExamName()
+getUserId() +getStudentId()
+SetUserId() +setStudentId()
+getPassowrd() +getQuestion()
+setPassword() +setQuestion()
+getIsertype() +getAnswer()
+setUsertype() +setAnswer()
+getMarks_alloted()
+setMarks_alloted()
Email +getSubject()
+setSubject()
+sendEmail()
1..*
1..*
Marks
-examname
1..* 1..* -studentId 1..* 1..*
-question
-answer
Faculty -marks_alloted Student
-firstname 1..* -gotmarks 1..* -firstname
-lastname +getExamName() -lastname
-lecturerid +setExamName() -studentid
-branch +getStudentId() -branch
-email +setStudentId() -email
+getQuestion()
+getFirstName() +getFirstName()
+setQuestion()
+setFirstName() +setFirstName()
+getAnswer()
+getLastName() +getLastName()
+setAnswer()
+setLastName() +setLastName()
+getMarks_alloted()
+getFacultyId() +getStudentId()
+setMarks_alloted()
+setFacultyId() +setStudentId()
+getGotMarks()
+getBranch() +getBranch()
1..* +setGotMarks()
+setBranch() 1..* +setBranch()
+getEmail() +getEmail()
+setEmail() +setEmail()
1..* 1..*
SetExam Questions
-facultyid -examname
-branch -facultyId
-subject -question
-examname -answer
-date -marks
-time
+getExamName()
+getFacultyId() +setExamName()
+setFacultyId() +getFacultyId()
+getBranch() +setFacultyId()
+setBranch() +getQuestion()
+getExamName() +setQuestion()
+setExamName() +getAnswer()
+getDate() +setAnswer()
+setDate() +getMarks()
+getTime() +setMarks()
+setTime()
Chapter 3
Applications are sandboxed and run across multiple servers. App Engine offers automatic
scaling for web applications—as the number of requests increases for an application, App
Engine automatically allocates more resources for the web application to handle the
additional demand.
Navigate to http://appengine.google.com and login with your Google account. In case the
user does not have an account, he can sign up for a Google Account.
Once you are logged in, you will be presented with a list of applications that you are
currently running on the Google App Engine under the account which we logged in with.
Google provides a total of 10 applications that you can deploy under a single account.
By default, your application needs to be unique within this so called name space:
Your_application_Id.appspot.com.
Where Your_application_Id can be any name that you wish for your application, which
myhelloworld, myfirstapp, etc and see which one is available. Give any string for the
Application Title and go with the default options. Click on the Create Application button.
If all is well, the application identifier will be created and your first application is
registered. Please make sure that you note down your Application Identifier since this
You can install the Google Plugin for Eclipse using the Software Update feature of
Eclipse.
https://dl.google.com/eclipse/plugin/4.2
Click the Add button. In the dialog that shows, click OK (keep the name blank, it
Click the plus icon next to "Google Plugin for Eclipse" and "SDKs". Check the
boxes next to "Google Plugin for Eclipse 4.2" and "Google App Engine Java
SDK". You can also select the "Google Web Toolkit SDK" if you'd like to
use Google Web Toolkit with your apps. Make sure you check the checkbox
labeled "Contact all update sites during install to find required software." Click
the Next button. Follow the prompts to accept the terms of service and install the
plugin.
When the installation is complete, Eclipse prompts you to restart. Click Yes.
Eclipse restarts. The plugin is installed. you should see the following icons in the
Project Name: Sample. You can select any name that you like.
Package: com.sample.cloud. You can select any name that you like.
2. Click on Finish. This will generate an entire project for you which is ready to be
deployed.
Following is the list of the directories that are found in Google Web Application Project -
src: This contains the source files. You will find that it has generated a sample
File name SampleSerlvet.java for you. It has been created as per the package
hierarchy that you selected. You can keep all your source files over here as you
develop more.
war: This is the war file structure i.e. Web Application Archive. This if you
recollect will be deployed into the Servlet Container of the App Engine that will
eventually host your Java Web Application. In this directory, you have the
following:
WEB-INF\lib: All appropriate JAR files that provide the Java SDK libraries along
with Google Java APIs for the App Engine have been linked correctly into the
20
project build path and the necessary JAR files are also present in the WEB-
INF\lib folder
index.html: This is the first page served. You can actually customize it to any that
web.xml: This is a standard web application configuration file. You will find the
Servlet entries present here for the sample servlet that is generated for us.
the main element here of interest to us is the application element that will contain
the Application ID of the application that we registered for Google and which will
The servlet code extends the javax.servlet.http.HttpServlet class and implements the GET
method. You could parse out the request parameters if needed. All that the servlet does is
to get a handle to the response stream and then mention its content type and send across
package com.sample.cloud;
import java.io.IOException;
import javax.servlet.http.*;
@SuppressWarnings("serial")
public class SampleServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws
IOException {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, world");
}
}
<servlet>
<servlet-name>Sample</servlet-name>
<servlet-class>com.sample.cloud.SampleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Sample</servlet-name>
<url-pattern>/sample</url-pattern>
</servlet-mapping>
To deploy the application in the cloud, open appengine-web.xml. Simply enter the
application id you registered while creating application. Right click on project and click
on Deploy to App Engine. This will connect to Google App Engine and deploy your
Android Operating System is an operating system that is designed for portable devices.
This operating system is known to work on the cell phones, tablets and other wearable
devices like Watch, Glass etc. It is an open source technology that was developed by
Google Inc. The latest version of the operating system is Android 4.4 (Kit Kat).
Following things are needed by the developer to understand for developing the
Activity – The user interface in Android OS is the activity. When the user does
some interaction with the application, it is the activity that is performed in terms
one/multiple activities from the same activity. The activity execution begins with
onCreate method. OnStart and OnResume Method once the activity is created.
When the user moves to another activity, the onDestroy method of the first
Service – These components do not require any user interaction. Thus, the tasks
that do not require the user to be involved in the transaction can be a service to the
application. The tasks like uploading and downloading a big song file can be done
by a service as it does not involve the user interaction, thus they can be used in
terms of service.
Broadcast Receiver – These are the listeners that listen to the broadcast message
from the operating system or any other application. These components are used
24
when the application has to be triggered based on events that occur in some other
application. For Example, the alarm application, listens to the time in the clock
continuously; when the clock reaches a certain time for which the alarm is set,
than the alarm application will listen to the time broadcasted by clock and start
ringing.
Content Provider – This component allows the application to store the data. This
storage of data can be internal storage of the device, external storage of the device
or can be anywhere on the internet. For the current project, I have used Google
App Engine that will be responsible for storing all the data for the application in
forms of tables.
Activity: this component can be started using “startActivity()” method. This method
Service can be started using the “startService()” method. This method takes the intent as
Manifest file is the main configuration file for the application. Android system reads the
manifest file first and knows about the application. All the components used by the
application must be declared in the manifest file. If the component is not declared in the
manifest file the application will never make use of that component. It is an xml file so all
Activity:
<activity
android:name="com.pd.android.lect.Dispatcher"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
In the above lines of manifest file we are declaring the activity using the activity tags it
be given the name of activity preceding the ‘.’ Symbol. “MainActivity” is the name of the
class that inherits the activity class. “Main Activity Label” is the label that is displayed
application is started.
<uses-sdk/> tag is used for defining the minimum and target sdk version of the android
android:minSdkVersion describes the minimum version on which the application will run
and the android:targetSdkVersion states the platform for which the application is
developed.
When the application is deployed in android market it uses these parameters and displays
the application in the market only if the android version of the mobile meets the
requirements.
26
Uses permission tag is used to display the set of permission that needs to be obtained
from the user. The above tag asks the user for permission, if the application can make use
User interface in android is defined using layout file which is in xml format. We have
Graphical Layout
Xml file
Graphical layout shows the screen where we can drag and drop required widgets and the
code in xml file is auto generated. Developers can manipulate interface using the
Linear Layout
Relative Layout
List View
Grid View
Grid View: Elements are in the form of grid with rows and columns.
27
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent">
<TextView android:id="@+id/textView1" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerVertical="true"
android:padding="@dimen/padding_medium"
android:text="@string/hello_world"
tools:context=".MainActivity" />
<Button android:id="@+id/buttonDeleteLocations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView1"
android:layout_alignParentLeft="true"
android:text="@string/buttonDeleteLocations" /> </RelativeLayout>
Figure 19 Code Snippet of XML File for Text View and Button
3.7 Architecture of Android Application Processing
Below is the architecture the way android application is process and deployed in to
Compiler Tool dx
Android SDK
Eclipse
Java SE
using the install package. Once the SDK is installed you can go to the default android
SDK directory and click SDK Manager.exe which opens android SDK and populates
Tools: this is required to install for the first time. Make sure to keep the latest SDK Tools.
SDK Platform: Users must at least install one package on which they can run their
application
30
In the above window check the option Developer Tools and click Next and then window
will pop up showing the list of tools to be downloaded, accept the terms and then click
finish and download, after installing the tools restart the eclipse.
In eclipse select window->preferences then select Android tab. Select the SDK Location
res/layout/: This directory has the xml files that define the interface for the application
res/values/: This directory has the values for the resources such as strings to be used in
application.
Running on emulator
Running on Device
To run on emulator, new android virtual device needs to be created using android virtual
device manager icon in the eclipse. After creating the virtual device click run, the .apk
file of the project will be installed on the device and application will run.
35
Click run on eclipse will install the application on the mobile and will be
launched.
Class HelloWorldActivity must extends Activity and override the required methods from
the parent class. In below code onCreate() method is invoked when the activity is created.
36
SetContentView(R.layout.main) sets the content of main.xml file which has the code for
the interface.
package com.example.HelloWorld;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
public class HelloWorldActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
1. Java
2. DDMS
3. Debug
Java Perspective:
This is used for writing the source code. It shows file architecture for accessing the files
DDMS Perspective:
This perspective shows all the files in the phone that is used for running the application.
If the application is run on the simulator all the files are accessible. This is mainly useful
if your application uses SQLite Database then developers can access all the database
files. Any files created and stored by the application are accessible. Files can be
downloaded on to system and the content can be viewed and edited by using SQLite
Database Browser. If the application is run on the real device some of the file contents
Debug Perspective:
This perspective is used for debugging the application. Developers can set the break
points in the code and view the values of variable at any point in the code which is useful
for recognizing and fixing the bugs in the code. Developers can use the “Variable”
window to know the values of variables when the break point is reached.
38
Log Cat window shows all the errors. This is very useful for understanding the errors,
Chapter 4
SYSTEM IMPLEMENTATION
The purpose of this application is to eliminate the in class examination. There are
three users who will be using the application – Students, Professor and Administrator.
Cost Effectiveness
Environment Friendly
Allows the professor to create some practice tests for the students
Easy for students to take the practice test to understand the questions or the type
4.1 Administrator
This user is the main when considered the functionality of the application. This
user is responsible for adding new students, faculties, subjects etc. in the system.
Figure 32, is a snapshot of the Add subject Interface. The Admin uses this form to
add subjects.
When the user triggers the click event on the "Add" button, AddSubjectServlet
retrieves the values of the the input parameters (BranchName, Semester and
SubjectName) and creates a new instance of type "subject". The setter function stores the
that are entered in the input by the users and if they are not null create an entry in the
database and if the query is successful send the appropriate response to the client and thus
Figure 34, is a snapshot of the Delete subject Interface. The Admin uses this form
to delete subjects.
When the user triggers the click event on the "Delete" button,
to delete query which deletes the subject from subject table. On successful completion of
Once the user taps on Delete button, the client will send the values for the subject
that he intends to delete from the records. After the request has been successfully
processed from the server side, appropriate message will be forwarded to the client side.
45
Figure 36, is a snapshot of the Approve Professor Interface. The Admin uses this
When the user triggers the click event on the "Approve Professor" button,
ActivateProfessor Page sets the Approved Flag to yes and retrieves username created by
professor and generates a random password. Retrieved username and password are
When the administrator approves a professor, the fields like his name, Branch, ID
etc. will be set according to the request. Once the request for the professor is successfully
approved and the information is added to the database, then a new email will be sent to
Figure 38, is a snapshot of the Approve Student Interface. The Admin uses this
When the user triggers the click event on the "Approve Student" button,
ActivateStudent Page sets the Approved Flag to yes and retrieves username created by
student and generates a random password. Retrieved username and password are emailed
is added to the database with fields like First Name, Last Name etc. The login username
for the student will be setup as the student ID and the password will be a random number
that will generated from the system. An email containing the credentials of the student
Figure 40, is a snapshot of the Assign Subject to Professor Interface. The Admin
When the user triggers the click event on the "Assign Subject" button,
AssignSubjectServlet retrieves the values of the the input parameters (professor id,
branch name, Semester and Subject name) and creates a new instance of type
"assignedsubject". The setter function stores the values of this newly created instance to
sem = req.getParameter("sem");
subject = req.getParameter("subject");
EntityManager entityManager = EntityManagerService.get().createEntityManager();
EntityManager entityManager1 = EntityManagerService.get().createEntityManager();
try {
Query duckQuery = entityManager.createQuery("select e from AssignedSubject e
where subject='"+ subject + "'");
sub = new ArrayList<AssignedSubject>(duckQuery.getResultList());
if (sub == null || sub.isEmpty()) {
AssignedSubject subj = new AssignedSubject();
subj.seProfessorId(professorId);
subj.setBranch(branch);
subj.setSem(sem);
subj.setSubject(subject);
subject will be sent to the server for processing. The server will create a database record
based on the field obtained from client and enter the records in the database. After, the
request has been completed, the response will be sent to the client to show an appropriate
4.2 Professor
This user is responsible for taking the examinations in the class. He can create
new examinations, set some practice exams or add/modify the questions for the exams.
Figure 42, is a snapshot of the Professor Registration Interface. The User uses this
form to register.
1. The user enters the First Name, Last Name, Professor ID and Email Address.
When the user logs into the interface code in the ‘RegisterActivity.java’, file calls
input parameters (firstname, lastname, userid, email and branch) to register method in
fname = firstName.getText().toString().trim();
lname = lastName.getText().toString().trim();
lid = lecturerId.getText().toString().trim();
mail = email.getText().toString().trim();
try {
status = ackDAO.register(fname,lname,lid,mail,branch);
System.out.println("status in register auth....." + status);
if (status.equals("ok")) {
alert.showAlertDialog(RegisterActivity.this, "SUCCESS","Registered successfully.",
true);
the server. Once, the server responds with a message, then the client will show the
message accordingly to the user who was trying to do the Register Operation.
Professor ID and Email Address and branch name and creates a new instance of type
"professor". The setter function stores the values of this newly created instance to
firstname = req.getParameter("fname");
lastname = req.getParameter("lname");
professorId = req.getParameter("professorId");
branch = req.getParameter("branch");
email = req.getParameter("email");
//creating entity manager
EntityManager entityManager = EntityManagerService.get()
.createEntityManager();
try {Query duckQuery = entityManager
.createQuery("select e from Professor e where professorId='"+professorId+"'");
lect = new ArrayList<Professor>(duckQuery.getResultList());
if (lect== null || lect.isEmpty()) {
Professor professor=new Professor();
professor.setFirstName(firstname);
professor.setLastName(lastname);
professor.setProfessorId(professorId);
professor.setBranch(branch);
professor.setEmail(email);
Name, ID etc. and pass it to the server. The server will process the request from the client
and enter the records into the database. Once the process is completed on the server side,
the server will response with the status code and if the status is OK that means the request
is completed successfully the application will show an appropriate message to the client.
54
This screen appears once the user enters the credentials. User can select the
semester and subject for which he needs to create the exam or provide grades.
This screen appears once the user selects semester and subject. On this screen user
can either click on exam button or grading button. If user clicks on exam button he can
create an exam or he can view the list of exams which he has created. On clicking on any
one of the exam in list user can add questions, edit questions or view the questions of
exam. If user clicks on grading button he can give grades to students or can view the
statistics of exam.
Figure 48 and Figure 49, is a snapshot of the Professor Create Exam Interface.
The Professor uses this form to create an exam in which he can select date, time, duration
4. The user selects time range in which student can take the exam.
When the user logs into the interface code in the ‘SetExamActivity.java’, file calls
‘AppengineDAO.java’ it passes all the values of the input parameters entered by the user
examName = editExamName.getText().toString().trim();
date1 = pad(day)+"-"+ padMonth(month)+"-"+year;
try { status =
ackDAO.setExam(user,branch,sem,examType,examName,subject,date1,time.trim(),sec
ondtime,duration);
if (status.equals("ok")) {System.out.println("inside STATUS OK.....");
for the Exam Name. It will also get the data from the date picker regarding the time and
date of the examination. After all the values are obtained from the user inputs, the
application passes the data on to the server side to make an entry in the database and
return the appropriate process status. The response obtained from the server will be
SetExamServlet class on server retrieves all values entered by user and creates a
new instance of type "setExam". The setter function stores the values of this newly
from the user through the client. The server data will catch any exception that may be
thrown due to invalid or wrong values from the client side. If all the entered information
from the user is correct than the data will be stored in the database and the server will
send the response code OK to the client else will send the appropriate error code.
60
Figure 53, is a snapshot of the Professor View Exam Interface. The Professor uses
When the user logs into the interface code in the DisplayAllExamExamActivity,
The application will get all the information from the client and after converting it
into appropriate format (converting List<NameValuePair>), the client will send the
For GetAllExams servlet, the client will send the value of a user. If the professor
ID is valid, then the server will query the database for all the exams that are present for
that user. Once, it gets all the exams from the database, it will put into the form of an
ArrayList and send the result to the client for further processing.
Figure 57, is a snapshot when Professor clicks on one of the exam in the list of view
exam activity.
1. Add Questions.
2. Edit Questions.
Figure 58 and figure 59, is a snapshot of the Professor Add Question Interface.
The Professor uses this form to add multiple choice or free response questions to the
exam.
4. The user selects correct answer option for multiple choice questions.
5. The user enters points for the question. If the question is Free response user can
6. Then clicks on add button to add the question for the exam.
66
When the user logs into the interface code in the ‘AddQuestionActivity.java’, file
in ‘AppengineDAO.java’ it passes all the values of the input parameters entered by the
question = editQuestion.getText().toString().trim();
optionA = editAnswerA.getText().toString().trim();
optionB = editAnswerB.getText().toString().trim();
optionC = editAnswerC.getText().toString().trim();
optionD = editAnswerD.getText().toString().trim();
System.out.println("before ackDAO.AddQuestion");
System.out.println("...............6..................");
String status = ackDAO.AddQuestion(user, exam, questionType, question, answer,
optionA, optionB, optionC, optionD, marks.trim());
System.out.println("status in AddQuestion...." + status);
components that are provided on screen. After validating all the information, the client
will put those fields into an ArrayList that the server can parse and store it in the
database. The client will set that ArrayList in the body of the HTTP Request that will be
creates a new instance of type "question". The setter function stores the values of this
try {
Questions qust = new Questions();
qust.setExamName(examName);
qust.setQuestionNo(questionNo);
qust.setQuestionType(questionType);
qust.setQuestion(question);
qust.setAnswer(answer);
qust.setMarks(marks);
try {
entityManager.persist(qust);
resp.setStatus(HttpServletResponse.SC_OK);
} catch (Exception e) {
resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
}
all the necessary information. After validating all the information obtained from the
68
client, the server will store the data into the database and return the response code OK to
the client. If the information is not appropriate, then the server will respond with the error
Figure 63, is a snapshot of the Professor Edit Question Interface. The Professor
4. Then clicks on edit button to edit the question for the exam.
5. User can also click on prev or next button to go back and forth
70
When the user logs into the interface code in the ‘EditQuestionsActivity.java’, file
in ‘AppengineDAO.java’ it passes all the values of the input parameters entered by the
question = editQuestion.getText().toString().trim();
optionA = editAnswerA.getText().toString().trim();
optionB = editAnswerB.getText().toString().trim();
optionC = editAnswerC.getText().toString().trim();
optionD = editAnswerD.getText().toString().trim();
String status = ackDAO.editQuestion(user,exam,questionNumber,questionType,
question, answer, optionA, optionB, optionC, optionD,marks.trim());
The client will receive all the data that is entered by the user in the all the
components that are provided on screen. After validating all the information, the client
will put those fields into an ArrayList that the server can parse and store it in the
database. The client will set that ArrayList in the body of the HTTP Request that will be
entered by user and creates a new instance of type "question". The setter function stores
the values of this newly created instance to Database. On successful completion of this
Successfully ").
request. After processing all the information if all the fields are valid, then information
will added to the database through entityManager.persist method and the server will
respond will OK status code. If there are some input issues, then server will catch the
Exception and return a BAD REQUEST status code to the client who made the request.
72
Figure 67, is a snapshot of the Professor Edit Exam Schedule Interface. The
Professor uses this form to edit time and date of the exam which he has created.
2. User can modify date and time of exam which he has created.
When the user logs into the interface code in the ‘EditExamActivity.java’, file
‘AppengineDAO.java’ it passes all the values of the input parameters entered by the user
examName = editExamName.getText().toString().trim();
System.out.println("day in setButtonListener..." + day);
date1 = pad(day)+"-"+ padMonth(month)+"-"+year;
System.out.println("time in setButtonListener..." + time.trim());
try {System.out.println("before calling set exam");
status = ackDAO.editExam(user,branch,sem,examName,subject);
entered by user and creates a new instance of type " setExam". The setter function stores
the values of this newly created instance to Database. On successful completion of this
For editing an existing examination, the server needs the information about the
previous exam ID and if that value is correctly passed by the client to the server, then the
server will validate all the information obtained from the client; If valid then return a
response code OK otherwise for bad requests it will send the code BAD REQUEST.
75
Figure 71, is a snapshot of the Professor Grading exam activity Interface. The
1. The user selects grades option from the exams he wants to give grades.
4. User checks the answer and enter points for the answer..
5. User can also click on prev or next button to go back and forth
76
When the user logs into the interface code in the ‘VerifyAnswerActivity.java’,
‘AppengineDAO.java’ it passes all the values of the input parameters entered by the user
if(flag==false) {
String status=ackDAO.putMarks(student,exam ,question,answer,marks);
if (status.equals("ok")) {
} else {
alert.showAlertDialog(VerifyAnswerActivity.this, "Error!",
"Error while providing marks.", false);
}
name, student ID and the marks that the student has scored in the examination. The client
gets all the values from the user and validates all the inputs and propagates the request to
the server.
by user and creates a new instance of type "marks". The setter function stores the values
ArrayList. The server will parse the ArrayList and extract the fields that are necessary out
of that. If the fields are proper, then the server will store all the information in the
database and return a success code the client. If there are some issues while processing
the request, then the server will catch the exception and return a BAD Request to the
client.
78
Figure 75, is a snapshot of the Professor View Exam Statistics interface. All the
charts displayed use the Android Plot library. The following figure displays two sets of
data. First set displays a bar chart which shows the number of students falling in a
particular score range set by the professor. It is being used so as to make the data easily
readable for humans. The second set of data displays the score scale for the class, where
it shows highest score, average score, lowest score and the median for the class.
Graph Activity retrieves marks of all students from database and stores in
arraylist. Arraylist is sorted. First element of arraylist is lowest marks of student, last
element is highest marks and by adding all the marks and dividing by number of students
statastics=new ArrayList<Integer>();
Collections.sort(compmarks);
int total=0;
for(int i=0;i<compmarks.size();i++) {
total = total + compmarks.get(i);
}
statastics.add(compmarks.get(0));
total= total / compmarks.size();
System.out.println("total ==="+total);
statastics.add(total);
statastics.add(compmarks.get(compmarks.size()-1));
data is obtained from the server and processed on the client side and using the libraries of
4.3 Student
This user is responsible for taking the examinations that are set by the professor.
He can practice a quiz that has been set by the professor. He can view the grades for the
exam irrespective of the type of exams that have been set by the professor.
Figure 78, is a snapshot of the Student Registration Interface. The Student uses
1. The user enters the First Name, Last Name, Student ID and Email Address.
2. The user selects the desired branch and semester in which he wants to register.
When the user logs into the interface code in the ‘RegisterActivity.java’, file calls
input parameters (firstname, lastname, userid, email and branch) to register method in
fname = firstName.getText().toString().trim();
lname = lastName.getText().toString().trim();
sid = studentId.getText().toString().trim();
mail = email.getText().toString().trim();
System.out.println("inside flag false.....");
try {
status = ackDAO.register(fname, lname, sid, mail, branch,sem);
System.out.println("status in register auth....." + status);
if (status.equals("ok")) {
System.out.println("inside STATUS OK.....");
alert.showAlertDialog(RegisterActivity.this, "SUCCESS",
"Registered successfully.", true);
for him to enter the information. The client will then convert all the values into an
ArrayList that the server understands and POST a request to the server using the HTTP
ID, Email Address and branch name and creates a new instance of type "student". The
setter function stores the values of this newly created instance to Database. On successful
("Registered Successfully").
The server will obtain all the information from the client and parse out the necessary
fields from the request body. After validating all the information, if the fields are valid
and appropriate, then the record will be stored in the database and the server will return
success code otherwise in the case of bad fields, the server will response Bad Request
This screen appears once the user enters the credentials. Student can select the
semester and subject for which he needs to take the exam and view the grades.
Figure 83, is a snapshot of the Start Exam Interface. Once the student clicks on
start exam, a request is send to the server with exam name. The server retrieves date and
time set by the professor for that exam. Server then compares the retrieved date with
today’s date and also compares the time at which student has logged in the interface with
the time range set by the professor. If the date set for the exam matches today’s date and
if the student falls in the set time range, the student will be allowed to give the exam.
Figure 84, is a code snippet which compares date set by the professor with the
date on which student has logged into start exam interface. If the student has logged on
the same date he is allowed to give exam. If he logs on different date response is send
Figure 85, is code snippet which compares time range set by the lecturer with
student’s time at which he has logged into start exam interface. If student logs between
the start time and cutoff time set by professor he is allowed to give exam. If he logs
before starttime response is send back to application “Please wait to start exam”. If he
logs after cutoff time response is send back to application “Exam is Over”.
Once the student clicks on start exam, and all the conditions of date and time are
satisfied student is allowed to give the exam. Figure is a snapshot of multiple choice and
free response exam questions. Student can use next and prev buttons to move back and
Figure 88, is a code snippet which sends request to the server to retrieve question
for the student application. Depending on the question number passed by the application
the server sends the response back to the application with question.
For getting the questions for any exam, the client will pass the values of the exam
name and the question number in the form of an ArrayList that the server can understand.
The server will return appropriate response code based on the request of the client.
The server will receive the information about the exam name and the question
number from the client. The server will validate the request and if the fields are valid will
return the information about the next question from database along with status code OK
and if the fields in the request are not valid, then the server will send the response code of
BAD Request.
92
Once the user completes the exam, Points for that exam are made available in
Below is a code snippet which sends requests to server and retrieves points of
student for that exam. All points retrieved are stored in arraylist and the list is sorted.
First element of the list gives lowest score while last element of gives highest score and
Chapter 5
CONCLUSION
5.1 Conclusion
The main objective or motive behind developing this application is to the remove
the need of the traditional (in-class examinations). This in turn may end up saving some
energy and resources for the human being and thus could prove environment friendly. If
resources that will be useful for the human race as the application will eliminate the need
of in class examination completely if the designed is fully evolved over a period of time.
This implies that the student can be present in any part of the world to take the
examination. Also, this application can come in handy when the professor wants to take a
surprise quiz in the class and if the student is not present in the class, still he has the
option of attending the exam and scoring some points rather than missing the exam and
losing all the points. All the entities that are involved in the process of School/College
Education can make their lives easier with the applications that are meant for a similar
The administrator will be able to add subjects and professors per semester
according to the registration process. The Administrator will also have the privilege of
The professor can choose to create exams for which he can add the questions or
he can choose to modify the existing questions that are already entered by him. The
professor can also set the practice exams for the students so that they can come to know
95
the level or type of the questions that may be asked in the actual examination. If the exam
is theory, the he can set the marks per section of the answer and if the examination is
multiple choice questions, then the professor has to provide the correct answers at the
time of creating the questions. The application will automatically provide the score for
those exams once the student answers all the questions. The professor has the option to
The student can choose to answer all the questions in the examination set by the
professor. The student can also choose to take the practice exams and answer those
Since no design is perfect and complete ever, the design and the scope of the
application will keep evolving over the period of time. But presently, this is the first
attempt to implement the ideas and thoughts that I had in my mind for helping the people
associated with the field of Education and making their life easier and adding luxury to
their life.
96
The Existing system supports only multiple choice and free response questions,
the system can be enhanced to support other types of questions like fill in the blanks, true
or false etc.
The existing system has no image support at present so images and diagrams
cannot be included in exams which can make it difficult to ask certain questions.
Application can be extended using higher level of security, as it stores critical data
of student scores.
97
References
http://developer.android.com/
http://en.wikipedia.org/wiki/Android_(operating_system)
https://developers.google.com/appengine/
http://en.wikipedia.org/wiki/Google_App_Engine
http://www.scribd.com/doc/22746893/Online-Examination-Project-Report-
Documentation-Only
http://androidplot.com/wiki/Home
http://en.wikipedia.org/wiki/System_context_diagram