⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 score_list2.asp

📁 这是一个用ASP写的在线考试系统.特别一点 就是考试试卷有两种考法,一种为系统自动出卷,另一种是老师出卷考试.前者的实现是参考网上代码.总的来说还是很值得参考的.
💻 ASP
字号:
 
<!--#include file="conn2.asp"-->
<!--#include file="loginV.asp"-->
<%
if not VerificationRole("ROLE_1") then
	response.Write("<p>&nbsp;</p><center><img src='img/error.jpg'></center>")
	response.End()
end if
%>
<%
'if not VerificationRole("ROLE_2") then
'	response.Write("<p>&nbsp;</p><center><img src='../images/error.gif'></center>")
	'response.End()
'end if

'on error resume next
'页面设置
WebsetSql="select WEBNUM from Webset"
set rsT=conn.execute(WebsetSql)
pageNumT=rsT("WEBNUM")

selectT=request("selectT")
keyText=request("keyText")
if keyText<>"" then
	session("keyText")=keyText
	elseif Session("SearchFlag")<>1 then
		Session("SearchFlag")=1
		session("keyText")=keyText
end if

pageNum=request("pagenum")
if pageNum="" then
	pagenum=1
else
	pagenum=cint(pagenum)
end if
set rsT=server.CreateObject("adodb.recordset")
if selectT="1" then
	stuSql="select stu_num,stu_name,stu_score from look_score where stu_kemu like '%"&Session("keyText")&"%' and stu_score like '[6789]%'"
else
	stuSql="select stu_num,stu_name,stu_score from look_score where stu_kemu like '%"&Session("keyText")&"%' and stu_score like '[12345]%'"
end if
'response.Write(stuSql)
'response.End()
rsT.CacheSize=30
rsT.CursorType=1
rsT.open stuSql,conn
if rsT.eof then
	response.Write("<p><center>对不起没有你要检索的考生,<a href='score_list2.asp'>点击返回</a>!</center>")
	Session("SearchFlag")=0
	response.End()
end if
rsT.PageSize=pageNumT
rsT.AbsolutePage=pagenum
%>
<html>
<head>
<title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<link href=" css/Style.css" rel="stylesheet" type="text/css">
<META content=CnSohoW设计 name=description>
<META content="firekinger@163.com" name=author>
</head>

<body>
<p>&nbsp;</p>
<table width="506" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#d2ebff" class="Xsmall">
<tr bgcolor="#FFFFFF">
<td height="28" colspan="3">
<TABLE cellSpacing=0 cellPadding=0 width="100%" 
border=0>
          <TBODY>
            <TR>
              <TD 
                              height=25 background=img/backt.gif class="Xsmall"> <strong>成绩统计分析</strong></TD>
            </TR>
          </TBODY>
      </TABLE>
</td>
</tr>
  <form name="Searchlistform" method="post" action="score_list2.asp">
  <tr bgcolor="#FFFFFF">
    <td height="30" colspan="3"><div align="center">
      <table width="490" border="0" cellpadding="0" cellspacing="0" class="Xsmall">
        <tr>
          <td width="77"><div align="center"> </div>
            <div align="center"> 分类:</div></td>
          <td width="122"><select name="selectT" id="selectT">
            <option value="1" selected>及格
            <option value="2">不及格
            </select></td>
          <td width="150">科目:
            <input name="keyText" type="text" class="Sborder" id="keyText" size="12" maxlength="20"></td>
          <td width="50">
            <div align="left">
              <input name="enter" type="submit" class="Sborder" id="enter" value="确 定">
            </div></td>
          <td width="91"><div align="center"> 
                </div></td>
        </tr>
      </table>
    </div>      </td>
    </tr>
  <tr bgcolor="#FFFFFF">
    <td width="181" height="25"><div align="center">学 号</div></td>
    <td width="160"><div align="center">姓 名</div></td>
    <td width="149"><div align="center">分数</div>      </td>
    </tr>
    <%
  for i=1 to rsT.pageSize
	  	stuNum=trim(rsT("stu_num"))
  	    stuName=trim(rsT("stu_name"))
	    STUscore=trim(rst("stu_score"))
response.Write("<tr bgcolor='#FFFFFF'><td height='25'><div align='center'>   "&stunum&" </div></td><td><div align='center'>"&stuname&"</div></td><td><div align='center'>"&stuscore&"</div></td></tr>") 
rsT.movenext
	if rsT.Eof then exit for
  next
   %>
  <tr bgcolor="#FFFFFF">
    <td height="30" colspan="3">统计的科目为:<%=session("keytext")%>
	  <div align="center">
	      <%
   if pagenum<=1 then
		response.write(" 上一页")
	else
		response.write(" <a href=stu_list.asp?pagenum="&pagenum-1&"&selectT="&SelectT&">上一页</a>")
	end if
   if pagenum>=rsT.pageCount then
		response.write(" 下一页")
	else
		response.write(" <a href=stu_list.asp?pagenum="&pagenum+1&"&selectT="&SelectT&">下一页</a>")
	end if								
	resultCount=rsT.RecordCount				   
	response.write(" 共检索记录为:"&resultCount)				
	%>
	    </div></td>
    </tr>
  </form>
</table>
<% 
  SQL="select count(*) as num from look_score where stu_kemu like '%"&Session("keyText")&"%' and stu_score=100"
  set rst=conn.execute(sql)
 
 %>
<table width="507" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#d2ebff" class="Xsmall">
  <tr bgcolor="#FFFFFF">
    <td align="center">100分</td>
    <td align="center">100--90分</td>
    <td align="center">90--80分</td>
    <td align="center">80--70分</td>
    <td align="center">70--60分</td>
    <td height="28" colspan="3" align="center">60分以下    </td>
  </tr>
   
    <tr bgcolor="#FFFFFF">
      <td width="97" align="center"><%=rst("num")%></td>
 <% SQL="select count(*) as num1 from look_score where stu_kemu like '%"&Session("keyText")&"%' and stu_score like '9%'"
  set rst=conn.execute(sql)%>
      <td width="97" align="center"><%=rst("num1")%> </td>
<% SQL="select count(*) as num2 from look_score where stu_kemu like '%"&Session("keyText")&"%' and stu_score like '8%'"
  set rst=conn.execute(sql)%>  
      <td width="97" align="center"><%=rst("num2")%> </td>
<% SQL="select count(*) as num3 from look_score where stu_kemu like '%"&Session("keyText")&"%' and stu_score like '7%'"
  set rst=conn.execute(sql)%>
      <td width="97" align="center"> <%=rst("num3")%></td>
<% SQL="select count(*) as num4 from look_score where stu_kemu like '%"&Session("keyText")&"%' and stu_score like '6%'"
  set rst=conn.execute(sql)%>  
      <td width="97" align="center"><%=rst("num4")%> </td>
<% SQL="select count(*) as num5 from look_score where stu_kemu like '%"&Session("keyText")&"%' and stu_score<60"
  set rst=conn.execute(sql)%>
      <td width="93" height="33" colspan="3" align="center"> 
                         
        <div align="center"><%=rst("num5")%></div>        
           </td>
    </tr>
 
  
</table>
<%
rsT.close
set rsT=nothing
conn.close
set conn=nothing
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -