ImageVerifierCode 换一换
格式:DOCX , 页数:17 ,大小:211.65KB ,
资源ID:28200397      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/28200397.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(数学12129web实验7应用AJAX设计限时在线考试系统石祖极.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

数学12129web实验7应用AJAX设计限时在线考试系统石祖极.docx

1、数学12129web实验7应用AJAX设计限时在线考试系统石祖极实验7 应用AJAX设计限时在线考试系统成绩专业班级 数学121 学号 201212010129姓名 石祖极 报告日期 2014.11.25 实验类型:验证性实验 综合性实验 设计性实验实验目的:1) 掌握基本ASP.NET AJAX基本控件的属性设置及使用方法;进一步理解页面局部更新的重要性;了解ASP.NET AJAX扩展控件的使用方法。2) 掌握Timer控件的主要属性、方法和事件,能设计出具有定时功能的应用程序。实验要求:设计一个能限制时间的在线考试系统,系统具有如下功能: 1) 系统支持最多100道的单选题(4选1)。2

2、) 考试题目存贮在单独的文本文件内(App_Data/test.txt)。如图7-1所示,每题以题目内容、正确答案、4个选项为顺序逐行书写。3) 自动生成如图7-2所示的考试成绩,存放在App_Data/result.txt 文件中 图7-1 试题内容 图7-2 自动生成的考试成绩表4) 考生访问网站时, 首先看到的是如图7-3所示的登录界面,在输入姓名、准考证号后单击开始考试按钮,系统对用户输入的姓名、准考证号的合法性进行检测,要求“姓名”、准考证号不得为空;准考证号必须由六位数字组成,且考生不是重复考试(成绩表中没有准考证号的记录)。未通过检测将显示相应的出错提示信息。通过检测后进入进入如

3、图7-4的答题界面。在答题界面的右上角始终显示一个倒计时的“剩余时间”指示。5) 考生答题结束后,单击答题页面下方的“提交试卷”,屏幕显示如图7-5所示的本次考试成绩,并将该成绩保存到App_Data/result.txt文件中实验步骤提示1. 设计登陆页面(设计步骤见实验指导书第82页)2. 设计答题界面(设计步骤见实验指导书第83页)3. 设计显示成绩页面图7-3 登录系统界面 图7-5 显示考试成绩 图7-4 答题界面 实验报告:根据实验情况和结果(网站页面运行调试情况、通过超链接实现页面跳转情况、最终各个页面运行效果情况)撰写并递交实验报告。实验总结:学会了.; 掌握了.; 训练了.;

4、 发现了.; 实验中.有待提高。电子报告word文件命名规则:专业班级学号后两位实验X姓名.doc, 如信息123班学号为201212030315的郭海涛同学实验7报告word文件命名则应是:信息123-15-实验7-郭海涛.doc, 其中 .doc是Word文件扩展名。参考程序程序代码:Default.aspx .auto-style1 width: 100%; .auto-style2 text-align: center; .auto-style3 height: 24px; .auto-style4 width: 275px; .auto-style5 height: 24px; wi

5、dth: 275px; 在线模拟考试系统 姓名:   准考证号: Default.aspx.csusing System.IO;using System.Text;using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class _Default : System.Web.UI.Page protected void Page_Load(obje

6、ct sender, EventArgs e) this.Title = 在线模拟考试系统; TextName.Focus(); protected void ButtonStart_Click(object sender, EventArgs e) /如果未输入姓名或准考证号,弹出出错信息提示信息框,并结束运行 if (TextName.Text = | TextNo.Text = ) Response.Write(alert(请填写完整的考生信息!);); return; string FilePaht = Server.MapPath(app_Data/result.txt); Stre

