文章导航PC6首页软件下载单机游戏安卓资源苹果资源

pc软件新闻网络操作系统办公工具编程服务器软件评测

安卓新闻资讯应用教程刷机教程安卓游戏攻略tv资讯深度阅读综合安卓评测

苹果ios资讯苹果手机越狱备份教程美化教程ios软件教程mac教程

单机游戏角色扮演即时战略动作射击棋牌游戏体育竞技模拟经营其它游戏游戏工具

网游cf活动dnf活动lol周免英雄lol礼包

手游最新动态手游评测手游活动新游预告手游问答

您的位置:首页网页设计ASP实例 → 利用ASP+XML架设在线考试系统 

利用ASP+XML架设在线考试系统 

时间:2004/11/7 3:01:00来源:本站整理作者:蓝点我要评论(0)

利用ASP + XML 架设在线考试系统



<-------------此程序非本人原创-------->

  

使用这个在线的考试系统,我们能处理任何类型在线测试。 尽管我们一般是用传统方式实现,读者非常希望将。



如果从总体上考虑。 所有问题都储存在服务器( 它可能在数据库里) 里面的的xml 文件里。 用户准备花费考试,然后用户测试的通体将通过微软的XML HTTP 组件传送到浏览器。 使用同一个XML HTTP 组件,每当用户请求一个问题的时候,那些问题内容被从服务器解释并且显示在页上。 对用户的任何问题,你所选择的答案会被储存在客户端。  







一次考试的持续时间是5 分钟。 没有回答不了,你可以使用NEXT回答下洋问题。 一旦用户启动考试,所有问题目录将来自服务器。 所给问题的Id 每请求到服务器以来在内目录在客户拿给并且给服务器派内储存。 服务器将返回问题内容,符合问题Id,从xml 文件。 当用户选择任何一个答案时,体制将在那些应答表里储存和在在客户边里的选择表里。 用户最后已经选择的正确的答案,应答表用来并不地检查。 选择表在那里是以便系统将自动选择用户已经选择了的选择 ( 例如用户点击以前的按钮) 考试将结束或者用户点击终结按钮或者首先来,时间( 例如5 分钟) 结束。 关于终结,系统将计算并不右边答案的并且展示它。 那些以下的文件被在在线的考试系统里使用:



OLExam.html











OnLine Exam




















Relax...! The duration of this exam is 5 minutes.




There is no order to answer a question. You may use Next as

well as Previous button to get a question to answer.








onClick="init()">



























OLExam.asp





<%

Response.expires = 0

'create an instance of MS XMLDOM Object

'and load the QBank.xml file where all the questions are.



set obj = server.createobject("Microsoft.XMLDOM")

obj.async = false

obj.load(Server.MapPath("QBank.xml"))



'very first request from the client

if trim(request("Action")) = "Start" then

  'set no of questions per exam

  Dim NoQ,TotalQ

  

  NoQ = 5 'set no less than the totalquestions

  

  'count no of questions in the xml file

  '( or from database)

  TotalQ = obj.selectNodes("data/question").length



  Dim aQuest(),temp,isExist, strQ

  ReDim aQuest(0) 'to store the question ids

  

  'generate (=NoQ) question ids randomly

  while ubound(aQuest) < NoQ

    isExist = false

    temp = Int((TotalQ * Rnd) + 1)

    for i = 1 to ubound(aQuest)

      if aQuest(i) = temp then

        isExist = true

        exit for

      end if

    next

    if Not isExist then

      Redim Preserve aQuest(ubound(aQuest)+1)

      aQuest(ubound(aQuest)) = temp

      strQ = aQuest(i) & "," & strQ

    end if

  wend

  

  'remove the last comma ',' from strQ

  strQ = left(strQ,len(strQ)-1)

  

  'send the question in the strQ to the client

  response.write strQ

  

'all further requests - after the first request

elseif trim(request("Action")) = "NextQ" then

  'fetch the question from the XML Object

  'and form the output string

  temp = "data/question[@id=" & trim(request("QNo")) & "]"



  set Node = obj.selectSingleNode(temp)



  strXML = ""

  strXML = strXML & ""

  strXML = strXML & Node.selectSingleNode("qtext").text

  strXML = strXML & "
"

  strXML = strXML & ""

  strXML = strXML & Node.selectSingleNode("answer").text

  strXML = strXML & "
"



  set Node = Node.selectNodes("choices/choice")



  for i = 0 to Node.length-1

    strXML = strXML & ""

    strXML = strXML & Node.item(i).text

    strXML = strXML & "
"

  next



  strXML = strXML & "
"



  'send the output to the client

  Response.Write (strXML)

end if

%>











QBank.xml







  

    What does KB stand for?

    

      Kilo Bits

      Key Board

      Kilo Bytes

      None

    


    3

  


  

    CPU stands for

    

      Central Processing Unit

      Central Power Unit

      Core Processing Unit

      Core Power Unit

    


    1

  


  

    1 KB equals

    

      1000 Bytes

      1024 Bytes

      1000 Bits

      1024 Bits

      Nothing

    


    2

  


  

    RAM is

    

      Random Access Modifier

      Primary Memory

      Secondary Memory

      Read And Modify

    


    2

  


  

    Hard Disk is

    

      Hard to break

      Primary Memory Storage

      Temporary Memory Storage

      Secondary Memory Storage

    


    4

  


  

    Computer Monitor is used

    

      To monitor activities

      To control Computer

      As display unit

      None

    


    3

  


  

    XML stands for

    

      Extended Markup Language

      Extended Model Language

      Extensible Markup Language

      Extensible Model Language

    


    3

  


  

    ASP stands for

    

      Active Server Page

      Application Service Provision

      As Soon as Possible

      All

    


    1

  









相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 迅雷新手完全入门手册 asp下面javascript上传图片限制格式大小方法告诉大家网页弹出窗口应用总结ASP常见错误类型大全asp常见错误分析和解决办法

人气排行 总是弹出visual studio 实时调试器 三种解决SQLSERVER存储过程及调用详解Asp获取真实IP地址ASP中连接Mssql的几种方法一个简单好用的UBB编辑器(含代码)如何用Split将字符串转换为数组并获取数组下ASP防止表单重复提交的办法告诉你免费的简单聊天室源代码