-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamhall.php
More file actions
106 lines (101 loc) · 3.57 KB
/
examhall.php
File metadata and controls
106 lines (101 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
include 'lib/Session.php';
Session::checkuserSession();
include('includes/header1.php');
include('includes/menu.php');
?>
<?php
$userid = Session::get('uid');
if(!isset($_GET['egid'],$_GET['gtok'])){
echo "<script>window.location='userdashboard.php'</script>";
}else{
$egid = $_GET['egid'];
$gtok = $_GET['gtok'];
}
$_SESSION['answers'] = array();
$_SESSION['quid'] = array();
?>
<div class="container bg-light-gray">
<div class="main-content">
<div class="featured-content">
<div class="row-fluid">
<div class="span8 offset3">
<?php
$dt = new DateTime('now', new DateTimeZone('Europe/London'));
$st = $dt->format('Y-m-d H:i:s');
$result = $us->detailsuserexamgroup($egid,$gtok);
if($result){
$value = $result->fetch_assoc();
$totalext = $value['examRunningTime'];
$datatime1 = $value['startingTime'];
$datatime = new DateTime($datatime1, new DateTimeZone('Europe/London'));
$dt = new DateTime($datatime1, new DateTimeZone('Europe/London'));
$dt1 = $dt->format('Y-m-d H:i:s');
$datatime->add(new DateInterval('P0M0DT0H'.$totalext.'M0S'));
$newtime = $datatime->format('Y-m-d H:i:s');
}
?>
<h2>Some Information : </h2>
<p class="hgad">1. Exam Starting Time: <strong><?php echo $fm->DateFormat($dt1);?></strong></p>
<p>2. Current Time: <strong><?php echo $fm->DateFormat($st);?></strong></p>
<p>3. Exam Will Be Conitnue: <strong><?php echo $fm->DateFormat($newtime);?></strong></p>
<p>4. Total Question: <strong><?php echo $value['totalExamShowQues']; ?></strong></p>
<?php
$ttime = $value['totalExamShowQues'] * $value['eachQuestionTime'];
$tq = $value['totalExamShowQues'];
?>
<?php
$mi = (int) ($ttime / 60);
$se = $ttime % 60;
?>
<p>5. Time For Exam: <strong><?php echo $mi." Minutes ".$se." Seconds"; ?></strong></p>
<h2>Some Rules : </h2>
<p><strong> Once you start your exam,you cannot go back to the previous question.</strong></p>
</div>
</div>
<?php
$ecv='';
$q=0;
$fiquestion = $qs->checkminimumcondition($egid);
if($fiquestion){
while ($fqvalue = $fiquestion->fetch_assoc()) {
$q++;
}
}
$che = $us->checkexamcondition($egid,$userid);
if($che){
$cvalue = $che->fetch_assoc();
$ecv = $cvalue['econdition'];
}
$getque = $qs->getquestionbygroup($egid,$gtok,$tq);
if($getque){
while ($value=$getque->fetch_assoc()) {
$questions[] = $value;
}
}
if(isset($questions)){
$_SESSION['questionid'] = $questions;
}
?>
<div class="row-fluid">
<div class="span8 offset2 text-center">
<?php
if($ecv==1 || $ecv==2){
echo "<button class='btn btn-primary esb'>You Already Finished Your Exam</button>";
}
elseif($tq>$q){
echo "<button class='btn btn-primary esb'>Minimum Questions Is Not Set</button>";
}
elseif($st==$dt1 || $st>$dt1){ ?>
<a href="questionpaper.php?exgid=<?php echo $egid ;?>&egtok=<?php echo $gtok;?>&ttime=<?php echo $ttime;?>&toque=<?php echo $tq; ?>"><button class="btn btn-primary esb">Start Exam</button></a>
<?php } else{?>
<button class="btn" style="background-color: purple;color: white">Exam Not Start</button></a>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<?php
include('includes/footer.php');
?>