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

📄 report.asp

📁 利用ASP+SQL制作的在线考试系统
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->


<script Language="vbscript">
sub check()
	c=document.form1.page.value
			if c<>"" then
				if not IsNumeric(c) then
				msgbox " 页数只能输入数字"
				document.form1.page.select()
				exit sub
				else
				
				end if
			else
				msgbox"请输入想要转到页数"
				document.form1.page.select()
				exit sub
			end if
			
				document.form1.submit()
end sub
</script>

 <%flag1=0
 flag2=0
 reportid=trim(request("reportid"))

		set rs=Server.CreateObject("ADODB.Recordset")
		sqls="select  * from examination  "
		set rss=conn.execute(sqls)
	if rss.eof then 
		titles="暂无成绩信息"
		flag1=1
	else
		
		if reportid="" then
		reportid=rss("examinationid")
		flag2=1
		else
		reportid=reportid
		end if 
		set rs1=conn.execute("select * from examination where examinationid="&reportid&"")
		title="第 "&rs1("examinationid")&" 期考试统计"
		if flag2=1 then title=title&"<font color=red>(最新一期)</font>"
		set rs2=conn.execute("select * from test where examinationid="&rs1("examinationid")&"")
	titles=title&"<p>(判断题数"&rs2("rightorwrongid")&"题/"&rs2("rightorwrongscore")&"分,选择题数"&rs2("selectid")&"题/"&rs2("selectscore")&"分,填空题数"&rs2("fillingid")&"题/"&rs2("fillingscore")&"分)</p>"
		
		zf=rs2("rightorwrongid")*rs2("rightorwrongscore")+rs2("selectid")*rs2("selectscore")+rs2("fillingid")*rs2("fillingscore")

		
	
end if 
		%> 

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上考试系统</title>
<link rel="stylesheet" type="text/css" href="../css.css">
</head>

<body topmargin="0" leftmargin="0">
<p>
<p align="center"><font face="隶书" size="6" >成绩统计管理</font></p>
<div align="center">
  <center>
  <table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="500">
    <tr>
      <td align="center" colspan="4"> 往期统计:
      <select name="cate" size="1" style="background-color: #EFEFF7" onchange="javascript:self.location=this.options[this.selectedIndex].value">
     <%set rs3=conn.execute("select distinct examinationid from examination order by examinationid desc")
     while not rs3.eof %> 
      <option  value="report.asp?reportid=<%=rs3("examinationid")%>" <%if cint(request("examinationid"))=cint(rs3("examinationid")) then response.write "selected"%>>第<%=rs3("examinationid")%>期</option>
<%rs3.movenext
wend%>           
 </select>&nbsp;&nbsp;&nbsp;<%=titles%>
       <form method="get" name=form2 action="">
  
    <%keyword=trim(request("keyword"))
    if keyword="" then
    keywords="所有考生"
    else
    keywords=keyword
    end if 
    %>
      <p>以下为姓名为 <font color=red><%=keywords%></font> 的考生列表&nbsp; 输入考生姓名<input type="text" name="keyword" size="20"  class="line">&nbsp; <input type="submit" value="查找" name="B1" style="width: 60; height: 22; border-style: solid; border-width: 1px; background-color: #FFFFFF"></form></td>
    </tr>
      
    <tr>
      <td align="center" bgcolor="#000099"><font color="#FFFFFF">考生姓名</font></td>
      <td align="center" bgcolor="#000099"><font color="#FFFFFF">分数</font></td>
      <td align="center" bgcolor="#000099"><font color="#FFFFFF">补考设置</font></td>
      <td align="center" bgcolor="#000099"><font color="#FFFFFF">补考成绩</font></td>
    </tr>
  <% 
  if flag1=1 then
  else
  		sql="select student.*,examination.* from student,examination where  student.studentname like '%"&keyword&"%' and examination.studentnumber=student.studentnumber and examination.examinationid="&rs1("examinationid")&" order by student.studentnumber desc"
		
		rs.open sql,conn,3,1,1
			rs.pagesize=10

  
  
  if not (rs.eof and rs.bof) then
		Page = cint(Request.querystring("Page"))
   		If Page < 1 Then Page = 1
   		If Page > rs.PageCount Then Page = rs.PageCount
			showpages rs,Page
	%>
	<%else%>
<tr><td colspan=4><center><font color=red>暂无此学员信息</font></center></td></tr>
	<%end if%>
<%
Sub showpages( rs,Page )
   rs.AbsolutePage = Page		
		for i=0 to rs.pagesize-1
			j=j+1
			if j mod 2 =0 then
				bg="#EFEFF7"
			else 
				bg="#ffffff"
			end if
			
			if rs("score")>=cint(zf*6/10) then
			fen="<font colot=#008000>"&rs("score")&"分</font>"
			bk="不需要"
			bfen="不需要"
			else
			fen="<font colot=red>"&rs("score")&"分</font>"
			bk="<a href=test_again.asp?studentnumber="&rs("studentnumber")&"&reportid="&reportid&">批准补考</a>"
			bfen="需要补考"
				if rs("pass")=True then
				bk="已批准补考"
					 if rs("makeup")=0 then
					bfen="还未补考"
					else
						if rs("makeup")>=cint(zf*6/10) then
						bfen="<font colot=#008000>"&rs("makeup")&"分</font>"
						else
						bfen="<font colot=red>"&rs("makeup")&"分</font>"
						end if 
					end if 
				end if 
			end if 			
			%>

    <tr bgcolor=<%=bg%>>
      <td align="center"><a href="student.asp?id=<%=rs("studentnumber")%>"><%=rs("studentname")%></a></td>
      <td align="center"> <%=fen%></td>
      <td align="center">
          <%=bk%></td>
      <td align="center">
          <%=bfen%></td>
    </tr>
    <%
		rs.movenext
  		If rs.EOF Then Exit For
	 	Next%>
  <%End Sub
  
  end if %>  

    <tr>
      <td colspan="4" align="center">
     
     <form action=report.asp?keyword=<%=keyword%>&reportid=<%=reportid%> method="get" name=form1  > 
	  	<%
		
		response.write rs.pagesize&"条一页&nbsp;&nbsp;"
		if Page=1 then 
      		 response.write"第一页  "
   		end if 
  		 If Page <> 1 Then
  		    Response.Write "<A HREF=report.asp?keyword="&keyword&"&reportid="&reportid&"&Page=1>第一页</A>

⌨️ 快捷键说明

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