Project name :Online Entrance Examination System
Team members :K L Sudhakar(200905018)
              M Sandeep(200905019)
 
Description:
Our project consists of Centralized database of questions from which subset of questions are to be sent to the student who opts the exam.
The questions appear in varying level of difficulty so that if the student answers a perticular level question correctly  a higher level question
appears.This continues upto a certain highest level of difficulty. And if student answers wrongly difficulty level decreases. The evaluation
is done based on the difficulty level of question which has been sent.
 
Our project uses socket programming for sending the questions from server database to client followed by the submission of student answers to the server.  
And then finally sending the result of the exam from server to client.

Our project use Multi-Threaded server where each client is serviced using a separate thread, so that every client's processing is isolated in the server and even if 
a client is blocked during its execution other clients will have zero effect.

Our project uses GTK for Displaying the Questions and result at client side.
 
The areas getting covered in this project are:
1 Socket programming.
2 Multi-Threading.
3 GTK programming.
4 Database Management.


Implementation Details:
Our project consists of total 2 '.c' files..
1 examevalserver.c
2 examclient.c


Requirements:
1 My-sql should be preinstalled.
2 Gtk should be preinstalled.
3 Database consisting of 4 tables consisting of 10 questions each.(one for each level of difficulty adding to 4 levels of questions.)
  We have provided the code for creating database, and also the CREATE and INSERT statements to build the database.


Execution of project:
Our project starts with execution of server program (server.c). Which listens the client connections in the port 8000.
Server creates a thread for each client in the port and starts sending the questions and receiving the answers. When the specied no. of questions completed server sends the marks of the students.

It is assumed a database is created prior to the execution of server or client. The database should contain 4 tables namely exam1,exam2,exam3,exam4. Each table should have same number of questions which will be given as an input to server.

Server:

The server listens to port 8000. The server asks for various inputs.

It asks for mysql database username, password and database name.

It also asks for the number of questions that are present in the database in each level.

The next input is the number of questions that are given in the exam to the client. 

Client:

The client takes the IP address of the server as a command-line argument.

The client will then get a series of questions which when answered will get the final score of the exam.

If the exam is closed abruptly then he will not get any score but instead gets an error dialog. 


Sample statements to create database....

LEVEL 1 TABLE::

CREATING:
CREATE table exam1(quesno integer,ques varchar(1000),opt1 varchar(1000),opt2 varchar(1000),opt3 varchar(1000),opt4 varchar(1000),anwer integer);

INSERTING:
insert into exam1 values(1,' 5/5 ','0','1','2','10',2);
insert into exam1 values(2,'1-1','1','-1','-2','0',1);
insert into exam1 values(3,'a+b','b+a','a-b','ab','a/b',1);
insert into exam1 values(4,'4*3','24','34','43','12',4);
insert into exam1 values(5,'who is current our pm?','vajpayee','advani','nehru','Dr.singh',4);
insert into exam1 values(6,'100/5','10','20','30','40',2);
insert into exam1 values(7,'123+1=','12','123','1234','124',4);
insert into exam1 values(8,'abc*d=','abcd','d','av','ac',1);
insert into exam1 values(9,'2+3=','2','3','23','5',4);
insert into exam1 values(10,'Which year is this?','2007','2008','2009','2010',4);


LEVEL 2 TABLE::

CREATING:
CREATE table exam2(quesno integer,ques varchar(1000),opt1 varchar(1000),opt2 varchar(1000),opt3 varchar(1000),opt4 varchar(1000),anwer integer);

INSERTING:
insert into exam2 values(1,'5*5=?','5','55','25','10',3);
insert into exam2 values(2,'10*10=?','10','100','1000','none',2);
insert into exam2 values(3,'10/0=?','10','1','infinity','cant say',3);
insert into exam2 values(4,'where is IIIT?','gachibowli','AP','INDIA','all the above',4);
insert into exam2 values(5,'how many legs do dog have?','1','4','44','444',2);
insert into exam2 values(6,'a+b=4 and a=3 then b=?','1','4','-1','0',1);
insert into exam2 values(7,'8*9=?','22','27','72','10',3);
insert into exam2 values(8,'what is LINUX','Operating system','maths','physics','social',1);
insert into exam2 values(9,'88/8=?','8','9','10','11',4);
insert into exam2 values(10,'100+100-200=?','100','200','0','10',3);

LEVEL 3 TABLE::

CREATING:
CREATE table exam3(quesno integer,ques varchar(1000),opt1 varchar(1000),opt2 varchar(1000),opt3 varchar(1000),opt4 varchar(1000),anwer integer);

INSERTING:
insert into exam3 values(1,'sqrt(36)=?','6','7','8','9',1);
insert into exam3 values(2,'0/0=?','1','0','infinity','none of the above',4);
insert into exam3 values(3,'sqrt(64)=?','6','7','8','9',3);
insert into exam3 values(4,'(a*a)/(2*a)=?','a/2','2a','3a','a/4',1);
insert into exam3 values(5,'which form oxygen available?','soild','gas','liquid','paste',2);
insert into exam3 values(6,'who is current president=?','kalam','prathibha patil','rajendhra prasad','sarvepalli',2);
insert into exam3 values(7,'who is AP cm=?','YSR','Chandrababu','rosaiah','jagan',3);
insert into exam3 values(8,'what next a,c,e,g,i,......?','j','k','l','m',2);
insert into exam3 values(9,'what next 1,8,27,.....?','50','125','89','64',4);
insert into exam3 values(10,'fill it comp....ter','a','e','i','u',4);


LEVEL 4 TABLE::

CREATING:
CREATE table exam4(quesno integer,ques varchar(1000),opt1 varchar(1000),opt2 varchar(1000),opt3 varchar(1000),opt4 varchar(1000),anwer integer);

INSERTING:
insert into exam4 values(1,'The longest river in the world is?','ganga','godhavari','nile','amezon',3);
insert into exam4 values(2,'The highest mountain in the world is?','everest','k2','nilgiri','none',1);
insert into exam4 values(3,'The largest coffee growing country in the world is?','India','Brazil','America','Russia',2);
insert into exam4 values(4,'The Japanese call their country as?','pinnon','nippon','kille','rache',2);
insert into exam4 values(5,'country of copper','India','zambia','America','Russia',2);
insert into exam4 values(6,'a=2 and b=3 then a^2+b^2+2ab=?','25','64','36','49',1);
insert into exam4 values(7,'The country which is the largest producer of tin in the world is?','India','china','America','Russia',2);
insert into exam4 values(8,'Name the only other country to have got independence on Aug 15th?','pakistan','koria','china','russia',2);
insert into exam4 values(9,'Who is the new Prime Minister of Sri Lanka ?','Chandrika Kumaratunga','Ranil Wickremesinghe','Mahinda Rajapakse','none',3);
insert into exam4 values(10,'Which one of the following lakes forms and international boundary between Tanzania and Uganda ?','Chad','Malawi','Zambezi','Victoria',4);


