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

📄 admin_examscore.asp

📁 学校在线考试系统
💻 ASP
字号:
<%
option explicit
Response.expires=-1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","no-store"
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<!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>
<link href="admin.css" rel="stylesheet" type="text/css">
<style>
body {
	font-size:12px;
}
</style>
</head>



<body>
<table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF" class="tborder">
	<tr class="tdtbg">
		<td align="center">
			&nbsp;&nbsp;考&nbsp;&nbsp;生&nbsp;&nbsp;成&nbsp;&nbsp;绩&nbsp;&nbsp;管&nbsp;&nbsp;理&nbsp;&nbsp;
		</td>
	</tr>
	<tr class="tdbg">
		<td>
			<a href="admin_examscore.asp">成绩管理首页</a> &nbsp;&nbsp;&nbsp;<a href="#" style="color:#00F;font-size:12px" onClick="window.print();">【打印本页】</a>
		</td>
	</tr>
</table>
<br>
<%
dim strAction

if checkAdminLogin() = false then	'进行管理员登录验证
	response.redirect "admin_login.asp"
end if
if checkPurview(CONST_PURVIEW_PROJECT) = false then
	response.write "<center><font size=4>你没有进行此操作的权限,请与系统管理员联系!</font></center>"
	response.write "</body></html>"
	response.end
end if
strAction = trim(request.form("action"))
if strAction = "" then
	strAction = trim(request.querystring("action"))
end if
select case strAction
	case "zgscore"
		call zgscore()	'保存添加结果
	case else
		call main()	'主界面
end select

sub main()	'主界面
	dim rsScore,strSqlScore,intMaxPage,I,intMaxPerPage,intCurPage,intCurRec,intCourseID
%>
</body>
</html>


<table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF" class="tborder">
	<tr class="tdtbg">
		<td width="80" align="center"> 考生</td>	
		<td align="center"> 课程 </td>	
		<td width="80" align="center"> 单选题得分 </td>
		<td width="80" align="center"> 多选题得分 </td>
		<td width="80" align="center"> 是非题得分 </td>
		<td width="80" align="center"> 主观题得分 </td>
		<td width="80" align="center"><B> 成绩</B> </td>
		<td width="80" align="center"> 阅卷状态 </td>
		<td width="150" align="center"> 操作 </td>
	</tr>

	<%
	intMaxPerPage = 18 '定义每页显示多少条题目
	if IsNumeric(Trim(request.querystring("page"))) = true then
		intCurPage = CLng(Trim(request.querystring("page")))
	else
		intCurPage = 1
	end if
	if IsNumeric(Trim(request.querystring("courseid"))) = true then
		intCourseID = CLng(Trim(request.querystring("courseid")))
	else
		intCourseID = 0
	end if

	set rsScore = server.createobject("ADODB.Recordset")
	strSqlScore = "select SC.*,S.studentname,C.coursename from student_score SC,student S,project P,course C where SC.studentid=S.studentid and  SC.prjid=P.prjid and P.courseid=C.courseid"
	if intCourseID > 0 then
		strSqlScore = strSqlScore & " and C.courseid=" & intCourseID
	end if

	strSqlScore = strSqlScore & " order by scoremark desc"
	rsScore.open strSqlScore, G_CONN, 1, 1
	rsScore.pagesize = intMaxPerPage
	if intCurPage < 1 then
		intCurPage = 1
	elseif intCurPage > rsScore.pagecount then
		intCurPage = rsScore.pagecount
	end if
	intMaxPage = rsScore.pagecount
	if not rsScore.eof and not rsScore.bof then
		rsScore.absolutepage = intCurPage
	end if
	if rsScore.bof or rsScore.eof then
		response.write "<tr class='tdbg'><td colspan='9' align='center'>没有学生成绩</td></tr>"
	end if
	intCurRec = 1
	dim intTotalScore
	intTotalScore = 0
	while not rsScore.eof and intCurRec <= intMaxPerPage
		response.write "<tr class='tdbg'>"
		response.write "<td align='center'>" & rsScore("studentname") & "</td>"
		response.write "<td align='center'>" & rsScore("coursename") & "</td>"
		response.write "<td align='center'>" & rsScore("DanX_score") & "</td>"
		response.write "<td align='center'>" & rsScore("DuoX_score") & "</td>"
		response.write "<td align='center'>" & rsScore("SF_score") & "</td>"
		response.write "<td align='center'>" & rsScore("ZG_score") & "</td>"
		intTotalScore = rsScore("DanX_score") + rsScore("DuoX_score") + rsScore("SF_score") + rsScore("ZG_score")
		response.write "<td align='center'>" & intTotalScore & "</td>"
		response.write "<td align='center'>" & rsScore("ScoreMark") & "</td>"
		response.write "<td align='center'>"
		response.write "<a href='admin_examscore.asp?action=zgscore&studentid=" & rsScore("studentid") & "&prjid="&rsScore("prjid")& "&coursename="&rsScore("coursename") & "'>主观题阅卷</a>"
		response.write "</td></tr>"
		rsScore.movenext
		intCurRec = intCurRec + 1
	wend
	rsScore.close
	set rsScore = nothing
	call closeConn()
	%>
    
</table>
<center>
<%
call showPageCtrl(intMaxPage,intCurPage,"admin_examscore.asp?courseid=" & intCourseID & "&page=")
%>
</center>
<%
end sub

