-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
83 lines (83 loc) · 3.28 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>admission</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.scss">
<style>
#result { font-weight: normal; }
</style>
</head>
<body>
{% set base = '.' %}
{% include template-navbar.html %}
<div class="container py-4">
<div class="row">
<div class="col-sm-6">
<form class="admission">
<div class="form-group row">
<label for="GREScore" class="col-md-4">GRE Score</label>
<input type="number" class="form-control col-md-8" name="GREScore" min="280" max="340">
</div>
<div class="form-group row">
<label for="TOEFLScore" class="col-md-4">TOEFL Score</label>
<input type="number" class="form-control col-md-8" name="TOEFLScore" min="90" max="120">
</div>
<div class="form-group row">
<label for="UniversityRating" class="col-md-4">University Rating</label>
<input type="number" class="form-control col-md-8" name="UniversityRating" min="1" max="5">
</div>
<div class="form-group row">
<label for="SOP" class="col-md-4">SOP</label>
<input type="number" class="form-control col-md-8" name="SOP" step="0.5" min="1" max="5">
</div>
<div class="form-group row">
<label for="LOR" class="col-md-4">LOR</label>
<input type="number" class="form-control col-md-8" name="LOR" step="0.5" min="1" max="5">
</div>
<div class="form-group row">
<label for="CGPA" class="col-md-4">CGPA</label>
<input type="number" class="form-control col-md-8" name="CGPA" step="0.01" min="6" max="10">
</div>
<div class="form-group row">
<label for="Research" class="col-md-4">Research</label>
<select class="form-control col-md-8" name="Research">
<option value="0">0: No</option>
<option value="1">1: Yes</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<div class="col-sm-6 text-center text-middle">
<h1 id="result"></h1>
</div>
</div>
</div><!-- .container-fluid -->
<script src="ui/jquery/dist/jquery.min.js"></script>
<script src="ui/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="ui/lodash/lodash.min.js"></script>
<script src="ui/g1/dist/g1.min.js"></script>
<script>
$('.admission').on('submit', function (e) {
e.preventDefault()
$.getJSON('predict?' + $(this).serialize())
.then(function (results) {
console.log('Results', results)
$('#result').html(
results[0].Admitted ? 'You will <strong class="text-success">be admitted</strong>' : 'You will <strong class="text-danger">not be admitted</strong>'
)
})
.fail(function (xhr) {
console.error(xhr)
$('#result').html('<strong class="text-danger">Error</strong>. Please enter values correctly')
})
})
$('.admission :input').on('change', function () {
$('#result').html('')
})
</script>
</body>
</html>