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

📄 testing.asp

📁 学校在线考试系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
		<td height="30">
			<font size=3><strong>单项选择题部分 (共<%=intSSCount%>题 每题1分 共<%=intSSMark%>分)</strong></font>
		</td>
	</tr>
	<%
		while not rsTest.eof
	%>
		<tr>
			<td>
				<strong><%=rsTest("orderid")%>. </strong>
				<%=rsTest("content")%>
			</td>
		</tr>
		<tr>
			<td>
				<%
				if rsTest("option1") <> "" then
					response.write "&nbsp;A&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 1) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if
					response.write " onClick='saveAnswer(this);' type='radio' value='1'> " & server.HTMLEncode(rsTest("option1"))
					response.write "<br>"
				end if
				if rsTest("option2") <> "" then
					response.write "&nbsp;B&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 2) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if					
					response.write " onClick='saveAnswer(this);' type='radio' value='2'> " & server.HTMLEncode(rsTest("option2"))
					response.write "<br>"
				end if
				if rsTest("option3") <> "" then
					response.write "&nbsp;C&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 4) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if										
					response.write " onClick='saveAnswer(this);' type='radio' value='4'> " & server.HTMLEncode(rsTest("option3"))
					response.write "<br>"
				end if
				if rsTest("option4") <> "" then
					response.write "&nbsp;D&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 8) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if										
					response.write " onClick='saveAnswer(this);' type='radio' value='8'> " & server.HTMLEncode(rsTest("option4"))
					response.write "<br>"
				end if
				if rsTest("option5") <> "" then
					response.write "&nbsp;E&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 16) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if										
					response.write " onClick='saveAnswer(this);' type='radio' value='16'> " & server.HTMLEncode(rsTest("option5"))
					response.write "<br>"
				end if
				if rsTest("option6") <> "" then
					response.write "&nbsp;F&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 32) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if					
					response.write" onClick='saveAnswer(this);' type='radio' value='32'> " & server.HTMLEncode(rsTest("option6"))
					response.write "<br>"
				end if
				%>
			</td>
		</tr>
	<%
			rsTest.movenext
		wend
	end if
	rsTest.close

	'显示多项选择题
	strSqlTest = "select P_P.id,P_P.answer,P_P.orderid,S.content,S.option1,S.option2,S.option3,S.option4,S.option5,S.option6 from prj_process P_P,subject S where S.type=2 and P_P.subid=S.id and P_P.studentid=" & intStudentID & " and P_P.prjid=" & intPrjID & " order by P_P.orderid"
	rsTest.open strSqlTest,G_CONN,1,1
	if not rsTest.bof and not rsTest.eof then
	%>
	<tr>
		<td height="30">
			<font size=3><strong>多项选择题部分 (共<%=intMSCount%>题 每题2分 共<%=intMSMark%>分)</strong></font>
		</td>
	</tr>
	<%
	dim strcon 
		while not rsTest.eof
		strcon = rsTest("content")
	%>
		<tr>
			<td>
				<strong><%=rsTest("orderid")%>. </strong>
				<%=server.HTMLEncode(strcon)%>
			</td>
		</tr>
		<tr>
			<td>
				<%
				if rsTest("option1") <> "" then
					response.write "&nbsp;A&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 1) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if
					response.write " onClick='saveAnswer(this);' type='checkbox' value='1'> " & server.HTMLEncode(rsTest("option1"))
					response.write "<br>"
				end if
				if rsTest("option2") <> "" then
					response.write "&nbsp;B&nbsp;<input name='" & rsTest("id") & "' "					
					if (rsTest("answer") and 2) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if
					response.write " onClick='saveAnswer(this);' type='checkbox' value='2'> " & server.HTMLEncode(rsTest("option2"))
					response.write "<br>"
				end if
				if rsTest("option3") <> "" then
					response.write "&nbsp;C&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 4) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if					
					response.write " onClick='saveAnswer(this);' type='checkbox' value='4'> " & server.HTMLEncode(rsTest("option3"))
					response.write "<br>"
				end if
				if rsTest("option4") <> "" then
					response.write "&nbsp;D&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 8) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if					
					response.write " onClick='saveAnswer(this);' type='checkbox' value='8'> " & server.HTMLEncode(rsTest("option4"))
					response.write "<br>"
				end if
				if rsTest("option5") <> "" then
					response.write "&nbsp;E&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 16) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if					
					response.write " onClick='saveAnswer(this);' type='checkbox' value='16'> " & server.HTMLEncode(rsTest("option5"))
					response.write "<br>"
				end if
				if rsTest("option6") <> "" then
					response.write "&nbsp;F&nbsp;<input name='" & rsTest("id") & "' "
					if (rsTest("answer") and 32) > 0 and rsTest("answer") >= 0 then
						response.write "checked"
					end if					
					response.write " onClick='saveAnswer(this);' type='checkbox' value='32'> " & server.HTMLEncode(rsTest("option6"))
					response.write "<br>"
				end if
				%>
			</td>
		</tr>
	<%
		rsTest.movenext
		wend
	end if
	rsTest.close
	
	'显示是非题
	strSqlTest = "select P_P.id,P_P.answer,P_P.orderid,S.content from prj_process P_P,subject S where S.type=3 and P_P.subid=S.id and P_P.studentid=" & intStudentID & " and P_P.prjid=" & intPrjID & " order by P_P.orderid"
	rsTest.open strSqlTest,G_CONN,1,1
	if not rsTest.bof and not rsTest.eof then
	%>
	<tr>
		<td height="30">
			<font size=3><strong>是非题部分 (共<%=intBCount%>题 每题1分 共<%=intBMark%>分)</strong></font>
		</td>
	</tr>
	<%
		while not rsTest.eof
	%>
		<tr>
			<td>
				<strong><%=rsTest("orderid")%>. </strong>
				<%=server.HTMLEncode(rsTest("content"))%>
			</td>
		</tr>
		<tr>
			<td>
				<input name="<%=rsTest("id")%>" 
				<%
				if rsTest("answer") = 1 then
					response.write "checked"
				end if
				%>
				 onClick="saveAnswer(this);" type="radio" value="1"> 是&nbsp;&nbsp;
				<input name="<%=rsTest("id")%>"
				<%
				if rsTest("answer") = 0 then
					response.write "checked"
				end if
				%>
				 onClick="saveAnswer(this);" type="radio" value="0"> 否
			</td>
		</tr>
	<%
		rsTest.movenext
		wend
	end if
	rsTest.close
	
	'显示主观题
	strSqlTest = "select P_P.id,P_P.answer2,P_P.orderid,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"
	rsTest.open strSqlTest,G_CONN,1,1
	if not rsTest.bof and not rsTest.eof then
	%>
	<tr>
		<td height="30">
			<font size=3><strong>主观题部分 (共<%=intZGCount%>题 每题10分 共<%=intZGMark%>分)</strong></font>
		</td>
	</tr>
	<%
	dim strid
	
		while not rsTest.eof
		strid = rsTest("id")
	%>
		<tr>
			<td>
				<strong><%=rsTest("orderid")%>. </strong>
				<%=server.HTMLEncode(rsTest("content"))%>
			</td>
		</tr>
		<tr>
			<td>
                <textarea tag id="t<%=strid%>" name="<%=strid%>" class="text" cols="80" rows="6"><%=rsTest("answer2")%></textarea>
                <input type="button" onClick="saveAnswer(t<%=strid%>);" value="&nbsp;保&nbsp;&nbsp;存&nbsp;" name="btn">
			</td>
		</tr>
	<%
		rsTest.movenext
		wend
	end if
	rsTest.close
	set rsTest = nothing
	call closeConn()
	%>
</table>
<script language="jscript">

function saveAw(objAnswer)	//保存试题答案
{
  //dim o = new object(objAnswer)
  //dim a=document.getElementById(objAnswer)
	alert(objAnswer.value);


}

</script>
</body>
</html>

⌨️ 快捷键说明

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