📄 search_score_result.asp
字号:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="verifyStudent.asp"-->
<%
var StudentId;
var Rs;
var rsc;
var CutNum;
var OtherNum;
var i;
var j;
var k;
var h = 1;
var all;
var totalScore=0;//总成绩
var totalXueFen=0;//总学分
var totalJiDianXueFen = 0;//总绩点与学分积
var course_num=0;//课程数
StudentId=Request.QueryString("studentNo");
Rs=Server.CreateObject("ADODB.Recordset");
Rs.ActiveConnection=Conn;
Rs.CursorLocation=3;
Rs.Source="select s.courseId courseId,c.name courseName,s.score score,s.studentId,stu.name studentName,c.xuefen xuefen from score s,course c,student stu where s.courseId=c.id and s.studentId=stu.studentNo and s.studentId="+StudentId+"and chongxiu = 'no'";
Rs.Open();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生成绩查看界面</title>
<!--#include file="link.asp"-->
<style type="text/css">
body{
text-align:center;
}
</style>
</head>
<body>
<!--#include file="top.asp"-->
<%
if(Rs.EOF){
Response.Write("<div align=center><font size='6' color='#ff0000'>未有该生的成绩数据</font></div>" );
}else{
course_num = Rs.RecordCount;
writeHeadMessage(StudentId,course_num);
writeTableHead();
while(!Rs.EOF){
totalXueFen+=Rs("xuefen");
totalScore+=Rs("score");
var jidian = countJiDian(Rs("score"));
totalJiDianXueFen+=Rs("xuefen")*jidian;
%>
<tr>
<td height="20" width="126">
<div align="center">
<font size="2" color="#ff0000"><%=Rs("courseName")%></font>
</div>
</td>
<td height="20" width="126">
<div align="center">
<font size="2" color="#ff0000"><%=Rs("score")%></font>
</div>
</td>
<td height="20" width="126">
<div align="center">
<font size="2" color="#ff0000"><%=Rs("xuefen")%></font>
</div>
</td>
<td height="20" width="126">
<div align="center">
<font size="2" color="#ff0000"><%=jidian%></font>
</div>
</td>
<%
var courseId = Rs("courseId");
getBuKao(courseId,StudentId);
%>
<td height="20" width="126">
<div align="center">
<font size="2" color="#ff0000">
<%
if(rsc.EOF){
Response.Write("没有补考成绩");
}
var counta=0
while(!rsc.EOF){
if(counta!=0)
Response.Write("|");
Response.Write(rsc("score"));
counta++;
rsc.MoveNext;
}
rsc.Close;
%>
</font>
</div>
</td>
<%
var courseId = Rs("courseId");
getChongXiu(courseId,StudentId);
%>
<td height="20" width="126">
<div align="center">
<font size="2" color="#ff0000">
<%
if(rsc.EOF){
Response.Write("没有重修成绩");
}
var counta=0
while(!rsc.EOF){
if(counta!=0)
Response.Write("|");
Response.Write(rsc("score"));
counta++;
rsc.MoveNext;
}
rsc.Close;
%>
</font>
</div>
</td>
<td height="20" width="126">
<div align="center">
<font size="2" color="#ff0000"><a href="#">排名</a></font>
</div>
</td>
<%
Rs.MoveNext;
}
Response.Write("</tr></table>");
writeFootCount();
}
Rs.Close();
Rs=null;
Conn.Close();
Conn=null;
//用于构造表格头部
function writeTableHead(){
Response.write("<tr>");
Response.write("<td><div align='center'><font size='2'>课程名</font></div></td><td><div align='center'><font size='2'>成绩</font></div></td><td><div align='center'><font size='2'>学分</font></div></td><td><div align='center'><font size='2'>绩点</font></div></td><td><div align='center'><font size='2'>补考</font></div></td><td><div align='center'><font size='2'>重修</font></div></td><td><div align='center'><font size='2'>排名情况</font></div></td>");
Response.write("</tr>");
}
//统计绩点
function countJiDian(score1){
var score = parseInt(score1);
if(score>= 90)
return (4+(score-90)/10);
if(score>=80&&score<90)
return (3+(score-80)/10);
if(score>=70&&score<80)
return (2+(score-70)/10);
if(score>=60&&score<70)
return (1+(score-60)/10);
if(score<60)
return 0;
}
//获取补考成绩
function getBuKao(courseId,StudentId){
rsc=Server.CreateObject("ADODB.Recordset");
rsc.ActiveConnection=Conn;
rsc.CursorLocation=3;
rsc.source="select score from score s where s.courseId="+courseId+"and s.studentId="+StudentId+"and chongxiu='bukao'";
rsc.Open();
return rsc;
}
//获取补考成绩
function getChongXiu(courseName,StudentId){
rsc=Server.CreateObject("ADODB.Recordset");
rsc.ActiveConnection=Conn;
rsc.CursorLocation=3;
rsc.source="select score from score s where s.courseId="+courseId+"and s.studentId="+StudentId+"and chongxiu='chongxiu'";
rsc.Open();
return rsc;
}
//构造成绩的统计信息,包括总学分,平均学分绩点
function writeFootCount(){
Response.Write("<br />");
Response.Write("<table border='1' width='760' cellPadding='0' cellSpacing='0' bgcolor='#CCFFFF' borderColor='#111111' borderColorDark='#000000' borderColorLight='#000000' style='BORDER-COLLAPSE: collapse'><tr>");
Response.Write("<td>总学分</td><td>平均学分绩点</td><td>平均分</td>");
Response.Write("</tr><tr>");
Response.Write("<td>"+totalXueFen+"</td><td>"+totalJiDianXueFen/totalXueFen+"</td><td>"+totalScore/course_num+"</td>");
Response.Write("</tr></table>");
}
//构造页面头部信息(学号,课程数)
function writeHeadMessage(StudentId,all){
Response.Write("<table border='1' width='760' cellPadding='0' cellSpacing='0' bgcolor='#CCFFFF' borderColor='#111111' borderColorDark='#000000' borderColorLight='#000000' style='BORDER-COLLAPSE: collapse'>");
Response.Write("<form action='score_inputmodify_result.asp' method='post'>");
Response.Write("<table border='1' width='760' cellPadding='0' cellSpacing='0' bgcolor='#CCFFFF' borderColor='#111111' borderColorDark='#000000' borderColorLight='#000000' style='BORDER-COLLAPSE: collapse'>");
Response.Write("<tr>");
Response.Write("<td height='20' width='760' colspan='7'><div align='center'><font size='2' color='#FF0000'>您所操作的学生学籍号为:</font>"+StudentId+"</div></td>");
Response.Write("</tr>");
Response.Write("<tr>");
Response.Write("<td height='20' width='760' colspan='7'><div align='center'><font size='2' color='#FF0000'>该专业所学课程总数为:</font>"+all+"</div></td>");
Response.Write("</tr>");
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -