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

📄 inst_view_graded_test.asp

📁 A java project in e-bussiness module.
💻 ASP
字号:
<html>
<head>
<% help_location = "view_tests" %>
<!-- Author: Brad Pierce -->
<title>Teacher View Incorrect Answers</title>
<link href="../instructor/inst_basics.css" rel="stylesheet" type="text/css">
<table border='0'><tr><td><img src="../images/netest.png"></td><td width='5%'></td><td width='100%'><br><h2>View Incorrect Answers</h2></td></tr>

<!-- #include file="../inst_navbar/teacher_navbar_print.inc" -->

<% 
   If not Session("inst_authenticated") Then
      Response.Redirect("inst_login.asp")
   End If
%>
</head>

<TD valign='top'><br>
<body>
<%
   dim oConn   ' Connection Object
   dim oRS     ' Record Set Object
   Set oConn=Server.CreateObject("ADODB.connection")
   set oRS=Server.CreateObject("ADODB.recordset")
   
   oConn.Open "DSN=sd2db; UserID=Admin; pwd=netest"
    
   if not session("student_test_printed") then
      session("selected_student") = request("selected_student")
   end if
   
if session("selected_student") <> "" then
   sqltext = "SELECT * FROM Student WHERE Student_Code='" & session("selected_student") & "'"
   oRS.Open sqltext, oConn
   
   response.write "<p><h4><img src='../images/checkmark.gif'>All completed tests for " & oRS("Student_FirstName") & " " & oRS("Student_LastName") & ":</h4></p>"
   oRS.Close
   
   sqltext = "SELECT * FROM CompletedTests,Test WHERE Student_Code='" & session("selected_student") & "' AND " & _
             "CompletedTests.Test_Code = Test.Test_Code AND " & _
			 "Test.Course_Code='" & session("course") & "' AND Test.Section_Code='" & session("section") & "' ORDER BY Test.Test_Code"
   oRS.CursorLocation = 3 'adUseClient
   oRS.Open sqltext, oConn
   record_count = oRS.RecordCount
   oRS.Close
   
   if record_count then
      ' print drop-down list of all completed tests
%>
      <FORM METHOD="post" name="form1" ACTION="inst_view_graded_test.asp">
      <P><SELECT NAME='selected_test' onchange='document.form1.submit();' SIZE='3'>
<%
      sqltext = "SELECT * FROM CompletedTests,Test WHERE Student_Code='" & session("selected_student") & "' AND " & _
                "CompletedTests.Test_Code = Test.Test_Code AND " & _
		    	"Test.Course_Code='" & session("course") & "' AND Test.Section_Code='" & session("section") & "' ORDER BY Test.Test_Code"
      oRS.Open sqltext, oConn

      Do While Not oRS.EOF
         Response.Write "<OPTION VALUE='" & oRS("Test_Code") & "'>"
	     Response.Write oRS("Test_Name") & "</OPTION>"
	     oRS.MoveNext
      Loop   
   
      oRS.Close
   
      session("student_test_printed") = TRUE
   else
      response.write "<font color='#003333'><b>&nbsp&nbsp&nbsp&nbsp No Completed Tests</b></font><br><br>"
%>
      <hr><br>
      <table border='0'><tr><td><img src="../images/question.gif"></td><td><font color='#003333'><b>Finished?</b></font></td><td><a href='inst_home.asp'>Return to teacher home page.</a></td></tr>
      <tr><td><img src="../images/question.gif"></td><td><font color='#003333'><b>Test contains errors?</b></font></td><td><a href="inst_select_graded_test.asp">View other students' incorrect answers.</a></td></tr></table>
<%   
   end if
%>
   </SELECT></FORM></P>
   
<%
   if request("selected_test") <> "" then
      sqltext = "SELECT * FROM CompletedTests WHERE Test_Code=" & request("selected_test") & " AND " & _
	            "Student_Code='" & session("selected_student") & "'"
      oRS.Open sqltext, oConn
      incorrect_answers = oRS("Incorrect_Answers")
      oRS.Close
   
      sqltext = "SELECT Test_Name FROM Test WHERE Test_Code=" & request("selected_test") & ""
	  oRS.Open sqltext, oConn
      response.write "<br><h3>" & oRS("Test_Name") & "</h3>"
	  oRS.Close
	  
      if incorrect_answers = "0" then
         response.write "<font color='#003333'><b>&nbsp&nbsp&nbsp&nbsp No Incorrect Answers</b></font><br><br>"
	     'response.end
      else
         FoundPipe = instr(incorrect_answers, "|")
	  
	     sqltext = "SELECT * FROM Question WHERE Test_Code=" & request("selected_test") & " AND " & _
		           "Question_Number=" & left(incorrect_answers, FoundPipe - 1) & ""
	     oRS.Open sqltext, oConn
		 session("multi_visit") = FALSE
%>
         <!-- #include file="inst_view_correct_answers.asp" -->
<%
         oRS.Close
	  
         question_number = false
	     answer = true
	  
	     session("multi_visit") = TRUE
	     do while FoundPipe < len(incorrect_answers)
	        NextPipe = instr(FoundPipe + 1, incorrect_answers, "|")

		    if NextPipe then
		       if answer = true then
			      response.write "<td align='center'>" & mid(incorrect_answers, FoundPipe + 1, NextPipe - FoundPipe - 1) & "</td></tr>"
			   end if
			
			   if question_number = true then
			      sqltext = "SELECT * FROM Question WHERE Test_Code=" & request("selected_test") & " AND " & _
				            "Question_Number=" & mid(incorrect_answers, FoundPipe + 1, NextPipe - FoundPipe - 1) & ""
			      oRS.Open sqltext, oConn
%>
                  <!-- #include file="inst_view_correct_answers.asp" -->
<%
                  oRS.Close
			   end if			
		    else
		       response.write "<td align='center'>" & right(incorrect_answers, len(incorrect_answers) - FoundPipe) & "</td></tr></table><br><br>"
		       exit do
		    end if
		 
		    if answer = true then
		       answer = false
		    else
		       answer = true
		    end if
		 
		    if question_number = true then
		       question_number = false
		    else
		       question_number = true
		    end if

		    FoundPipe = NextPipe
	     loop
      end if
%>
      <hr><br>
      <table border='0'><tr><td><img src="../images/question.gif"></td><td><font color='#003333'><b>Finished?</b></font></td><td><a href='inst_home.asp'>Return to teacher home page.</a></td></tr>
      <tr><td><img src="../images/question.gif"></td><td><font color='#003333'><b>Test contains errors?</b></font></td><td><a href="inst_select_graded_test.asp">View other students' incorrect answers.</a></td></tr></table>
<%   
   END IF
ELSE
  response.write "<div id=warning><img src='../images/warning.gif'>You must select a student for which to view grades!</div><br>"
  response.write "<div id=warning><u>Hit the back button on your browser to make corrections.</div>"
END IF
%>
</td></tr>

<tr><td></td><td colspan='2'><br><br><hr size='2' color='#000000'>
<font size='1'>Powered by Netest</font>
</td></tr></table>
</body>
</html>

⌨️ 快捷键说明

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