-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror_report_batch.php
307 lines (234 loc) · 12.3 KB
/
error_report_batch.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<?php
session_start();
$studentid = $_SESSION['tid'];
if($studentid==NULL)
{
header('Location: index.php');
}
?>
<?php
header('Content-Type: text/html; charset=UTF-8');
$username = "root";
$bid=$_GET['w1'];
if($bid===NULL)
{
header('location:teacherhome.php');
}
$_SESSION['bid1']=$bid;
$password = "";
$hostname = "localhost";
$db="proj";
$dbhandle = mysqli_connect($hostname, $username, $password,$db)
or die("Unable to connect to MySQL");
mysqli_query($dbhandle,"SET NAMES 'utf8'");
switch($bid)
{
case 'A':
{
$result = mysqli_query($dbhandle,"SELECT error FROM err where sid between '4501' AND '4515' group by error order by count(*) desc");
$row= mysqli_fetch_array($result);
$v1_dash_value=$row['error'];
$result = mysqli_query($dbhandle,"SELECT sid FROM err where sid between '4501' AND '4515' group by sid order by count(*) desc");
$row= mysqli_fetch_array($result);
$v2_dash_value=$row['sid'];
$result = mysqli_query($dbhandle,"select max(compilation) as m from program where sid between '4501' AND '4515'");
$row= mysqli_fetch_array($result);
$comp=$row['m'];
$result = mysqli_query($dbhandle,"select sid from program where sid between '4501' AND '4515' and compilation='$comp'");
$row= mysqli_fetch_array($result);
$sid=$row['sid'];
$v3_dash_value=$row['sid'];
break;
}
case 'B':
{
$result = mysqli_query($dbhandle,"SELECT error FROM err where sid between '4516' AND '4530' group by error order by count(*) desc");
$row= mysqli_fetch_array($result);
$v1_dash_value=$row['error'];
$result = mysqli_query($dbhandle,"SELECT sid FROM err where sid between '4516' AND '4530' group by sid order by count(*) desc");
$row= mysqli_fetch_array($result);
$v2_dash_value=$row['sid'];
$result = mysqli_query($dbhandle,"select max(compilation) as m from program where sid between '4516' AND '4530'");
$row= mysqli_fetch_array($result);
$comp=$row['m'];
$result = mysqli_query($dbhandle,"select sid from program where sid between '4516' AND '4530' and compilation='$comp'");
$row= mysqli_fetch_array($result);
$sid=$row['sid'];
$v3_dash_value=$row['sid'];
break;
}
case 'C':
{
$result = mysqli_query($dbhandle,"SELECT error FROM err where sid between '4531' AND '4545' group by error order by count(*) desc");
$row= mysqli_fetch_array($result);
$v1_dash_value=$row['error'];
$result = mysqli_query($dbhandle,"SELECT sid FROM err where sid between '4531' AND '4545' group by sid order by count(*) desc");
$row= mysqli_fetch_array($result);
$v2_dash_value=$row['sid'];
$result = mysqli_query($dbhandle,"select max(compilation) as m from program where sid between '4531' AND '4545'");
$row= mysqli_fetch_array($result);
$comp=$row['m'];
$result = mysqli_query($dbhandle,"select sid from program where sid between '4531' AND '4545' and compilation='$comp'");
$row= mysqli_fetch_array($result);
$sid=$row['sid'];
$v3_dash_value=$row['sid'];
break;
}
case 'D':
{
$result = mysqli_query($dbhandle,"SELECT error FROM err where sid between '4546' AND '4560' group by error order by count(*) desc");
$row= mysqli_fetch_array($result);
$v1_dash_value=$row['error'];
$result = mysqli_query($dbhandle,"SELECT sid FROM err where sid between '4546' AND '4560' group by sid order by count(*) desc");
$row= mysqli_fetch_array($result);
$v2_dash_value=$row['sid'];
$result = mysqli_query($dbhandle,"select max(compilation) as m from program where sid between '4546' AND '4560'");
$row= mysqli_fetch_array($result);
$comp=$row['m'];
$result = mysqli_query($dbhandle,"select sid from program where sid between '4546' AND '4560' and compilation='$comp'");
$row= mysqli_fetch_array($result);
$sid=$row['sid'];
$v3_dash_value=$row['sid'];
break;
}
case 'E':
{
$result = mysqli_query($dbhandle,"SELECT error FROM err where sid between '4561' AND '4580' group by error order by count(*) desc");
$row= mysqli_fetch_array($result);
$v1_dash_value=$row['error'];
$result = mysqli_query($dbhandle,"SELECT sid FROM err where sid between '4561' AND '4580' group by sid order by count(*) desc");
$row= mysqli_fetch_array($result);
$v2_dash_value=$row['sid'];
$result = mysqli_query($dbhandle,"select max(compilation) as m from program where sid between '4561' AND '4580'");
$row= mysqli_fetch_array($result);
$comp=$row['m'];
$result = mysqli_query($dbhandle,"select sid from program where sid between '4561' AND '4580' and compilation='$comp'");
$row= mysqli_fetch_array($result);
$sid=$row['sid'];
$v3_dash_value=$row['sid'];
break;
}
default:
{
header('Location:teacherhome.php');
}
}
/* $result = mysqli_query($dbhandle,"SELECT error FROM err where sid='$sid' group by error order by count(*) desc");
$row= mysqli_fetch_array($result);
$v1_dash_value=$row['error'];
$result = mysqli_query($dbhandle,"select pid from err where sid='$sid' group by pid order by count(*) desc");
$row= mysqli_fetch_array($result);
$pid=$row['pid'];
$result = mysqli_query($dbhandle,"SELECT pname from program where sid='$sid' and pid='$pid'");
$row= mysqli_fetch_array($result);
$v2_dash_value=$row['pname'];
$result = mysqli_query($dbhandle,"select max(compilation) as m from program where sid='$sid'");
$row= mysqli_fetch_array($result);
$comp=$row['m'];
$result = mysqli_query($dbhandle,"SELECT pname from program where sid='$sid' and compilation='$comp'");
$row= mysqli_fetch_array($result);
$v3_dash_value=$row['pname'];
$result = mysqli_query($dbhandle,"SELECT error from err group by error order by count(*) desc");
$row= mysqli_fetch_array($result);
$v4_dash_value=$row['error'];
$v5_dash_value='View Code';
*/
$v1_dash_text='Most Common Error';
$v2_dash_text='Most no. of errors to which student';
$v3_dash_text='Most no. of compilation by which student';
$v5_dash_text='View Student Statistics';
$v5_dash_value='Codes Performed by each Student in Batch '.$bid;
mysqli_close($dbhandle);
?>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Error Report Batch-wise</title>
<link rel="stylesheet" type="text/css" href="bootstrap.css">
<link rel="script" type="text/javascript" href="bootstrap.js">
<link rel="script" type="text/javascript" href="jquery.js">
<link rel="script" type="text/javascript" href="script.js">
<link rel="stylesheet" href="codemirror.css">
<script src="codemirror.js"></script>
<script src="clike.js"></script>
<link href="dashboard.css" rel="stylesheet">
<link href="demo-styles.css" rel="stylesheet">
<script type="text/javascript" src="validation.js"></script>
<body>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="bootstrap.js"></script>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<!-- Brand and to0ggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Analysis of Errors</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li ><a href="teacherhome.php">Teacher Home</a></li>
<li class="active" ><a href="#">Error Report</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Account<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="logout.php">Logout</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Solution<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="AddSoln.php">Add Solution</a></li>
<li><a href="ModifySoln.php">Modify Solution</a></li>
<li><a href="DelSoln.php">Delete Solution</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<br><br><br>
<div class="dashboard clearfix">
<ul class="tiles">
<div style="margin-left: 2.5%">
<div class="col11 clearfix">
<li class="tile tile-big tile-1 slideTextUp" data-page-type="r-page" data-page-name="random-r-page">
<div><p style="font-size:40px;"><span id="t1"><?php echo $v1_dash_text ?></span></p></div>
<div><p style="font-size:20px;"><span id="v11"><?php echo $v1_dash_value ?></span></p></div>
</li>
</div>
<div class="col21 clearfix">
<li class="tile tile-big tile-6 slideTextLeft" data-page-type="r-page" data-page-name="random-r-page">
<div><p style="font-size:30px;"><span id="t2"><?php echo $v2_dash_text ?></span></p></div>
<div><p style="font-size:60px;"><span id="v22"><?php echo $v2_dash_value ?></span></p></div>
</li>
</div>
<div class="col31 clearfix">
<li class="tile tile-big tile-2 slideTextUp" data-page-type="r-page" data-page-name="random-r-page">
<div><p style="font-size:36px;"><span id="t3"><?php echo $v3_dash_text ?></span></p></div>
<div><p style="font-size:72px;"><span id="v33"><?php echo $v3_dash_value ?></span></p></div>
</li>
</div>
</div>
<div class="col4 clearfix">
<div style="margin-right: 2.5%">
<li class="tile tile-big tile-11 slideTextUp" data-page-type="r-page" data-page-name="random-r-page">
<a href="codeperformance.php" style="color: white">
<div><p style="font-size:40px;"><span id="t5"><?php echo $v5_dash_text ?></span></p></div>
<div><p style="font-size:40px;"><span id="v55"><?php echo $v5_dash_value ?></span></p></div>
</a></li>
</div>
</div>
</ul>
</div><!--end dashboard-->
</body></html>