-
Notifications
You must be signed in to change notification settings - Fork 0
/
all-exam-for-student.php
148 lines (135 loc) · 11.5 KB
/
all-exam-for-student.php
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php include ("student-header.php");?>
<section class="feature_part">
<div class="container">
<div class="row">
<div class="col-sm-12 col-xl-12 text-center" style="padding: 50px 0px;">
<div class="single_feature_text ">
<h2>Live Exam</h2>
<p></p>
</div>
</div>
</div>
<div class="row" style="padding-bottom: 50px;">
<?php
// student session start
$username = $_SESSION['username'];
$select_student=query("SELECT * FROM `students` where email='$username' ");
$fetch_student=fetch_array($select_student);
$studentID = $fetch_student['id'];
// student session end
$query = query("SELECT * FROM `exam` WHERE action='SHOW' AND examStatus='Temporary' ORDER BY id DESC");
confirm($query);
$rows = mysqli_num_rows($query);
if($rows > 0)
{
$i = 1;
while($row = fetch_array($query))
{
$scheduleDate = $row['scheduleDate'];
$scheduleTime = $row['scheduleTime'];
$examStartingStatus = $row['StartingAction'];
$courseID=$row['courseID'];
// $query_course = query("SELECT * FROM `course` WHERE action='SHOW' AND id='$courseID'");
// $batchID = fetch_array($query_course);
$checkBatchQuery = query("SELECT * FROM studentBatch WHERE studentID='$studentID' AND batchID='$courseID'");
confirm($checkBatchQuery);
$rowOfStuBatch = fetch_array($checkBatchQuery);
$batchAccess = $rowOfStuBatch['batchID'];
if(!empty($batchAccess)){
?>
<div class="col-md-4">
<div class="single_feature">
<div class="single_feature_part">
<h4><?php echo $row['name'];?></h4>
<hr>
<div class="row">
<div class="col-md-6 col-6">
<b class="text-primary"></b><?php echo date('j M, Y', strtotime($row['scheduleDate'])); ?>
</div>
<div class="col-md-6 col-6">
<?php echo date("g:i a", strtotime($row['scheduleTime']));?>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6 col-6">
<b class="text-primary">Total Mark:</b> <?php echo $row['total_mark'];?>
</div>
<div class="col-md-6 col-6">
<b class="text-primary">Pass Mark:</b> <?php echo $row['passed_mark'];?>
</div>
</div>
<hr>
<div class="row">
<?php
date_default_timezone_set("Asia/Dhaka");
if(date("Y/m/d") >= $row['scheduleDate'] && strtotime(date("h:i:sa")) >= strtotime($row['examEndTime'])){
?>
<div class="col-md-12 col-12">
<?php
$examID = $row['id'];
$Stquery = query("SELECT * FROM students WHERE email = '" . $_SESSION['username'] . "'");
confirm($Stquery);
$row_of_st = fetch_array($Stquery);
$studentID = $row_of_st['id'];
$checkQuery = query("SELECT * FROM resultForPermanentExam WHERE examID='$examID' AND studentID='$studentID'");
confirm($checkQuery);
$rowOfResult = fetch_array($checkQuery);
$DBexamID = $rowOfResult['examID'];
if(!empty($DBexamID)){
?>
<a href="result.php?examID=<?php echo $DBexamID?>" class="btn bg-warning form-control">See Result</a>
<?php
}
else{
?>
<a href="exam-end-questions.php?examID=<?php echo $row['id']?>" class="btn_4">See Questions</a>
<?php
}
?>
</div>
<?php
}
else if(date("Y/m/d") >= $row['scheduleDate'] && strtotime(date("h:i:sa")) >= strtotime($row['examEndTime'])){
?>
<div class="col-md-12 col-12">
<?php
$examID = $row['id'];
$Stquery = query("SELECT * FROM students WHERE email = '" . $_SESSION['username'] . "'");
confirm($Stquery);
$row_of_st = fetch_array($Stquery);
$studentID = $row_of_st['id'];
$checkQuery = query("SELECT * FROM resultForPermanentExam WHERE examID='$examID' AND studentID='$studentID'");
confirm($checkQuery);
$rowOfResult = fetch_array($checkQuery);
$DBexamID = $rowOfResult['examID'];
if(!empty($DBexamID)){
?>
<a href="result.php?examID=<?php echo $DBexamID?>" class="btn bg-warning form-control">See Result</a>
<?php
}
else{
?>
<a href="exam-question-for-student.php?examID=<?php echo $row['id']?>" class="btn_4">Start Exam</a>
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
<!--</div>-->
</div>
</div>
<?php
}
$i++;
}
}
?>
</div>
</div>
</section>
<?php include ("student-footer.php");?>