Network Examination Room (6) (turn) stselectsub.asp

Source: Internet
Author: User
Tags dsn trim visual studio
select| Network <%@ language=vbscript%>
<%
If Request.Form ("Selsub") <> "" Then
' If you choose the subject, enter the test interface
Marray=split (Request.Form ("Selsub"), ",")
' The number of the teacher who saved the test account
Session ("Teachid") =trim (Marray (0))
' Save the Test account name
Session ("SubName") =trim (Marray (1))
' Save the number of questions
Session ("Testnum") =trim (Marray (2))
' Save the test time
Session ("Testtime") =trim (Marray (3))
' Save start time
Session ("StartTime") =now ()
' Enter the test interface
Response.Redirect "Screatefrm1.asp"
End If
%>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
<body>
<form action= "stselectsub.asp" method= "Post" id= "Form1" Name= "Form1" >
<p><font face = "" "Size=" 2 "> You have entered the network examination room, must observe the examination rules, pay attention to the exam time </font></p>
<strong><font size=4 color=blueviolet face= Official script >
<%response.write session ("Stname")%>
</FONT></STRONG>
<p align=center>
<table border= "1" cellpadding= "1" cellspacing= "1" width= "75%" >

<tr>
&LT;TD colspan= "3" >
<div align= "center" ><font Color=crimson face= Young Circle
Size=4><strong> Select test Subjects </STRONG></FONT></div>
<tr>
<td> Subjects </td>
<td> Classroom Teacher </td>
<td> Exam Time </td></tr>
<%
' Create two database connection objects Conn and conn2
Set Conn=server. CreateObject ("Adodb.connection")
Set Conn2=server. CreateObject ("Adodb.connection")
Conn2. Connectionstring= "Dsn=testsys"
Conn. Connectionstring= "Dsn=testsys"
Conn. Open
Conn2. Open
Strsql= "Select Subinfo.sub,subinfo.teachid,subinfo.testtime,subinfo.testnum,teacherinfo.teachname from Subinfo, Teacherinfo where Subinfo.teachid=teacherinfo.teachid "
' The first database connection object queries all the exam account information (including name, exam time, number of questions, name and number of the class teacher)
Set Mrs=conn. Execute (strSQL)
While not mrs.eof
Response.Write "<tr>"
' The second database connection object queries the corresponding subject whether the student has got the grade
Set Mrs2=conn. Execute ("select * from score where stid= '" & Session ("Stid") & "' and Sub= '" & Mrs ("Sub") & "' and Teachid = ' "& Mrs (" Teachid ") &" ")
If not mrs2.eof then
' If the corresponding subject student has already had the result, then the mark is the examination
Response.Write "<td>" & Mrs ("Sub") & "has been tested (" & Mrs2 ("Score") & ")" & "</td>"
Else
' Otherwise provide radio select test subjects, each radio value contains information about the exam subjects
' (for example, the number of courses, course name, examination time and quantity)
Response.Write "<td><input name=selsub type=radio value=" & Mrs ("Teachid") & "," & Mrs ("Sub") & " , "& Mrs (" Testnum ") &", "& Mrs (" Testtime ") &" > "& Mrs (" Sub ") &" </td> "
End If
Set mrs2=nothing
Response.Write "<td>" & Mrs ("Teachname") & "</td>"
Response.Write "<td>" & Mrs ("Testtime") & "</td></tr>"
Mrs.movenext
Wend
' Close the database connection
Conn. Close
Conn2. Close
' Empty object variable
Set conn=nothing
Set conn2=nothing
%>
</table></p>
<p> <input id= "submit1" name= "Submit1" type= "Submit" value= "Confirmation" ></p>
</form>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.