7、amReader sr = new StreamReader(FilePaht,Encoding.GetEncoding(gb2312); while(!sr.EndOfStream) /循环读取文件的每一行,直到文件结束 /从文本文件中读取1行,取出前6个字符(准考证号数据) string StuNo=sr.ReadLine().Substring(0,6); /如果成绩表中存在考试号,显示出错信息框,并结束运行 if(StuNo.Trim()=TextNo.Text.Trim() Response.Write(alert(不能重复参加考试!);); return; sr.Close();

8、Sessionname=TextName.Text; Sessionno=TextNo.Text; Response.Redirect(Exam.aspx); Exam.aspx .auto-style1 width: 100%; .auto-style2 height: 24px; 限时在线考试     Exam.aspx.csusing System.IO;using System.Text;using System;using System.Collections.Generic;using System.Linq;using System.Web;using Sys

9、tem.Web.UI;using System.Web.UI.WebControls;public partial class Exam : System.Web.UI.Page TimeSpan t1=new TimeSpan(0,0,1); static stringAnswer=new string100; static RadioButtonListrbtnList=new RadioButtonList100; protected void Page_Load(object sender, EventArgs e) if(Sessionname=null|Sessionno=null

10、) Response.Redirect(Default.aspx); if(!IsPostBack) LabelName.Text=考生姓名:+Sessionname.ToString(); LabelNo.Text=准考证号:+Sessionno.ToString(); TimeSpan t=new TimeSpan(0,3,0); Sessiontime=t; LabelTime.Text=剩余时间:+string.Format(0:hh:mm:ss,t)+; string FilePaht=Server.MapPath(App_Data/test.txt); StreamReader s

11、r=new StreamReader(FilePaht,Encoding.GetEncoding(gb2312); int num=1; while(!sr.EndOfStream) Label lbl=new Label(); RadioButtonList rbtn=new RadioButtonList(); rbtnListnum=rbtn; lbl.Text=+num.ToString()+.+Server.HtmlEncode(sr.ReadLine()+; Answernum=sr.ReadLine(); num=num+1; for(int j=1;j=4;j+) rbtn.I

12、tems.Add(sr.ReadLine(); Panel1.Controls.Add(lbl); Panel1.Controls.Add(rbtn); sr.Close(); protected void Timer1_Tick(object sender, EventArgs e) TimeSpan t=(TimeSpan)Sessiontime; t=t-t1; LabelTime.Text=string.Format(0:hh:mm:ss,t); Sessiontime=t; LabelTime.Text=剩余时间:+string.Format(0:hh:mm:ss,t)+; if(t

13、.Ticks=0) int result=0; for(int i=1;i100;i+) if(Answeri!=null) if(Answeri=Convert.ToString(char)(rbtnListi.SelectedIndex+65) result=result=1; Response.Redirect(ShowReult.aspx?r=+result); protected void ButtonOK_Click(object sender, EventArgs e) int result=0; for(int i=1;i100;i+) if(Answeri!=null) if

14、(Answeri=Convert.ToString(char)(rbtnListi.SelectedIndex+65) result=result=1; Response.Redirect(ShowReult.aspx?r=+result);protected void ButtonStart_Click(object sender, EventArgs e)ShowResult.aspx ShowResult.aspx.csusing System.IO;using System.Text;using System;using System.Collections.Generic;using

15、 System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class Default2 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Response.Write(你本次考试得分: + Request.QueryStringr); string info=Sessionno.ToString()+ +Sessionname.ToString()+ +Reque

16、st.QueryStringr+ +DateTime.Now.ToString(); string FilePath=Server.MapPath(App_Data/result.txt); string appendText=info+Environment.NewLine; File.AppendAllText(FilePath,appendText); Sessionname=null; Sessionno=null; Sessiontime=null; 调式界面:1.Default.aspx2.Exam.aspx3.运行界面实验总结:通过本次试验我掌握基本ASP.NET AJAX基本控件的属性设置及使用方法;进一步理解页面局部更新的重要性;了解ASP.NET AJAX扩展控件的使用方法。掌握Timer控件的主要属性、方法和事件,能设计出具有定时功能的应用程序。在调试的过程中,总是不能出现理想的界面。反复思考揣摩,发现有些控件没有关联上,还有些代码的大小写不正确。经过调试。最终出现了预想的结果。

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1