'updated_pages'

parent 415c3f40
<?php
if(!isset($_SESSION['student']))
{
header('location:'.SITEURL.'index.php?page=login');
; }
?>
\ No newline at end of file
<!--Body Starts Here-->
<div class="main">
<div class="content">
<div class="report">
<?php
if(isset($_SESSION['USERID']))
{
$student_id=$_SESSION['USERID'];
$full_name=$obj->get_fullname('tbl_student',$student_id,$conn);
echo "<h2>".$full_name."'s Result</h2>";
}
else
{
header('location:'.SITEURL.'index.php?page=logout');
}
$added_date=date('Y-m-d');
//Now Getting VAlues Based on aded date and student id
$tbl_name="tbl_result";
$where="student_id='$student_id' && added_date='$added_date'";
$query=$obj->select_data($tbl_name,$where);
$res=$obj->execute_query($conn,$query);
$sn=1;
while($row=$obj->fetch_data($res))
{
$student_id=$row['student_id'];
$question_id=$row['question_id'];
$user_answer=$row['user_answer'];
$right_answer=$row['right_answer'];
$added_date=$row['added_date'];
//Get all the question and answers detail
$tbl_name2="tbl_question";
$where2="question_id='$question_id'";
$query2=$obj->select_data($tbl_name2,$where2);
$res2=$obj->execute_query($conn,$query2);
$row2=$obj->fetch_data($res2);
$question=$row2['question'];
$first_answer=$row2['first_answer'];
$second_answer=$row2['second_answer'];
$third_answer=$row2['third_answer'];
$fourth_answer=$row2['fourth_answer'];
$fifth_answer=$row2['fifth_answer'];
$reason=$row2['reason'];
?>
<label style="font-weight: bold;"><?php echo $sn++.'. '.$question; ?></label><br />
<?php
//To get usersAnswer
switch($user_answer)
{
case 0:
{
$userAnswer="None";
}
break;
case 1:
{
$userAnswer=$first_answer;
}
break;
case 2:
{
$userAnswer=$second_answer;
}
break;
case 3:
{
$userAnswer=$third_answer;
}
break;
case 4:
{
$userAnswer=$fourth_answer;
}
break;
case 5:
{
$userAnswer=$fifth_answer;
}
break;
}
//To get rightAnswer
switch($right_answer)
{
case 0:
{
$rightAnswer="None";
}
break;
case 1:
{
$rightAnswer=$first_answer;
}
break;
case 2:
{
$rightAnswer=$second_answer;
}
break;
case 3:
{
$rightAnswer=$third_answer;
}
break;
case 4:
{
$rightAnswer=$fourth_answer;
}
break;
case 5:
{
$rightAnswer=$fifth_answer;
}
break;
}
?>
<label>Users Answer: </label>
<?php
if($userAnswer==$rightAnswer)
{
?>
<label style="color: green;"><?php echo $userAnswer; ?></label>
<?php
}
else
{
?>
<label style="color: red;"><?php echo $userAnswer; ?></label>
<?php
}
?>
<br />
<label>Correct Answer:</label><label style="color: green;"><?php echo $rightAnswer; ?></label><br />
<?php
if($reason!="")
{
echo "<div class='success'>".$reason."</div>";
}
?>
<hr />
<?php
}
?>
<a href="<?php echo SITEURL; ?>index.php?page=logout">
<button type="button" class="btn-exit">Log Out</button>
</a>
</div>
</div>
</div>
<!--Body Ends Here-->
\ No newline at end of file
<?php
include('check.php');
//Inserting Summary Result Here
if(isset($_SESSION['totalScore']))
{
$totalScore=$_SESSION['totalScore'];
}
else
{
$totalScore=0;
}
//To get student id from student username
$tbl_name="tbl_student";
$username=$_SESSION['student'];
$student_id=$obj->get_userid($tbl_name,$username,$conn);
//to add sesult summary to the database
$added_date=date('Y-m-d');
$tbl_name2="tbl_result_summary";
$data="student_id='$student_id',
marks='$totalScore',
added_date='$added_date'
";
$query=$obj->insert_data($tbl_name2,$data);
$res=$obj->execute_query($conn,$query);
?>
<!--Body Starts Here-->
<div class="main">
<div class="content">
<div class="welcome">
<?php
if(isset($_SESSION['time_complete']))
{
echo $_SESSION['time_complete'];
}
?>
You have successfully completed the test. Thank You.<br />
<?php
$tbl_name='tbl_student';
$username=$_SESSION['student'];
//Get Student ID from username
$userid=$obj->get_userid($tbl_name,$username,$conn);
//Getting Summary Result from the database
$tbl_name3="tbl_result_summary";
$where3="student_id=$userid ORDER BY summary_id DESC LIMIT 1";
$query=$obj->select_data($tbl_name3,$where3);
$res=$obj->execute_query($conn,$query);
$row=$obj->fetch_data($res);
$marks=$row['marks'];
$added_date=date('Y-m-d');
//Calculate Marks for different faculties
$obtainedMarks=$_SESSION['totalScore'];
$full_marks=$_SESSION['full_marks'];
$obtainedPercent=($obtainedMarks/$full_marks)*100;
//Get Student ID
//Get Faculty ID from Student ID then Show full marks based on the faculty and obtained percentage
if($_SESSION['facultyName']=='GRE')
{
$marksShown=260+round($obtainedPercent*0.8);
}
elseif($_SESSION['facultyName']=='GMAT')
{
$marksShown=200+round($obtainedPercent*6);
}
else
{
$marksShown=$obtainedMarks;
}
$_SESSION['USERID']= $userid;
//Round Off Marks
$lastDigit=substr($marksShown,-1);
if($lastDigit<5)
{
$realMark=$marksShown-$lastDigit;
}
else
{
$digitToAdd=10-$lastDigit;
$realMark=$marksShown+$digitToAdd;
}
?>
You got <h2><?php echo $realMark; ?></h2>
<a href="<?php echo SITEURL; ?>index.php?page=detail_result">
<button type="button" class="btn-exit">
View Result
</button>
</a>
<a href="<?php echo SITEURL; ?>index.php?page=logout">
<button type="button" class="btn-exit">&nbsp; Log Out &nbsp;</button>
</a>
</div>
</div>
</div>
<!--Body Ends Here-->
\ No newline at end of file
<!--Body Starts Here-->
<div class="main">
<div class="login">
<form method="post" action="">
<style type="text/css">
.img {
display: block;
margin-left: auto;
margin-right: auto;
border: 10px solid #ddd;
border-radius: 250px;
}
</style>
<img class="img"src="boy.jpg" alt="Paris" style="width:82%">
<h2>User | Log In</h2>
<?php
if(isset($_SESSION['invalid']))
{
echo $_SESSION['invalid'];
unset($_SESSION['invalid']);
}
?>
<input type="text" name="username" placeholder="Username" required="true" />
<input type="password" name="password" placeholder="Password" required="true" />
<input type="submit" name="submit" value="Log In" class="btn-go" />
<input type="reset" name="reset" value="Reset" class="btn-exit" />
</form>
<?php
if(isset($_POST['submit']))
{
//echo "CLicked";
//Get Values from forms
$username=$obj->sanitize($conn,$_POST['username']);
$password=$obj->sanitize($conn,$_POST['password']);
//Check Login
$tbl_name="tbl_student";
$where="username='$username' && password='$password' && is_active='yes'";
$query=$obj->select_data($tbl_name,$where);
$res=$obj->execute_query($conn,$query);
$count_rows=$obj->num_rows($res);
if($count_rows>0)
{
$_SESSION['student']=$username;
$_SESSION['login']="<div class='success'>Login Successful.</div>";
header('location:'.SITEURL.'index.php?page=welcome');
}
else
{
$_SESSION['invalid']="<div class='error'>Username or Password is invalid.</div>";
header('location:'.SITEURL.'index.php?page=login');
}
}
?>
</div>
</div>
<!--Body Ends Here-->
\ No newline at end of file
<?php
if(isset($_GET['page']))
{
$page=$_GET['page'];
}
else
{
$page='welcome';
}
switch($page)
{
case "welcome":
{
include('welcome.php');
}
break;
case "question":
{
include('question.php');
}
break;
case "login":
{
include('login.php');
}
break;
case "endSession":
{
include('endSession.php');
}
break;
case "detail_result":
{
include('detail_result.php');
}
break;
case "logout":
{
/*
if(isset($_SESSION['totalScore']))
{
$totalScore=$_SESSION['totalScore'];
}
else
{
$totalScore=0;
}
//To get student id from student username
$tbl_name="tbl_student";
$username=$_SESSION['student'];
$student_id=$obj->get_userid($tbl_name,$username,$conn);
//to add sesult summary to the database
$added_date=date('Y-m-d');
$tbl_name2="tbl_result_summary";
$data="student_id='$student_id',
marks='$totalScore',
added_date='$added_date'
";
$query=$obj->insert_data($tbl_name2,$data);
$res=$obj->execute_query($conn,$query);
*/
$tbl_name="tbl_student";
$username=$_SESSION['student'];
$student_id=$obj->get_userid($tbl_name,$username,$conn);
$res=true;
if($res==true)
{
//Setting Student Is_Active Mode to No
$tbl_name3="tbl_student";
$data3="is_active='no'";
$where3="student_id='$student_id'";
$query3=$obj->update_data($tbl_name3,$data3,$where3);
$res3=$obj->execute_query($conn,$query3);
if($res3===true)
{
session_destroy();
header('location:'.SITEURL.'index.php?page=login');
}
else
{
echo "Error";
}
}
else
{
echo "Error";
}
}
break;
default:
{
include('welcome.php');
}
break;
}
?>
\ No newline at end of file
This diff is collapsed.
User-Agent: *
User-agent: Googlebot
Disallow: /cgi-bin/
Disallow: /admin/
Disallow: /assets/
\ No newline at end of file
<?php
if(isset($_SESSION['end_time']))
{
$current_time=date('h:i:s A');
$start=strtotime($current_time);
$end=strtotime($_SESSION['end_time']);
if($start>$end)
{
$_SESSION['time_complete']="<div class='error'>Your exam time has ended. Thank You.</div>";
header('location:'.SITEURL.'index.php?page=endSession');
echo "session end";die();
}
}
?>
\ No newline at end of file
<?php
include('check.php');
?>
<!--Body Starts Here-->
<div class="main">
<div class="content">
<div class="welcome">
<?php
if(isset($_SESSION['login']))
{
echo $_SESSION['login'];
unset($_SESSION['login']);
}
//Setting Time Limit Here
if(!isset($_SESSION['start_time']))
{
//$_SESSION['start_time']=
}
?>
Hello <span class="heavy"><?php echo $_SESSION['student']; ?></span>. Welcome to Test Preparation Portal.<br />
<div class="success">
<p style="text-align: left;">
Here are some of the rules and regulations of this app.<br />
1. This test is automated and you won't be able to return to previous question.<br />
2. Once you successfully login, you can't log back in unless the permission of system administrator.<br />
3. After you click on "Take a Test", the timer will start and it can't be paused or stopped.<br />
4. English questions will appear first and after you finish Englihs, you will be given Math question.
</p>
</div>
<a href="<?php echo SITEURL; ?>index.php?page=question">
<button type="button" class="btn-go">Take a Test</button>
</a>
<a href="<?php echo SITEURL; ?>index.php?page=logout">
<button type="button" class="btn-exit">&nbsp; Quit &nbsp;</button>
</a>
</div>
</div>
</div>
<!--Body Ends Here-->
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment