-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewExamConfig.php
38 lines (29 loc) · 1.03 KB
/
viewExamConfig.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
<?php
include 'connect.php';
if(isset($_POST['submit'])){
$examName=$_POST['examName'];
$courseID=$_POST['courseID'];
$sectionNum=$_POST['sectionNum'];
$studentID=$_POST['studentID'];
$semester=$_POST['semester'];
$year=$_POST['year'];
//Getting section ID from database
$result=mysqli_query($con,"SELECT sec.sectionID AS sectionID
FROM section_t AS sec
WHERE sec.sectionNum='$sectionNum' AND sec.courseID='$courseID'
AND sec.semester='$semester' AND sec.year='$year'");
$row=mysqli_fetch_assoc($result);
$sectionID=$row['sectionID'];
//Getting exam ID from database
$result=mysqli_query($con,"SELECT exam.examID AS examID
FROM exam_t AS exam
WHERE exam.examName='$examName' AND exam.sectionID='$sectionID'");
$row=mysqli_fetch_assoc($result);
$examID=$row['examID'];
//Getting questions from database
$result=mysqli_query($con,"SELECT *
FROM question_t AS q
WHERE q.examID='$examID'");
header('location:submitAnswerScript.php');
}
?>