-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestions.php
48 lines (42 loc) · 1.57 KB
/
questions.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
<?php
session_start();
$pagetitle="questions";
if(isset($_SESSION["user_student"])){
include "in.php";
$course_number=$_GET['course'];
$question_number=$_GET['q_n'];
//get questions
$stmt=mysqli_query($conn,"call getquestions($course_number,$question_number);");
$question=mysqli_fetch_row($stmt);
$conn->next_result();
$stmt->close();
//get total number of question with procedur
$res=mysqli_query($conn,"call numberofquestions($course_number);");
$total=mysqli_num_rows($res);
?>
<main>
<div class="contianer">
<div class="current">Question <?php echo $question[0];?> Of <?php echo $total;?></div>
<h3 class="question">
<?php echo $question[1]; ?>
</h3>
<form action="process.php" method="post">
<ul class="choices">
<li><input type="radio" name="choice" value="<?php echo $question[2]?>" /><?php echo $question[2]?></li>
<li><input type="radio" name="choice" value="<?php echo $question[3]?>" /><?php echo $question[3]?></li>
<li><input type="radio" name="choice" value="<?php echo $question[4]?>" /><?php echo $question[4]?></li>
</ul>
<input type="submit" name="" value="Submit"/>
<input type="hidden" name="number" value="<?php echo $question_number?>" />
<input type="hidden" name="course_number" value="<?php echo $course_number?>" />
</form>
</div>
</main>
<?php
include $tpl."footer.php";
ob_end_flush();
}else{
header("location:login.php");
exit();
}
?>