<?php




        $cookie_name = "user_cb";

if(!isset($_COOKIE[$cookie_name])) {
   // echo "Cookie named '" . $cookie_name . "' is not set!";
        header('Location: quiz-login.php');
        exit;
} else {
    //echo "Cookie '" . $cookie_name . "' is set!<br>";
    //echo "Value is: " . $_COOKIE[$cookie_name];
}









Function make($total)
{
    $con = mysql_connect('localhost', 'root', 'Boom95z') or die(mysql_error());
    mysql_select_db('cgg_web', $con);
    $result_1 = mysql_query("select qid, textis from questions");
    while ($row = mysql_fetch_array($result_1)) {
        if ($row['qid'] == '1')
            $q1 = $row['textis'];
        if ($row['qid'] == '2')
            $q2 = $row['textis'];
        if ($row['qid'] == '3')
            $q3 = $row['textis'];
        if ($row['qid'] == '4')
            $q4 = $row['textis'];
        if ($row['qid'] == '5')
            $q5 = $row['textis'];
        if ($row['qid'] == '6')
            $q6 = $row['textis'];
        if ($row['qid'] == '7')
            $q7 = $row['textis'];
        if ($row['qid'] == '8')
            $q8 = $row['textis'];
        if ($row['qid'] == '9')
            $q9 = $row['textis'];
        if ($row['qid'] == '10')
            $q10 = $row['textis'];
        if ($row['qid'] == '11')
            $q11 = $row['textis'];
        if ($row['qid'] == '12')
            $q12 = $row['textis'];
        if ($row['qid'] == '13')
            $q13 = $row['textis'];
        if ($row['qid'] == '14')
            $q14 = $row['textis'];
        if ($row['qid'] == '15')
            $q15 = $row['textis'];
        if ($row['qid'] == '16')
            $q16 = $row['textis'];
        if ($row['qid'] == '17')
            $q17 = $row['textis'];
        if ($row['qid'] == '18')
            $q18 = $row['textis'];
        if ($row['qid'] == '19')
            $q19 = $row['textis'];
        if ($row['qid'] == '20')
            $q20 = $row['textis'];
        if ($row['qid'] == '21')
            $q21 = $row['textis'];
        if ($row['qid'] == '22')
            $q22 = $row['textis'];
        if ($row['qid'] == '23')
            $q23 = $row['textis'];
        if ($row['qid'] == '24')
            $q24 = $row['textis'];
        if ($row['qid'] == '25')
            $q25 = $row['textis'];
    }
    $result_2 = mysql_query("select qid, ans_bullet from answers where correct=1");
    while ($row = mysql_fetch_array($result_2)) {
        if ($row['qid'] == '1')
            if ($_POST['rd_1'] != $row['ans_bullet'])
                $err_1 = ' WRONG ';
            else
                $err_1 = '';
        if ($row['qid'] == '2')
            if ($_POST['rd_2'] != $row['ans_bullet'])
                $err_2 = ' WRONG ';
            else
                $err_2 = '';
        if ($row['qid'] == '3')
            if ($_POST['rd_3'] != $row['ans_bullet'])
                $err_3 = ' WRONG ';
            else
                $err_3 = '';
        if ($row['qid'] == '4')
            if ($_POST['rd_4'] != $row['ans_bullet'])
                $err_4 = ' WRONG ';
            else
                $err_4 = '';
        if ($row['qid'] == '5')
            if ($_POST['rd_5'] != $row['ans_bullet'])
                $err_5 = ' WRONG ';
            else
                $err_5 = '';
        if ($row['qid'] == '6')
            if ($_POST['rd_6'] != $row['ans_bullet'])
                $err_6 = ' WRONG ';
            else
                $err_6 = '';
        if ($row['qid'] == '7')
            if ($_POST['rd_7'] != $row['ans_bullet'])
                $err_7 = ' WRONG ';
            else
                $err_7 = '';
        if ($row['qid'] == '8')
            if ($_POST['rd_8'] != $row['ans_bullet'])
                $err_8 = ' WRONG ';
            else
                $err_8 = '';
        if ($row['qid'] == '9')
            if ($_POST['rd_9'] != $row['ans_bullet'])
                $err_9 = ' WRONG ';
            else
                $err_9 = '';
        if ($row['qid'] == '10')
            if ($_POST['rd_10'] != $row['ans_bullet'])
                $err_10 = ' WRONG ';
            else
                $err_10 = '';
        if ($row['qid'] == '11')
            if ($_POST['rd_11'] != $row['ans_bullet'])
                $err_11 = ' WRONG ';
            else
                $err_11 = '';
        if ($row['qid'] == '12')
            if ($_POST['rd_12'] != $row['ans_bullet'])
                $err_12 = ' WRONG ';
            else
                $err_12 = '';
        if ($row['qid'] == '13')
            if ($_POST['rd_13'] != $row['ans_bullet'])
                $err_13 = ' WRONG ';
            else
                $err_13 = '';
        if ($row['qid'] == '14')
            if ($_POST['rd_`4'] != $row['ans_bullet'])
                $err_14 = ' WRONG ';
            else
                $err_14 = '';
        if ($row['qid'] == '15')
            if ($_POST['rd_15'] != $row['ans_bullet'])
                $err_15 = ' WRONG ';
            else
                $err_15 = '';
        if ($row['qid'] == '16')
            if ($_POST['rd_16'] != $row['ans_bullet'])
                $err_16 = ' WRONG ';
            else
                $err_16 = '';
        if ($row['qid'] == '17')
            if ($_POST['rd_17'] != $row['ans_bullet'])
                $err_17 = ' WRONG ';
            else
                $err_17 = '';
        if ($row['qid'] == '18')
            if ($_POST['rd_18'] != $row['ans_bullet'])
                $err_18 = ' WRONG ';
            else
                $err_18 = '';
        if ($row['qid'] == '19')
            if ($_POST['rd_19'] != $row['ans_bullet'])
                $err_19 = ' WRONG ';
            else
                $err_19 = '';
        if ($row['qid'] == '20')
            if ($_POST['20'] != $row['ans_bullet'])
                $err_20 = ' WRONG ';
            else
                $err_20 = '';
        if ($row['qid'] == '21')
            if ($_POST['rd_21'] != $row['ans_bullet'])
                $err_21 = ' WRONG ';
            else
                $err_21 = '';
        if ($row['qid'] == '22')
            if ($_POST['rd_22'] != $row['ans_bullet'])
                $err_22 = ' WRONG ';
            else
                $err_22 = '';
        if ($row['qid'] == '23')
            if ($_POST['rd_23'] != $row['ans_bullet'])
                $err_23 = ' WRONG ';
            else
                $err_23 = '';
        if ($row['qid'] == '24')
            if ($_POST['rd_24'] != $row['ans_bullet'])
                $err_24 = ' WRONG ';
            else
                $err_24 = '';
        if ($row['qid'] == '25')
            if ($_POST['rd_25'] != $row['ans_bullet'])
                $err_25 = ' WRONG ';
            else
                $err_25 = '';
    }
    $ret = "<html>" . "<body>" . "<span font=\"Arial\" color=\"gray\">" . "<b>Name:</b> " . mysql_escape_string($_POST['f1']) . "<br/><br/>" . "<p><b>Result:</b>" . $total . "/25" . "</p><br/><br/>" . "<b>" . $q1 . "</b> " . $_POST['rd_1'] . " - " . $err_1 . "<br/><br/>" . "<b>" . $q2 . "</b>: " . $_POST['rd_2'] . " - " . $err_2 . "<br/><br/>" . "<b>" . $q3 . "</b>: " . $_POST['rd_3'] . " - " . $err_3 . "<br/><br/>" . "<b>" . $q4 . "</b>: " . $_POST['rd_4'] . " - " . $err_4 . "<br/><br/>" . "<b>" . $q5 . "</b>: " . $_POST['rd_5'] . " - " . $err_5 . "<br/><br/>" . "<b>" . $q6 . "</b>: " . $_POST['rd_6'] . " - " . $err_6 . "<br/><br/>" . "<b>" . $q7 . "</b>: " . $_POST['rd_7'] . " - " . $err_7 . "<br/><br/>" . "<b>" . $q8 . "</b>: " . $_POST['rd_8'] . " - " . $err_8 . "<br/><br/>" . "<b>" . $q9 . "</b>: " . $_POST['rd_9'] . " - " . $err_9 . "<br/><br/>" . "<b>" . $q10 . "</b>: " . $_POST['rd_10'] . " - " . $err_10 . "<br/><br/>" . "<b>" . $q11 . "</b>: " . $_POST['rd_11'] . " - " . $err_11 . "<br/><br/>" . "<b>" . $q12 . "</b>: " . $_POST['rd_12'] . " - " . $err_12 . "<br/><br/>" . "<b>" . $q13 . "</b>: " . $_POST['rd_13'] . " - " . $err_13 . "<br/><br/>" . "<b>" . $q14 . "</b>: " . $_POST['rd_14'] . " - " . $err_14 . "<br/><br/>" . "<b>" . $q15 . "</b>: " . $_POST['rd_15'] . " - " . $err_15 . "<br/><br/>" . "<b>" . $q16 . "</b>: " . $_POST['rd_16'] . " - " . $err_16 . "<br/><br/>" . "<b>" . $q17 . "</b>: " . $_POST['rd_17'] . " - " . $err_17 . "<br/><br/>" . "<b>" . $q18 . "</b>: " . $_POST['rd_18'] . " - " . $err_18 . "<br/><br/>" . "<b>" . $q19 . "</b>: " . $_POST['rd_19'] . " - " . $err_19 . "<br/><br/>" . "<b>" . $q20 . "</b>: " . $_POST['rd_20'] . " - " . $err_20 . "<br/><br/>" . "<b>" . $q21 . "</b>: " . $_POST['rd_21'] . " - " . $err_21 . "<br/><br/>" . "<b>" . $q22 . "</b>: " . $_POST['rd_22'] . " - " . $err_22 . "<br/><br/>" . "<b>" . $q23 . "</b>: " . $_POST['rd_23'] . " - " . $err_23 . "<br/><br/>" . "<b>" . $q24 . "</b>:: " . $_POST['rd_24'] . " - " . $err_24 . "<br/><br/>" . "<b>" . $q25 . "</b> " . $_POST['rd_25'] . " - " . $err_25 . "<br/><br/>" . "</p>" . "</span>" . "</body>" . "</html>";
    
    return $ret;
    
    
    
}

