-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmark.js
31 lines (31 loc) · 852 Bytes
/
mark.js
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
$( function(){
$itemlist = $("table#dgrdList tr:gt(0)");
if($itemlist.length==0){
date = new Date();
y = date.getFullYear(); //getYear()
m = date.getMonth()+1; //terrible!
if(m < 7){
$("select#ddListXQ").val("上");
}else{
$("select#ddListXQ").val("下");
}
$("select#dlstXndZ").val((y-1)+"-"+y); // always!
return;
}
sum = 0.0;jidian = 0.0;
$itemlist.each(function(){
$tr = $(this);
one = parseFloat($tr.find("td:eq(3)").text());
if(isNaN(one)){
return true; //continue;
}else{
sum += one;
jidian += parseFloat($tr.find("td:eq(6)").text());
}
});
sum = Math.round(sum*10)/10.0;
show = "(总绩点/总学分=平均绩点) "+sum+"/"+jidian+" = "+(sum/jidian);
$total = $("span#Label3");
$total.text($total.text()+": "+show);
console.log(show);
});