Re-LogIn"; } else if (isset($_SESSION['starttime'])) { header('Location: testconducter.php'); } else if (isset($_REQUEST['logout'])) { //Log out and redirect login page unset($_SESSION['stdname']); header('Location: index.php'); } else if (isset($_REQUEST['dashboard'])) { //redirect to dashboard // header('Location: stdwelcome.php'); } else if (isset($_REQUEST['starttest'])) { //Prepare the parameters needed for Test Conducter and redirect to test conducter if (!empty($_REQUEST['tc'])) { $result = executeQuery("select DECODE(testcode,'oespass') as tcode from test where testid=" . $_SESSION['testid'] . ";"); if ($r = mysql_fetch_array($result)) { if (strcmp(htmlspecialchars_decode($r['tcode'], ENT_QUOTES), htmlspecialchars($_REQUEST['tc'], ENT_QUOTES)) != 0) { $display = true; $_GLOBALS['message'] = "You have entered an Invalid Test Code.Try again."; } else { //now prepare parameters for Test Conducter and redirect to it. //first step: Insert the questions into table $result = executeQuery("select * from question where testid=" . $_SESSION['testid'] . " order by qnid;"); if (mysql_num_rows($result) == 0) { $_GLOBALS['message'] = "Tests questions cannot be selected.Please Try after some time!"; } else { // executeQuery("COMMIT"); $error = false; // executeQuery("delimiter |"); /* if (!executeQuery("create event " . $_SESSION['stdname'] . time() . " ON SCHEDULE AT (select endtime from studenttest where stdid=" . $_SESSION['stdid'] . " and testid=" . $_SESSION['testid'] . ") + INTERVAL (select duration from test where testid=" . $_SESSION['testid'] . ") MINUTE DO update studenttest set correctlyanswered=(select count(*) from studentquestion as sq,question as q where sq.qnid=q.qnid and sq.testid=q.testid and sq.answered='answered' and sq.stdanswer=q.correctanswer and sq.stdid=" . $_SESSION['stdid'] . " and sq.testid=" . $_SESSION['testid'] . "),status='over' where stdid=" . $_SESSION['stdid'] . " and testid=" . $_SESSION['testid'] . "|")) $_GLOBALS['message'] = "error" . mysql_error(); executeQuery("delimiter ;");*/ if (!executeQuery("insert into studenttest values(" . $_SESSION['stdid'] . "," . $_SESSION['testid'] . ",(select CURRENT_TIMESTAMP),date_add((select CURRENT_TIMESTAMP),INTERVAL (select duration from test where testid=" . $_SESSION['testid'] . ") MINUTE),0,'inprogress')")) $_GLOBALS['message'] = "error" . mysql_error(); else { while ($r = mysql_fetch_array($result)) { if (!executeQuery("insert into studentquestion values(" . $_SESSION['stdid'] . "," . $_SESSION['testid'] . "," . $r['qnid'] . ",'unanswered',NULL)")) { $_GLOBALS['message'] = "Failure while preparing questions for you.Try again"; $error = true; } } if ($error == true) { // executeQuery("rollback;"); } else { $result = executeQuery("select totalquestions,duration from test where testid=" . $_SESSION['testid'] . ";"); $r = mysql_fetch_array($result); $_SESSION['tqn'] = htmlspecialchars_decode($r['totalquestions'], ENT_QUOTES); $_SESSION['duration'] = htmlspecialchars_decode($r['duration'], ENT_QUOTES); $result = executeQuery("select DATE_FORMAT(starttime,'%Y-%m-%d %H:%i:%s') as startt,DATE_FORMAT(endtime,'%Y-%m-%d %H:%i:%s') as endt from studenttest where testid=" . $_SESSION['testid'] . " and stdid=" . $_SESSION['stdid'] . ";"); $r = mysql_fetch_array($result); $_SESSION['starttime'] = $r['startt']; $_SESSION['endtime'] = $r['endt']; $_SESSION['qn'] = 1; header('Location: testconducter.php'); } } } } } else { $display = true; $_GLOBALS['message'] = "You have entered an Invalid Test Code.Try again."; } } else { $display = true; $_GLOBALS['message'] = "Enter the Test Code First!"; } } else if (isset($_REQUEST['testcode'])) { //test code preparation if ($r = mysql_fetch_array($result = executeQuery("select testid from test where testname='" . htmlspecialchars($_REQUEST['testcode'], ENT_QUOTES) . "';"))) { $_SESSION['testname'] = $_REQUEST['testcode']; $_SESSION['testid'] = $r['testid']; } } else if (isset($_REQUEST['savem'])) { //updating the modified values if (empty($_REQUEST['cname']) || empty($_REQUEST['password']) || empty($_REQUEST['email'])) { $_GLOBALS['message'] = "Some of the required Fields are Empty.Therefore Nothing is Updated"; } else { $query = "update student set stdname='" . htmlspecialchars($_REQUEST['cname'], ENT_QUOTES) . "', stdpassword=ENCODE('" . htmlspecialchars($_REQUEST['password'], ENT_QUOTES) . "','oespass'),emailid='" . htmlspecialchars($_REQUEST['email'], ENT_QUOTES) . "',contactno='" . htmlspecialchars($_REQUEST['contactno'], ENT_QUOTES) . "',address='" . htmlspecialchars($_REQUEST['address'], ENT_QUOTES) . "',city='" . htmlspecialchars($_REQUEST['city'], ENT_QUOTES) . "',pincode='" . htmlspecialchars($_REQUEST['pin'], ENT_QUOTES) . "' where stdid='" . $_REQUEST['student'] . "';"; if (!@executeQuery($query)) $_GLOBALS['message'] = mysql_error(); else $_GLOBALS['message'] = "Your Profile is Successfully Updated."; } closedb(); } ?> OES-Offered Tests " . $_GLOBALS['message'] . ""; } ?>
OES

 Online Examination System

...because Examination Matters

What is the Code of " . $_SESSION['testname'] . " ?
"; } else { echo "
Offered Tests
"; } ?>
Enter Test Code
Note:
Once you press start test
button timer will be started
Sorry...! For this moment, You have not Offered to take any tests."; } else { //editing components ?> "; } else { echo ""; } echo "" . ""; } ?>
Test Name Test Description Subject Name Duration Total Questions Take Test
" . htmlspecialchars_decode($r['testname'], ENT_QUOTES) . "" . htmlspecialchars_decode($r['testdesc'], ENT_QUOTES) . "" . htmlspecialchars_decode($r['subname'], ENT_QUOTES) . "" . htmlspecialchars_decode($r['duration'], ENT_QUOTES) . "" . htmlspecialchars_decode($r['totalquestions'], ENT_QUOTES) . "\"Start