-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfirm.php
206 lines (173 loc) · 6.05 KB
/
confirm.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once ('Auth_staff.php');
session_start();
$auth = new Auth_staff();
if (!isset($_SESSION['user_id']))
{
//Not logged in, send to login page.
header( 'Location: login.php' );
}
else
{
//Check we have the right user
$logged_in = $auth->checkSession();
if(empty($logged_in)){
//Bad session, ask to login
$auth->logout();
header( 'Location: login.php' );
}
else
{
//User is logged in, show the page
?>
<?php
//error_reporting(E_ALL);
//ini_set('display_errors','1');
session_start();
?>
<!DOCTYPE html>
<! The Staff starts the test making process on this page >
<html>
<head>
<title>ACES : HOME</title>
<!-- Include the bootstrap stylesheets -->
<link rel="stylesheet" href="bootstrapnew.css"
</head>
<body>
<!-- Navbar
================================================== -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="C:\Users\sowmya\Desktop\demo\boot.html">AMRITA</a>
<div class="nav-collapse" id="main-menu">
<ul class="nav" id="main-menu-left">
<li><a onclick="pageTracker._link(this.href); return false;" href="http://news.bootswatch.com">News</a></li>
<li><a id="swatch-link" href="gallery.html">Gallery</a></li>
</ul>
<ul class="nav pull-right" id="main-menu-right">
<Li> <form class="navbar-search pull-left">
<input type="text" class="search-query span2" placeholder="Search">
</form></Li>
<li><a rel="tooltip" href="#"><?php echo date("d.m.Y") ;?> <i class="icon-share-alt"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="container">
<p> </p>
<h1 style="font-size:46px" align="center" > </h1>
<h1 style="font-size:46px" align="center" > </h1>
<h1 style="font-size:46px" align="center" >ACES</h1>
<h4 align="center"> Automated Code Evaluation System</h4>
<p>........................................................................................................................................................................................................................................</p>
<h6 align="left">AMRITA SCHOOL OF ENGINEERING</h6>
<h6 align="left" >COIMBATORE <small></h6>
<!-- Forms
================================================== -->
<section id="forms">
<div class="page-header">
<h1> Test Details</h1>
</div>
<?php
/*error_reporting(E_ALL);
ini_set('display_errors','1');
session_start();*/
?>
<div class="row">
<div class="span10 offset1">
<form class="form-horizontal well" action="enterques.php" method="POST">
<fieldset>
<legend >Enter the following details</legend>
<div class="control-group">
<label class="control-label"> Question ID : <?php echo $_POST['ques_id']?> </label>
</div>
<div class="control-group">
<label class="control-label" for="i02"> Question : <?php echo $_POST['ques']?></label>
</div>
<div class="control-group">
<label class="control-label"> Max_marks : <?php echo $_POST['max_marks']?></label>
</div>
<div class="control-group">
<label class="control-label"> Neg_marks : <?php echo $_POST['neg_marks']?></label>
</div>
<div class="control-group">
<label class="control-label"> Number of options : <?php echo $_POST['option_number']?></label> <br/>
</div>
<div class="control-group">
<label class="control-label"> Option values : </label><br />
<?php
// option number generated by concatening ques_id and a int
$ques_pool=array();
array_push($ques_pool,$_POST['ques_id'],$_POST['ques'],$_POST['max_marks'],$_POST['neg_marks']); // answer has to be put in the array
$num=$_POST['option_number'];
$id=$_POST['ques_id'];
$option_feed=array();
$a=1;
for($i=1;$i<=$num;$i++)
{ $j= $id.$i;
array_push($option_feed, $j);
$g=$a.$j;
//echo '..'.$g.'..';
?>
<br/>
<label> Option <?php echo $i ?> </label>
<input type="text" name="<?php echo $g; ?>" > <br />
<?php
}
?>
<label> Enter correct answer</label>
<p>
<table>
<?php
for($i=1;$i<=$num;$i++)
{ $k= $id.$i;
?>
<tr>
<td align="center"> <p> <input type="radio" name="ans" value="<?php echo $i ?>" /><?php echo 'Option'.$i ?> </p></td>
</tr>
<?php
}
?>
</table>
</p>
<?php
$_SESSION['ques_pool']=implode(",",$ques_pool);
$_SESSION['option_feed']=implode(",",$option_feed);
//echo $_SESSION['ques_pool']; ?> <br />
<?php
//echo $_SESSION['option_feed'];
?>
</div>
<div class="form-actions">
<input type="submit" class="btn btn-primary" name="submit" value="Enter question"/>
<button type="submit" name="goback" formaction="enter_pool.php" > Edit </button>
</div>
</fieldset>
</form>
</div>
</div>
</section>
<!-- Footer
================================================== -->
<hr>
<footer id="footer">
<p class="pull-right"><a href="pool.php">Back to top</a></p>
<div class="links"></div>
Made by <a href="http://www.amrita.edu">Amrita</a>. Contact him <a href="mailto:amrita.edu">hello@admin_asec</a>.<br/>
Based on <a target="_blank" href="http://twitter.github.com/bootstrap/">Bootstrap</a>. Icons from <a target="_blank" href="http://glyphicons.com/">Glyphicons</a>. Web fonts from <a target="_blank" href="http://www.google.com/webfonts">Google</a>.</p>
</footer>
</body>
</html>
<?php
}}
?>