Function RandomString()
{
			$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
			$randstring = '';

			 for ($i = 0; $i < 90; $i++)
			 {
					$randVal =  rand (0,61);
					$randstring = $randstring . $characters[$randVal];
			 }

			return $randstring;
}


$qidIs = $_GET['qid'];

$con = mysql_connect('localhost', 'root', 'Boom95z') or die(mysql_error());
mysql_select_db('cgg_web', $con);;
$f1 = mysql_escape_string($_POST['f1']);

$rd_1  = $_POST['rd_1'];
$rd_2  = $_POST['rd_2'];
$rd_3  = $_POST['rd_3'];
$rd_4  = $_POST['rd_4'];
$rd_5  = $_POST['rd_5'];
$rd_6  = $_POST['rd_6'];
$rd_7  = $_POST['rd_7'];
$rd_8  = $_POST['rd_8'];
$rd_9  = $_POST['rd_9'];
$rd_10 = $_POST['rd_10'];
$rd_11 = $_POST['rd_11'];
$rd_12 = $_POST['rd_12'];
$rd_13 = $_POST['rd_13'];
$rd_14 = $_POST['rd_14'];
$rd_15 = $_POST['rd_15'];
$rd_16 = $_POST['rd_16'];
$rd_17 = $_POST['rd_17'];
$rd_18 = $_POST['rd_18'];
$rd_19 = $_POST['rd_19'];
$rd_20 = $_POST['rd_20'];
$rd_21 = $_POST['rd_21'];
$rd_22 = $_POST['rd_22'];
$rd_23 = $_POST['rd_23'];
$rd_24 = $_POST['rd_24'];
$rd_25 = $_POST['rd_25'];