sub zgscore()	'主观题阅卷界面
	dim rsScore, strSqlScore, intStudentID, intPrjID, strErr, strCourseName
	
	strErr = ""
	intStudentID = CLng(Trim(request.querystring("studentid")))
	intPrjID     = CLng(Trim(request.querystring("prjid")))
	strCourseName = Trim(request.querystring("coursename"))
	
	set rsScore = server.createobject("ADODB.Recordset")
	strSqlScore = "select sc.*,p.zg_count from student_score sc,project p where sc.prjid=p.prjid and sc.studentid=" & intStudentID & "and sc.prjid=" & intPrjID
	'Response.Write strSqlScore
	'Response.End
	
	rsScore.open strSqlScore,G_CONN,1,1
	if rsScore.bof or rsScore.eof then
		strErr = "<li>该学生成绩不存在!</li>"
	end if
	if strErr <> "" then
		call closeConn()
		showErrMsg(strErr)
		response.write "</body></html>"
		exit sub
	end if
	dim intZGCount, intZGMark
	intZGCount = rsScore("zg_count")
	intZGMark = intZGCount * 10
%>
<script language="JAVAScript">

function saveScore(objScore)	//保存主观题得分
{
    if (objScore.type == 'text')
    {
        window.open('saveScore.asp?intMark=0&score=' + objScore.value + '&id=' + objScore.name + '&prjid=<%=intPrjID%>&studentid=<%=intStudentID%>','fraSaveScore')
       // alert(objScore.name);
        }
		
	objScore.focus();
}

function saveFinScore()	//保存主观题得分
{
    window.open('saveScore.asp?intMark=1&prjid=<%=intPrjID%>&studentid=<%=intStudentID%>','fraSaveScore')
	objScore.focus();
}

function chkup(chkinx)
{
 //frmAdd.answer10.style.display="none";
  switch(chkinx)
  {
  case 1:   //单选题
   divAnswer1.style.display="";
   //divAnswer2.style.display="none";
   //divAnswer3.style.display="";
   //divAnswer4.style.display="none";
   //   break;
  case 2:   //多选题
  // divAnswer1.style.display="";
  // divAnswer2.style.display="none";
  // divAnswer3.style.display="";
  // divAnswer4.style.display="none";
  //    break;
  }
}

</script>
    <iframe name="fraSaveScore" style="visibility:hidden;height:0px" src=""></iframe>
    <form name="frmSaveScore" action="admin_examscore.asp" method="post">
    <input name="action" type="hidden" value="zgscore">
    <input name="studentid" type="hidden" value="<%=intStudentID%>">
    <input name="prjid" type="hidden" value="<%=intPrjID%>">
    <input name="coursename" type="hidden" value="<%=strCourseName%>">
    <table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF" class="tborder">
	<tr class="tdtbg">
		<td colspan="2" align="center"> 主观题阅卷 </td>
	</tr>
	<tr class="tdbg">
		<td width="130" align="right">所属课程:</td>
		<td>
			<%=strCourseName%>
		</td>
	</tr>
	<tr class="tdbg">
		<td width="130" align="right">试题类型:</td>
		<td>
			单选题得分:&nbsp;&nbsp;<%=rsScore("DanX_score")%>
		</td>
	</tr>
	<tr class="tdbg">
		<td width="130" align="right">试题类型:</td>
		<td>
			多选题得分:&nbsp;&nbsp;<%=rsScore("DuoX_score")%>
		</td>
	</tr>
	<tr class="tdbg">
		<td width="130" align="right">试题类型:</td>
		<td>
			是非题得分:&nbsp;&nbsp;<%=rsScore("SF_score")%>

		</td>
	</tr>
	</table>	
	
    <table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF" class="tborder">
	<tr class="tdbg">
		<td width="130" align="right">主观题:</td>
		<td>
			
		</td>
	</tr>
	</table>	

    <table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF" class="tborder">	
	<%
	'显示主观题
	dim strSqlZGT, rsZGT
	
	set rsZGT = server.createobject("ADODB.Recordset")
	strSqlZGT = "select P_P.id,P_P.answer2,P_P.orderid,P_P.zgscore,S.content from prj_process P_P,subject S where S.type=4 and P_P.subid=S.id and P_P.studentid=" & intStudentID & " and P_P.prjid=" & intPrjID & " order by P_P.orderid"
	rsZGT.open strSqlZGT,G_CONN,1,1
	if not rsZGT.bof and not rsZGT.eof then
	%>
	<tr>
		<td height="30">
			<font size=3><strong>主观题部分 (共<%=intZGCount%>题 每题10分 共<%=intZGMark%>分)</strong></font>
		</td>
	</tr>
	<%
	    dim strid
	
		while not rsZGT.eof
		strid = rsZGT("id")
	%>
		<tr>
			<td>
				<strong><%=rsZGT("orderid")%>. </strong>
				<%=rsZGT("content")%>
			</td>
		</tr>
		<tr>
			<td>
                <textarea tag id="txtAnswer" name="txtAnswer" class="text" cols="80" rows="6" readonly><%=rsZGT("answer2")%></textarea><br>
                得分:<input id="o<%=strid%>" name="<%=strid%>" type="text" class="text" size="10" maxlength="128" value="<%=rsZGT("zgscore")%>">
                <input type="button" onClick="saveScore(o<%=strid%>);" value="&nbsp;保&nbsp;&nbsp;存&nbsp;" name="btn">
			</td>
		</tr>
	<%
		rsZGT.movenext
		wend
	end if
	rsZGT.close
	set rsZGT = nothing
	call closeConn()
	%>
		<tr>
			<td>
                <input type="button" onClick="saveFinScore();" value="&nbsp;阅卷完毕&nbsp;" name="btn">
			</td>
		</tr>
    </table>
</form>


<%
end sub
%>
</body>

⌨️ 快捷键说明

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