-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinalCS.html
More file actions
354 lines (321 loc) · 12.3 KB
/
finalCS.html
File metadata and controls
354 lines (321 loc) · 12.3 KB
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
var linearGraph=[];
var commandSequence = [];
var rList = []; //container for all recommended nodes at time t
var considerDepth=1; //consider_predicate_not_part_of_syllabus_depth=1
var dList = [];
function handleFileSelect(file_id)
{
if (window.File && window.FileReader && window.FileList && window.Blob) {
} else {
alert('The File APIs are not fully supported in this browser.');
return;
}
input = document.getElementById(file_id);
if (!input) {
alert("Um, couldn't find the fileinput element.");
}
else if (!input.files) {
alert("This browser doesn't seem to support the `files` property of file inputs.");
}
else if (!input.files[0]) {
alert("Please select a file before clicking 'Load'");
}
else {
file = input.files[0];
fr = new FileReader();
fr.onload = receivedText;
fr.readAsText(file);
}
}
function receivedText() {
linearGraph = [];commandSequence=[];rList=[];//empty all global variables
json2graph(fr.result,linearGraph);
dList = depthList(linearGraph);
//intialisation of features,
for(var i=0;i<linearGraph.length;i++){
linearGraph[i].features = initialFeatureExtractor(linearGraph[i],0); //do it for initialisation, few features are dynamic so will change with time
}
}
function handleFileSelect2(file_id)
{
if (window.File && window.FileReader && window.FileList && window.Blob) {
} else {
alert('The File APIs are not fully supported in this browser.');
return;
}
input = document.getElementById(file_id);
if (!input) {
alert("Um, couldn't find the fileinput element.");
}
else if (!input.files) {
alert("This browser doesn't seem to support the `files` property of file inputs.");
}
else if (!input.files[0]) {
alert("Please select a file before clicking 'Load'");
}
else {
file = input.files[0];
fr = new FileReader();
fr.onload = receivedInput;
fr.readAsText(file);
}
}
function receivedInput(){
}
var inputs = document.querySelectorAll( '.inputfile' );
Array.prototype.forEach.call( inputs, function( input )
{
var label = input.nextElementSibling,
labelVal = label.innerHTML;
console.log("triggered");
input.addEventListener( 'change', function( e )
{
var fileName = '';
fileName = e.target.value.split( '\\' ).pop();
if( fileName ){
label.querySelector('span').innerHTML = fileName;
console.log(fileName);
}
else
label.innerHTML = labelVal;
});
});
// File Uploading styling
$(document).on('click', '.browse', function(){
var file = $(this).parent().parent().parent().find('.file');
file.trigger('click');
});
$(document).on('change', '.file', function(){
$(this).parent().find('.form-control').val($(this).val().replace(/C:\\fakepath\\/i, ''));
});
function sem_negative(){
var sem_no = parseInt(document.getElementById("sem_no").value);
if(sem_no > 1){
sem_no = sem_no - 1;
document.getElementById("sem_no").value = sem_no;
}
}
function sem_positive(){
var sem_no = parseInt(document.getElementById("sem_no").value);
sem_no = sem_no + 1;
document.getElementById("sem_no").value = sem_no;
}
</script>
<script src="createSyllabusSupport.js"></script>
<script src="featureExtractor.js"></script>
<script src="naivebayes.js"></script>
<script src="randomForest.js"></script>
<script src="baseLine.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse o-nav">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Syllabus Manager</a>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Recommender System</h3>
</div>
<div class="panel-body">
<div class="col-md-12">
<div class="form-horizontal">
<div class="form-group">
<label for="" class="col-md-5 control-label">Select Course</label>
<input type="file" class="file" id="selectCourse" onchange="handleFileSelect('selectCourse');"/>
<div class="input-group col-md-7">
<input type="text" class="form-control" placeholder="Upload File" readonly>
<span class="input-group-btn">
<button class="browse btn btn-primary" type="button">Browse</button>
</span>
</div>
</div>
<div class="form-group">
<label for="startNode" class="col-md-5 control-label">Syllabus starts at Predicate</label>
<div class="col-md-7">
<input type="text" class="form-control" name = "start" id="startNode">
</div>
</div>
<div class="form-group">
<label for="current" class="col-md-5 control-label">Course covered</label>
<div class="col-md-7">
<input type="text" class="form-control" name="current" id="current" readonly>
</div>
</div>
<div class="form-group">
<label for="" class="col-md-3 control-label">Semester</label>
<div class="col-md-3" style="padding-left: 0px !important">
<input class="form-control" type="number" id="sem_no" value="1" name="" readonly>
</div>
<div class="input-group col-md-6">
<div class="col-md-3">
<button class="btn btn-primary" type="button" onclick="sem_negative()"> -1 </button>
</div>
<div class="col-md-2 col-md-offset-1">
<button class="btn btn-primary" type="button" onclick="sem_positive()"> +1 </button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-heading">
<h3 class="panel-title">Select input json file</h3>
</div>
<div class="panel-body">
<div class="form-group">
<input type="file" class="file" id="fileinput2" onchange="handleFileSelect2('fileinput2');"/>
<div class="input-group col-md-12">
<input type="text" class="form-control" placeholder="Upload File" readonly>
<span class="input-group-btn">
<button class="browse btn btn-primary" type="button">Browse</button>
</span>
</div>
</div>
</div>
<div class="panel-heading">
<h3 class="panel-title">Create Subgraph</h3>
</div>
<div class="panel-body">
<div class="form-group">
<input type="file" class="file" id="fileinput3" onchange="handleFileSelect('fileinput3');"/>
<div class="input-group col-md-12">
<input type="text" class="form-control" placeholder="Upload File" readonly>
<span class="input-group-btn">
<button class="browse btn btn-primary" type="button">Browse</button>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Models</h3>
</div>
<div class="panel-body" style="padding-bottom:15px !important;">
<table class="table table-bordered">
<thead>
<tr>
<th>Alogorithm</th>
<th>Confidence</th>
<th>Accuracy (%)</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><input type="radio" name="algo" value="1" checked> SGD</th>
<td id="c1"></td>
<td id="a1"></td>
</tr>
<tr>
<th scope="row"><input type="radio" name="algo" value="2"> Naive Bayes</th>
<td id="c2"></td>
<td id="a2"></td>
</tr>
<tr>
<th scope="row"><input type="radio" name="algo" value="3"> Random Forest</th>
<td id="c3"></td>
<td id="a3"></td>
</tr>
<tr>
<th scope="row"><input type="radio" name="algo" value="4"> Base Line</th>
<td id="c4"></td>
<td id="a4"></td>
</tr>
</tbody>
</table>
<button class="btn btn-sm btn-primary col-md-5" onclick="init()">Start Recommender</button>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Recommended Predicate </h3>
</div>
<div class="panel-body" style="padding-bottom: 15px !important;">
<div class="form-horizontal">
<div class="form-group">
<label for="recc" class="col-md-5 control-label">Recommended Concept : </label>
<div class="col-md-7">
<input type="text" class="form-control" name="recommendation" id="recc" readonly>
</div>
</div>
<p style="margin-top:2.2em; text-align: center;"><b>Do you like this recommendation :</b></p>
<button class="btn btn-sm btn-primary col-md-5 " id="yesNext" onclick="training(1)">Yes, Next</button>
<button class="btn btn-sm btn-primary col-md-5 pull-right" id="noBetter" onclick="training(0)">No, Do Better</button>
<div style="display:block; clear:both;"> </div>
<button class="btn btn-sm btn-primary col-md-5 " id="yesEnd" onclick="endFunc(1)">Yes, End</button>
<button class="btn btn-sm btn-primary col-md-5 pull-right" id="noEnd" onclick="endFunc(0)">No, End</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Success modal -->
<div id="error_modal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Success. You aced it!</h4>
</div>
<div class="modal-body" style="color: red;">
<div id="error" style="padding-bottom: 10px;font-weight:bold;"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Back</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.Success modal -->
</div>
<div id="error_modal1" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Sorry, No more reccomendations.</h4>
</div>
<div class="modal-body" style="color: red;">
<div id="error1" style="padding-bottom: 10px;font-weight:bold;"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Back</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.Success modal -->
</div>
<div id="error_modal2" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Zapdos Syllabus Manager</h4>
</div>
<div class="modal-body" style="color: red;">
<div id="error2" style="padding-bottom: 10px;font-weight:bold;"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Back</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.Success modal -->
</div>
</body>
</html>