$examId = '';
$examId = $_GET['e'];

if ($examId  == '')
{
	$randomCode = RandomString();	
	$insString = "INSERT INTO exam (initialcode) VALUES ('" . $randomCode . "')";
	mysql_query($insString);	
	$examId = $randomCode;
	//echo "INSERT INTO exam (initialcode) VALUES ('" . $randomCode . "')";
	//exit;
}



//mysql_query("insert into exam (username,datesubmitted,ans1  ,ans2  ,ans3  ,ans4  ,ans5  ,ans6  ,ans7  ,ans8  ,ans9  ,ans10  ,ans11  ,ans12  ,ans13  ,ans14  ,ans15  ,ans16  ,ans17  ,ans18  ,ans19  ,ans20  ,ans21  ,ans22  ,ans23, ans24, ans25) values ('" . $f1 . "',now()," . "'" . $rd_1 . "'," . "'" . $rd_2 . "'," . "'" . $rd_3 . "'," . "'" . $rd_4 . "'," . "'" . $rd_5 . "'," . "'" . $rd_6 . "'," . "'" . $rd_7 . "'," . "'" . $rd_8 . "'," . "'" . $rd_9 . "'," . "'" . $rd_10 . "'," . "'" . $rd_11 . "'," . "'" . $rd_12 . "'," . "'" . $rd_13 . "'," . "'" . $rd_14 . "'," . "'" . $rd_15 . "'," . "'" . $rd_16 . "'," . "'" . $rd_17 . "'," . "'" . $rd_18 . "'," . "'" . $rd_19 . "'," . "'" . $rd_20 . "'," . "'" . $rd_21 . "'," . "'" . $rd_22 . "'," . "'" . $rd_23 . "'," . "'" . $rd_24 . "'," . "'" . $rd_25 . "')");

