-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
246 lines (223 loc) · 8.27 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>TCP/IP成績查詢</title>
<link rel="shortcut icon" type="image/x-icon" href="http://zinggadget.com/wp-content/uploads/2015/11/apple-7.jpg">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.css">
<link rel="stylesheet" href="css/index.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.js"></script>
</head>
<body>
<div class="ui middle aligned center aligned grid" id="input-form">
<div class="column">
<div class="ui inverted dimmer" id="dimm">
<div class="ui text loader">Loading</div>
</div>
<h2 class="ui teal image header">
<div class="content">
TCP/IP成績查詢
</div>
</h2>
<form class="ui large form">
<div class="ui stacked segment">
<div class="field">
<div class="ui left icon input">
<i class="user icon"></i>
<input type="text" id="numberInput" placeholder="學號">
</div>
</div>
<input class="ui fluid large teal submit button" type="button" value="查詢" onclick="Search()">
<!-- <div class="ui fluid large teal submit button">Login</div> -->
</div>
<div class="ui error message"></div>
</form>
</div>
</div>
<div id="point-tables" style="display: none; padding-top: 5%">
<h2 class="ui center aligned icon header">
<i id="uicon" class="circular user icon"></i>
<i id="uicon2" class="green thumbs up icon" style="display: none;"></i>
<i id="uicon3" class="red frown icon" style="display: none"></i>
<div id="nameId"></div>
<div id="type"></div>
</h2>
<p></p>
<div id="final-table" class="ui container" style="display: none; padding-top: 1%">
<h2 class="ui centered header">期末總成績</h2>
<table class="ui very padded inverted table">
<thead>
<tr class="center aligned">
<th>分數</th>
<th>配分</th>
</tr>
</thead>
<tbody>
<tr>
<td class="finalPoint center aligned" style="color:aqua; font-size:30px"></td>
<td class="center aligned">作業每個6.25% 考試每次25%</td>
</tr>
</tbody>
</table>
</div>
<div id="final-table2" class="ui container" style="display: none; padding-top: 1%">
<h2 class="ui centered header">期末總成績</h2>
<table class="ui very padded inverted table">
<thead>
<tr class="center aligned">
<th>分數</th>
<th>配分</th>
</tr>
</thead>
<tbody>
<tr>
<td class="finalPoint center aligned" style="color:red; font-size:30px"></td>
<td class="center aligned">作業每個6.25%,考試每次25%</td>
</tr>
</tbody>
</table>
</div>
<p></p>
<div id="hw-table" class="ui container">
<h2 class="ui centered header">作業分數</h2>
<table class="ui very padded olive table">
<thead>
<tr class="center aligned">
<th>作業</th>
<th>分數</th>
<th>備註</th>
</tr>
</thead>
<tbody>
<tr>
<td class="center aligned">作業1</td>
<td id="hw1" class="center aligned" ></td>
<td id="ps1" class="center aligned"></td>
</tr>
<tr>
<td class="center aligned">作業2</td>
<td id="hw2" class="center aligned"></td>
<td id="ps2" class="center aligned"></td>
</tr>
<tr>
<td class="center aligned">作業3</td>
<td id="hw3" class="center aligned"></td>
<td id="ps3" class="center aligned"></td>
</tr>
<tr>
<td class="center aligned">作業4</td>
<td id="hw4" class="center aligned"></td>
<td id="ps4" class="center aligned"></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<div class="ui raised very padded text container">
<h2 class="ui centered header">考試分數</h2>
<table class="ui centered violet table">
<thead>
<tr class="center aligned">
<th>考試</th>
<th>分數</th>
</tr>
</thead>
<tbody>
<tr class="center aligned">
<td>期中考1</td>
<td id="t1"></td>
</tr>
<tr class="center aligned">
<td>期中考2</td>
<td id="t2"></td>
</tr>
<tr class="center aligned">
<td>期末考</td>
<td id="t3"></td>
</tr>
</tbody>
</table>
</div>
</div>
<p></p>
<p></p>
<script type="text/javascript">
function Search(){
var root = document.getElementById("dimm");
if(document.getElementById("numberInput").value === "") {
alert("請輸入學號");
return;
}
root.classList.add('active');
$.get("https://script.google.com/macros/s/AKfycbwOQRvM8Ijm9Ipmp87BdAHKg1RWcuEn_4vDwubfKbKJGMEVRRM/exec", {
"id": document.getElementById("numberInput").value
},
function (data) {
// console.log(data);
var arr = data.split(",");
var obj = { //h: homework, ps: 備註, t: 考試
id: arr[0], //學號
name: arr[1], //姓名
h1: arr[2],
ps1: arr[3],
h2: arr[4],
ps2: arr[5],
h3: arr[6],
ps3: arr[7],
h4: arr[8],
ps4: arr[9],
t1: arr[10],
t2: arr[11],
t3: arr[12],
final: arr[13], //final 期末總成績
};
var root = document.getElementById("dimm");
root.classList.remove('active');
document.getElementById("input-form").style.display = "none";
document.getElementById("nameId").innerHTML = obj.id + " " + obj.name;
document.getElementById("hw1").innerHTML = obj.h1;
document.getElementById("ps1").innerHTML = obj.ps1;
document.getElementById("hw2").innerHTML = obj.h2;
document.getElementById("ps2").innerHTML = obj.ps2;
document.getElementById("hw3").innerHTML = obj.h3;
document.getElementById("ps3").innerHTML = obj.ps3;
document.getElementById("hw4").innerHTML = obj.h4;
document.getElementById("ps4").innerHTML = obj.ps4;
document.getElementById("t1").innerHTML = obj.t1;
document.getElementById("t2").innerHTML = obj.t2;
document.getElementById("t3").innerHTML = obj.t3;
document.getElementsByClassName("finalPoint")[0].innerHTML = obj.final;
document.getElementsByClassName("finalPoint")[1].innerHTML = obj.final;
document.getElementById("point-tables").style.display = "block";
// alert(obj.id);
console.log(obj);
// document.write("--------------------------<br>");
// document.write("No.,Name,Score <br>"+data+"<br>");
// document.write("--------------------------<br>");
if(obj.final != '') {
setTimeout(function() {
$('#uicon')
.transition('fade up', '1000ms')
;
if(parseInt(obj.final) >= 70) {
$('#uicon2').transition('browse', '1000ms');
$('#final-table').transition('swing down', '1000ms');
document.getElementById("type").innerHTML = "及格";
document.getElementById("type").style.color = "green";
} else {
$('#uicon3').transition('browse', '1000ms');
$('#final-table2').transition('swing down', '1000ms');
document.getElementById("type").innerHTML = " 不及格";
document.getElementById("type").style.color = "red";
}
}, 1000
);
}
});
}
</script>
</body>
</html>