Network examination Room (3) (turn) sevalue.asp

Source: Internet
Author: User
Tags access database
<%@ Language=vbscript%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
</HEAD>
<BODY>
<%
' After submitting the answer, first of all, the answer to the statistics, how many questions
' How many points should you get, and then write the statistics to table score (stid,score,teachid,sub),
' Then delete the corresponding field in the table Tbanswer that records the student answer
Dim Rightnum ' The variable records the number of correct questions
Dim totalques ' The variable records the number of total topics done
Dim Getscore ' Students deserve the number of points
Set Mcmd=server. CreateObject ("Adodb.command")
Mcmd. activeconnection= "Dsn=testsys"
Mcmd.commandtext= "Right"
The CommandText property of the Command object is right for the stored query procedure, which is designed in an Access database with
' Parameter StudentID query right
Set Mprama=mcmd. CreateParameter ("StudentID", 200,1,8,session ("Stid"))
' Create parameter StudentID, pass this parameter to the query stored procedure
Mcmd. Parameters.Append Mprama
Set Mrs=mcmd. Execute
If not mrs.eof then
Rightnum=mrs ("Rightnum")
End If
Mcmd. Parameters.delete "StudentID"
Set mprama=nothing
mcmd.commandtext= "DELETE * tbanswer WHERE stid= '" & Session ("Stid") & "'"
Mcmd. Execute
' Delete records that are stored in the database table Tbanswer
Set mrs=nothing
Getscore=rightnum*100/session ("Testnum")
' The following is to write fractions into table score
Mcmd. commandtext= "INSERT into score (Stid,score,sub,teachid) VALUES ('" & Sessions ("Stid") & "', '" & Getscore & " ', ' & Session ("SubName") & "', '" & Session ("Teachid") & "')"
Mcmd. Execute
Set mcmd=nothing
Session. Abandon
%>
<p align=center><strong><font Color=crimson face= ""
Size=4> Score Statistics </FONT></STRONG></P>
<p align=center>
<table border=1 cellpadding=1 cellspacing=1 width=75%>
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.