if ($qidIs == '1')
{
	//echo "update exam set  ans1 = '" . $rd_1 . "' where initialcode = '" . $examId . "'";
	mysql_query("update exam set  ans1 = '" . $rd_1 . "' where initialcode = '" . $examId . "'");
	//exit;
}

//echo "update exam set  ans1 = '" . $rd_1 . "' where initialcode = '" . $examId . "'";

if ($qidIs == '2')
mysql_query("update exam set  ans2 = '" . $rd_2 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '3')
mysql_query("update exam set  ans3 = '" . $rd_3 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '4')
mysql_query("update exam set  ans4 = '" . $rd_4 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '5')
mysql_query("update exam set  ans5 = '" . $rd_5 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '6')
mysql_query("update exam set  ans6 = '" . $rd_6 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '7')
mysql_query("update exam set  ans7 = '" . $rd_7 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '8')
mysql_query("update exam set  ans8 = '" . $rd_8 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '9')
mysql_query("update exam set  ans9 = '" . $rd_9 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '10')
mysql_query("update exam set  ans10 = '" . $rd_10 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '11')
mysql_query("update exam set  ans11 = '" . $rd_11 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '12')
mysql_query("update exam set  ans12 = '" . $rd_12 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '13')
mysql_query("update exam set  ans13 = '" . $rd_13 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '14')
mysql_query("update exam set  ans14 = '" . $rd_14 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '15')
mysql_query("update exam set  ans15 = '" . $rd_15 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '16')
mysql_query("update exam set  ans16 = '" . $rd_16 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '17')
mysql_query("update exam set  ans17 = '" . $rd_17 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '18')
mysql_query("update exam set  ans18 = '" . $rd_18 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '19')
mysql_query("update exam set  ans19 = '" . $rd_19 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '20')
mysql_query("update exam set  ans20 = '" . $rd_20 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '21')
mysql_query("update exam set  ans21 = '" . $rd_21 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '22')
mysql_query("update exam set  ans22 = '" . $rd_22 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '23')
mysql_query("update exam set  ans23 = '" . $rd_23 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '24')
mysql_query("update exam set  ans24 = '" . $rd_24 . "' where initialcode = '" . $examId . "'");

