-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquestion_quiz.php
129 lines (107 loc) · 4.41 KB
/
question_quiz.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
<?php
session_start();
require_once "assets/connect/pdo.php";
if (!isset($_SESSION['Name']) && !isset($_SESSION['Teacher_ID'])) {
header("Location: teacher_Login.php");
return;
}
// Check to see if we have some POST data, if we do process it
if (isset($_POST['submitQuiz'])) {
$Teacher_ID = $_SESSION['Teacher_ID'];
$Course_Code = htmlentities($_POST['Course_Code']);
$Course_Name = htmlentities($_POST['Course_Name']);
$Batch = htmlentities($_POST['Batch']);
$Section = htmlentities($_POST['Section']);
$Title = htmlentities($_POST['Title']);
$Action = htmlentities($_POST['Action']);
$time = htmlentities($_POST['Meeting_Link']);
$sql = "INSERT INTO question_description (Teacher_ID, Course_Code, Course_Name, Batch, Section, Title, Action, Meeting_Link) VALUES ('$Teacher_ID', '$Course_Code','$Course_Name','$Batch','$Section','$Title','$Action', '$time')";
$pdo->exec($sql);
$qId = $pdo->lastInsertId();
header("Location: question_quiz_description.php?id=$qId");
return;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php
//Head Links
require_once 'assets/connect/head.php';
?>
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-light sticky-top">
<div class="container justify-content-start">
<a class="navbar-brand" href="index.php"><img id="logo" src="assets/images/LuExamHiveLogo.png" height="30px"> LU EXAM HIVE</a>
<a type="button" href="teacher_dashboard.php" class="btn btn-sm btn-outline-dark ml-3"><i class="fas fa-arrow-left"></i> Go Back</a>
</div>
</nav>
</header>
<main>
<div class="card text-center bg-light text-dark ">
<div class="card-header bg-primary text-white ">
<h2 class="display-4">Quiz Info</h2>
</div>
<div class="row">
<div class="col"></div>
<div class="col d-flex justify-content-center mt-3">
<p class="">Fill the form below with question informations.</p>
</div>
<div class="col d-flex justify-content-center mt-3">
</div>
</div>
<div class="container col-xl-7 col-lg-7 col-md-7">
<form method="post" class="form-horizontal" action="question_quiz.php">
<div class="form-group input-group input-group-lg">
<label class="control-label col-sm-12 d-flex justify-content-left" for="Course_Code"><b>Course Code:</b></label>
<div class="col">
<input class="form-control" type="text" name="Course_Code" id="Course_Code" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-12 d-flex justify-content-left" for="Course_Name"><b>Course Name:</b></label>
<div class="col">
<input class="form-control" type="text" name="Course_Name" id="Course_Name" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-12 d-flex justify-content-left" for="Batch"><b>Batch:</b></label>
<div class="col">
<input class="form-control" type="text" name="Batch" id="Batch" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-12 d-flex justify-content-left " for="Section"><b>Section:</b></label>
<div class="col">
<input class="form-control" type="text" name="Section" id="Section" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-12 d-flex justify-content-left " for="Title"><b>Title:</b></label>
<div class="col">
<input class="form-control" type="text" name="Title" id="Title">
</div>
</div>
<div class="form-group">
<div class="col">
<input class="form-control" type="hidden" name="Meeting_Link" id="Meeting_Link" value="quiz">
</div>
</div>
<input class="form-control" type="hidden" name="Action" value="quizDraft">
<div class="form-group d-flex justify-content-center ">
<div class="col-sm-4 col-sm-offset-2 p-1">
<input class="btn btn-dark btn-block mb-5" type="submit" name="submitQuiz" value="Save & Proceed">
</div>
</div>
</form>
</div>
</main>
<!--footer Start -->
<?php
require_once 'assets/connect/footer.php';
?>
<!--footer End -->
</body>
</html>