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

📄 strk1.asp

📁 这是用asp做的一个网上考试题库系统
💻 ASP
字号:
<!--#include file="../db.asp"-->
 
<%
  objConn.Open strConnection
  Set objRS = Server.CreateObject ("ADODB.Recordset")
  Set objRS.ActiveConnection = objConn
   dim nextn 
 select Case Session("tx")
 Case 1  
 ' strQuery= "insert into ItemTable(Itemtype,Difficulty,Division,CognizeClass,SuggestScore,SuggestTime,WriteSubjectID,WriteSubjectTime,ExamineID,ExamineTime,ExistID,STNR,STWJ,DAAN,DAZJ,xxA,xxAwj,xxB,xxBwj,xxC,xxCwj,xxD,xxDwj,xxE,xxEwj) values"
 ' strQuery=strQuery&"("&Session("tx")&","&Session("nd")&","&Session("qfd")&","&Session("rzhfl")&","&Session("jyfsh")&","&Session("jyshj")&",'"&Session("chtr")&"',"&Session("chtrq")&",'"&Session("shdr")&"',"&Session("shdrq")&",1,'"&Session("zwnr")&"','"&Session("zwwj")&"','"&Session("dan")&"','"&Session("dasj")&"','" &Session("stzwA")&"','"&Session("stwjA")&"','"&Session("stzwB")&"','"&Session("stwjB")&"','"&Session("stzwC")&"','"&Session("stwjC")&"','"&Session("stzwD")&"','"&Session("stwjD")&"','"&Session("stzwE")&"','"&Session("stwjE")&"')"
 
   nextn="下一道单项选择题"
  
 Case 2
   strQuery= "insert into ItemTable(Itemtype,Difficulty,Division,CognizeClass,SuggestScore,SuggestTime,WriteSubjectID,WriteSubjectTime,ExamineID,ExamineTime,ExistID,STNR,STWJ,DAAN,DAZJ,xxA,xxAwj,xxB,xxBwj,xxC,xxCwj,xxD,xxDwj,xxE,xxEwj,xxF,xxFwj) values"
   strQuery=strQuery&"("&Session("tx")&","&Session("nd")&","&Session("qfd")&","&Session("rzhfl")&","&Session("jyfsh")&","&Session("jyshj")&",'"&Session("chtr")&"',"&Session("chtrq")&",'"&Session("shdr")&"',"&Session("shdrq")&",1,'"&Session("zwnr")&"','"&Session("zwwj")&"','"&Session("answer")&"','"&Session("dasj")&"','" &Session("stzwA")&"','"&Session("stwjA")&"','"&Session("stzwB")&"','"&Session("stwjB")&"','"&Session("stzwC")&"','"&Session("stwjC")&"','"&Session("stzwD")&"','"&Session("stwjD")&"','"&Session("stzwE")&"','"&Session("stwjE")&"','"&Session("stzwF")&"','"&Session("stwjF")&"')"
   nextn="下一道多项选择题"
  
 Case 3
    strQuery= "insert into ItemTable(Itemtype,Difficulty,Division,CognizeClass,SuggestScore,SuggestTime,WriteSubjectID,WriteSubjectTime,ExamineID,ExamineTime,ExistID,STNR,STWJ,DAAN,DAZJ) values"
    strQuery=strQuery&"("&Session("tx")&","&Session("nd")&","&Session("qfd")&","&Session("rzhfl")&","&Session("jyfsh")&","&Session("jyshj")&",'"&Session("chtr")&"',"&Session("chtrq")&",'"&Session("shdr")&"',"&Session("shdrq")&",1,'"&Session("shtnr")&"','"&Session("shtfj")&"','"&Session("answer")&"','"&Session("dasj") &"')"
    nextn="下一道填空题"
    
    
 Case 4
   strQuery= "insert into ItemTable(Itemtype,Difficulty,Division,CognizeClass,SuggestScore,SuggestTime,WriteSubjectID,WriteSubjectTime,ExamineID,ExamineTime,ExistID,STNR,STWJ,DAAN,DAZJ) values"
    strQuery=strQuery&"("&Session("tx")&","&Session("nd")&","&Session("qfd")&","&Session("rzhfl")&","&Session("jyfsh")&","&Session("jyshj")&",'"&Session("chtr")&"',"&Session("chtrq")&",'"&Session("shdr")&"',"&Session("shdrq")&",1,'"&Session("zwnr")&"','"&Session("shtfj")&"','"&Session("answer")&"','"&Session("dasj") &"')"
    nextn="下一道判断题"
    
 Case 5
     strQuery= "insert into ItemTable(Itemtype,Difficulty,Division,CognizeClass,SuggestScore,SuggestTime,WriteSubjectID,WriteSubjectTime,ExamineID,ExamineTime,ExistID,STNR,STWJ,DAAN,DAZJ) values"
      strQuery=strQuery&"("&Session("tx")&","&Session("nd")&","&Session("qfd")&","&Session("rzhfl")&","&Session("jyfsh")&","&Session("jyshj")&",'"&Session("chtr")&"',"&Session("chtrq")&",'"&Session("shdr")&"',"&Session("shdrq")&",1,'"&Session("zwnr")&"','"&Session("shtfj")&"','"&Session("answer")&"','"&Session("dasj") &"')"
    nextn="下一道分析题"
   
end select
 objConn.Execute strQuery 
  objConn.Close
 strQuery="SELECT MAX(ItemID) AS NowID FROM ItemTable"
 objConn.Execute strQuery 
  id=objRS("NowID") 
  objRS.Close
  objConn.Close 

  objRS.Open "select * from ZSD_ST",objConn,2,3

if Session("zsdhu")="" then
	obj.AddNew 
	 objRS("Courseid")=Session("course_id")
	 objRS("Itemid")=id
	 objRS("Knowledgeid")=0
	 objRS.Update
else
	begin=instr(Session("zsdhu"),";")
	while begin<>0 
	 KnowledgeID=left(Session("zsdhu"),begin-1)
	 LENKID=Len(Session("zsdhu"))
	 KID=Right(Session("zsdhu"),(LENKID-Begin))
	 begin=instr(KID,";")

	 objRS.AddNew 
	 objRS("CourseID")=Session("course_id")
	 objRS("ItemID")=id
	 objRS("KnowledgeID")=KnowledgeID
	 objRS.Update
	wend
end if
 objRS.Close 
  Set objRS=Nothing
  Set objConn=Nothing

%>
 <script language=Javascript>
  
   function Nextt()
   {
     window.clear;
    if(<%=session("tx")%>==1) window.location .href ="Da.asp";
    if(<%=session("tx")%>==2) window.location .href ="Dux.asp";
    if(<%=session("tx")%>==3) window.location .href ="tiankong.asp"
    if(<%=session("tx")%>==4) window.location .href ="pd.asp"
    if(<%=session("tx")%>==5) window.location .href ="fx.asp"
    }

</script> 

<html>
 </script>
<body bgcolor="#FFCCCC">
<table width="100%" border="0" height="30" bgcolor="#FFCCCC">
  <tr>
    <td width="36%" nowrap>&nbsp;</td>
    <td width="22%" nowrap><b><font color="#FF0000">试题已成功入库</font></b></td>
    <td width="42%">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" bgcolor="#FFCCCC" height="37">
  <tr>
    <td width="37%">&nbsp;</td>
    <td width="20%" nowrap> 
      <input type="button" name="Button"  value=<%=nextn%> onclick="Nextt()">
    </td>
    <td width="43%">&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>



















⌨️ 快捷键说明

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