-
Notifications
You must be signed in to change notification settings - Fork 1
/
new-test.php
65 lines (64 loc) · 3.08 KB
/
new-test.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
<?php
include('faculty-session.php');
?>
<html>
<head>
<title>Tests - WebAES for Faculties</title>
<meta charset='UTF-8'>
<link rel='stylesheet' type='text/css' href='style.css'>
<link href='https://fonts.googleapis.com/css?family=Open Sans' rel='stylesheet'>
</head>
<body>
<header class='header'>
<h2><a class='header-link' href='faculty-home.php'>WebAES - Faculty Home</a></h2>
</header>
<div class='welcome'>
<h4 class='align-right'>Welcome, <?php echo $login_session; ?>   <a href='logout.php'>Log Out</a>   <a href='faculty-home.php'>Home</a></h4>
</div>
<div class='main-content'>
<div class='test-form'>
<h2 class='align-center'>Create new test</h2>
<hr>
<form method='POST' action='create-test.php'>
<label for='test_name'>Test Name</label>
<input type='text' placeholder='Enter test name here...' name='test_name' id='test_name' autocomplete='off' required>
<br>
<label for='question1'>Question 1 ID</label>
<select name='question1' id='question1'>
<?php
$sql = "SELECT question_ID FROM questions";
$result = mysqli_query($db, $sql);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo '<option value="'.$row['question_ID'].'">' . $row['question_ID'] . '</option>';
}
?>
</select>
<br>
<label for='question2'>Question 2 ID</label>
<select name='question2' id='question2'>
<?php
$sql = "SELECT question_ID FROM questions";
$result = mysqli_query($db, $sql);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo '<option value="'.$row['question_ID'].'">' . $row['question_ID'] . '</option>';
}
?>
</select>
<br>
<label for='question3'>Question 3 ID</label>
<select name='question3' id='question3'>
<?php
$sql = "SELECT question_ID FROM questions";
$result = mysqli_query($db, $sql);
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo '<option value="'.$row['question_ID'].'">' . $row['question_ID'] . '</option>';
}
?>
</select>
<br>
<p class='align-center'><button type='submit'>Create</button></p>
</form>
</div>
</div>
</body>
</html>