当前位置:网站首页>基于C#实现的学生考试系统
基于C#实现的学生考试系统
2022-07-26 12:54:00 【biyezuopinvip】
学生考试系统
一、创建数据库(examination),建数据表
- 选择题数据表:choose
| 字段名称 | 数据类型 |
|---|---|
| ID | 自动编号 |
| title | 文本 |
| xuanA | 文本 |
| xuanB | 文本 |
| xuanC | 文本 |
| xuanD | 文本 |
| answer | 文本 |
- 判断题数据表:pdt
| 字段名称 | 数据类型 |
|---|---|
| ID | 自动编号 |
| title | 文本 |
| answer | 文本 |
- 简答题数据表:jdt
| 字段名称 | 数据类型 |
|---|---|
| ID | 自动编号 |
| title | 文本 |
| answer | 文本 |
- 填空题数据表:tkt
| 字段名称 | 数据类型 |
|---|---|
| ID | 自动编号 |
| title | 文本 |
| answer | 文本 |
- 编程题数据表:bct
| 字段名称 | 数据类型 |
|---|---|
| ID | 自动编号 |
| title | 文本 |
| answer | 文本 |
二、创建网站:文件——新建网站。
新建登录窗体,各种考试题型的“web窗体”(增删改查)以及学生做题的窗体等。具体窗体名如下:

三、为各窗体添加功能代码:
- 筛选:select……from
- 删除:delete ……from
- 插入:insert into……values
- 更新:update………set
登录窗体

登录代码:
- 连接数据库:
string strconn = "Provider=Microsoft.Ace.oledb.12.0;data source=" + Server.MapPath("~/app_data/examinatiion.accdb"); OleDbConnection conn = new OleDbConnection(strconn);
conn.Open();
- 登录时需要判断该学生是否存在,如果存在,要把该学生的基本信息传递到考试的页面。这时需要用到:myread.hasRows 和Session

- 跳转到考试页面:

各题型的添加窗体



- 学生考试的主窗体:

学生考试的所有窗体都用datalist控件来绑定数据,绑定数据可以用只显示的Eval("ID”)或者可以显示和修改的Bing(’’ID”)
- 实例化:RadioButtonList和TextBox

- 筛选数据表的前几条记录并放到datalist控件中让学生答题:关键字top

正常情况下每一次刷新页面记录都不会被保存在页面上,如可让已存在的记录显示在页面上?方法如下:
刷新页面是需要判断数据表里是否存在相关的内容,如果存在则在刷新的同时显示出来。
单选按钮的情况:

文本框的情况:

改卷的页面:改卷按钮的功能是用试题的正确答案与考生做题的答案来作比较,如果相等则加一分,否则不扣分
部分效果图

边栏推荐
- Kubernetes Flannel:HOST-GW模式
- 火山引擎云上增长方案全景:30+方案齐出,兵发优势领域
- 父组件访问子组件的方法或参数 (子组件暴漏出方法defineExpose)
- Understand test.py in gaitset
- Kubernetes APIServer 限流策略
- 子组件触发父组件自定义事件(defineEmits):子组件传值给父组件
- Vs code set the method of ctrl+s saving and automatic formatting
- Example of establishing socket communication with Siemens PLC based on C # open TCP communication
- 食品安全 | 这些常见食物小心有毒!速查自家餐桌
- LCD notes (5) LCD driver framework_ Use device tree
猜你喜欢

一款超好用的神器Apifox,甩 Swagger 几条街...(荣耀典藏版)

Kubelet CRI 容器运行时

高通再次「押宝」中科创达,挑战智能驾驶软硬件全栈方案

【TypeScript】TypeScript常用类型(下篇)

A super easy-to-use artifact apifox, throw swagger a few streets... (glory Collection Edition)

Kubernetes----PV和PVC的生命周期简介
![[5gc] what is 5g slice? How does 5g slice work?](/img/8c/52ba57d6a18133e97fa00b6a7cf8bc.png)
[5gc] what is 5g slice? How does 5g slice work?

Huawei recruited "talented teenagers" twice this year; 5.4 million twitter account information was leaked, with a selling price of $30000; Google fired engineers who believed in AI consciousness | gee

若有声明”int x=5,y=1;”,则表达式x<y?x++:y++的结果是:
![[typescript] typescript common types (Part 1)](/img/80/5c8c51b92d3a9d76f38beba7be0aa6.png)
[typescript] typescript common types (Part 1)
随机推荐
Reflection, an implementation of automatic repeated call interface
Redis realizes single sign on -- system framework construction (I)
LCD notes (4) analyze the LCD driver of the kernel
Kubernetes APIServer 限流策略
历史上的今天:IBM 获得了第一项专利;Verizon 收购雅虎;亚马逊发布 Fire Phone...
Remote IP debugger (Practical dry goods)
2022 employment season! Adobe helps creative industry workers break through the shackles of skills and return to the source of ability
Yolov7 training dangerous goods identification pytorch
LCD笔记(6)LCD驱动程序框架_配置引脚
数据库组成视图
Flutter textfield sets the height and automatically wraps lines, and the rounded border removes the underline
如何组装一个注册中心?
MySQL可以自定义变参存储函数吗?
华为超融合FusionCube解决方案笔记
Guys, please ask me, I have configured CDC to connect to Oracle according to the document, and I always run error reports and can't find the class validstione
JDBC从连接池获取连接(Druid连接池)
Backtracking - 46. Full arrangement
二叉树的初阶笔记
pomerium
Transformer dominates the world? Depth wise conv has something to say