if ($qidIs == '25')
mysql_query("update exam set  ans25 = '" . $rd_25 . "' where initialcode = '" . $examId . "'");




if ($_POST['subme'] == 'PREVIOUS')
{	
	$qidIs--;

}
else
{	
	$qidIs++;

}

 
	//Tally total
	$total = 0;
if ($qidIs == 26) //means we have hit the end of the quiz-view
{

	

$result_0 = mysql_query("select * from exam where  initialcode='" . $examId . "'");
while ($row = mysql_fetch_array($result_0)) {

									$ans1 = $row['ans1'];
									$ans2 = $row['ans2'];
									$ans3 = $row['ans3'];
									$ans4 = $row['ans4'];
									$ans5 = $row['ans5'];
									$ans6 = $row['ans6'];
									$ans7 = $row['ans7'];
									$ans8 = $row['ans8'];
									$ans9 = $row['ans9'];
									$ans10 = $row['ans10'];
									$ans11 = $row['ans11'];
									$ans12 = $row['ans12'];
									$ans13 = $row['ans13'];
									$ans14 = $row['ans14'];
									$ans15 = $row['ans15'];
									$ans16 = $row['ans16'];
									$ans17 = $row['ans17'];
									$ans18 = $row['ans18'];
									$ans19 = $row['ans19'];
									$ans20 = $row['ans20'];
									$ans21 = $row['ans21'];
									$ans22 = $row['ans22'];
									$ans23 = $row['ans23'];
									$ans24 = $row['ans24'];
									$ans25 = $row['ans25'];


}	
echo $ans1 . "**";

$result_1 = mysql_query("select ans_bullet from answers where qid='1' and correct=1");
while ($row = mysql_fetch_array($result_1)) {
    if ($row['ans_bullet'] == $ans1) {
        $total++;
        echo "found<br/>";
    }
    
}

echo "<br/>" . $ans1;

$result_2 = mysql_query("select ans_bullet from answers where qid='2' and correct=1");
while ($row = mysql_fetch_array($result_2)) {
    if ($row['ans_bullet'] == $ans2) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_3 = mysql_query("select ans_bullet from answers where qid='3' and correct=1");
while ($row = mysql_fetch_array($result_3)) {
    if ($row['ans_bullet'] == $ans3) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_4 = mysql_query("select ans_bullet from answers where qid='4' and correct=1");
while ($row = mysql_fetch_array($result_4)) {
    if ($row['ans_bullet'] == $ans4) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_5 = mysql_query("select ans_bullet from answers where qid='5' and correct=1");
while ($row = mysql_fetch_array($result_5)) {
    if ($row['ans_bullet'] == $ans5) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_6 = mysql_query("select ans_bullet from answers where qid='6' and correct=1");
while ($row = mysql_fetch_array($result_6)) {
    if ($row['ans_bullet'] == $ans6) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_7 = mysql_query("select ans_bullet from answers where qid='7' and correct=1");
while ($row = mysql_fetch_array($result_7)) {
    if ($row['ans_bullet'] == $ans7) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_8 = mysql_query("select ans_bullet from answers where qid='8' and correct=1");
while ($row = mysql_fetch_array($result_8)) {
    if ($row['ans_bullet'] == $ans8) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_9 = mysql_query("select ans_bullet from answers where qid='9' and correct=1");
while ($row = mysql_fetch_array($result_9)) {
    if ($row['ans_bullet'] == $ans9) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_10 = mysql_query("select ans_bullet from answers where qid='10' and correct=1");
while ($row = mysql_fetch_array($result_10)) {
    if ($row['ans_bullet'] == $ans10) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_11 = mysql_query("select ans_bullet from answers where qid='11' and correct=1");
while ($row = mysql_fetch_array($result_11)) {
    if ($row['ans_bullet'] == $ans11) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_12 = mysql_query("select ans_bullet from answers where qid='12' and correct=1");
while ($row = mysql_fetch_array($result_12)) {
    if ($row['ans_bullet'] == $ans12) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_13 = mysql_query("select ans_bullet from answers where qid='13' and correct=1");
while ($row = mysql_fetch_array($result_13)) {
    if ($row['ans_bullet'] == $ans13) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_14 = mysql_query("select ans_bullet from answers where qid='14' and correct=1");
while ($row = mysql_fetch_array($result_14)) {
    if ($row['ans_bullet'] == $ans14) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_15 = mysql_query("select ans_bullet from answers where qid='15' and correct=1");
while ($row = mysql_fetch_array($result_15)) {
    if ($row['ans_bullet'] == $ans15) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_16 = mysql_query("select ans_bullet from answers where qid='16' and correct=1");
while ($row = mysql_fetch_array($result_16)) {
    if ($row['ans_bullet'] == $ans16) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_17 = mysql_query("select ans_bullet from answers where qid='17' and correct=1");
while ($row = mysql_fetch_array($result_17)) {
    if ($row['ans_bullet'] == $ans17) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_18 = mysql_query("select ans_bullet from answers where qid='18' and correct=1");
while ($row = mysql_fetch_array($result_18)) {
    if ($row['ans_bullet'] == $ans18) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_19 = mysql_query("select ans_bullet from answers where qid='19' and correct=1");
while ($row = mysql_fetch_array($result_19)) {
    if ($row['ans_bullet'] == $ans19) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_20 = mysql_query("select ans_bullet from answers where qid='20' and correct=1");
while ($row = mysql_fetch_array($result_20)) {
    if ($row['ans_bullet'] == $ans20) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_21 = mysql_query("select ans_bullet from answers where qid='21' and correct=1");
while ($row = mysql_fetch_array($result_21)) {
    if ($row['ans_bullet'] == $ans21) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_22 = mysql_query("select ans_bullet from answers where qid='22' and correct=1");
while ($row = mysql_fetch_array($result_22)) {
    if ($row['ans_bullet'] == $ans22) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_23 = mysql_query("select ans_bullet from answers where qid='23' and correct=1");
while ($row = mysql_fetch_array($result_23)) {
    if ($row['ans_bullet'] == $ans23) {
        $total++;
        echo "found<br/>";
    }
    ;
}
$result_24 = mysql_query("select ans_bullet from answers where qid='24' and correct=1");
while ($row = mysql_fetch_array($result_24)) {
    if ($row['ans_bullet'] == $ans24) {
        $total++;
        echo "found<br/>";
    }
    
}
$result_25 = mysql_query("select ans_bullet from answers where qid='25' and correct=1");
while ($row = mysql_fetch_array($result_25)) {
    if ($row['ans_bullet'] == $ans25) {
        $total++;
        echo "found<br/>";
    }
    
}



	if ($total != 25)
	{
		header("Location: quiz-view.php?qid=1&e=" . $examId . "&t=" . $total );	
		exit;
	}
	else
	{
		header("Location: quiz-close.php?e=" . $examId);	
		exit;
	}
	
	
	
}



mysql_close($con);
header("Location: quiz-view.php?qid=" . $qidIs . "&e=" . $examId );