如何将测验问题的结果注册到数据库中 [英] how can the result of a quiz question can register on database

查看:60
本文介绍了如何将测验问题的结果注册到数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是问题



登录,在ac#quiz应用程序中使用数据库,我已登录,并对测验进行测试,最后是什么将结果发送到人员数据库的代码......我应该怎么做..



我应该在数据库中创建哪个表,以及什么是代码或代码应该我在c#应用程序中做...

我不知道你是否理解我或我明确的问题:/ ...

解决方案

< blockquote>创建一个包含列的表:

 ID  -  Int,Identity很好,这用作唯一的行标识符
UserID链接到用户表并标识回答问题的用户。 (外键)
QuestionID链接到问题表以确定用户正在回答哪个问题(外键)
给出答案 - 取决于系统的其余部分是什么。
Titmestamp - DateTime。这是可选的,但我会把它包括在内,因为我就是这样......





可能你有一个测验表问题表引用回来。



然后,当他回答问题时,你在表格中创建一个新行,引用用户,问题和答案(以及时间戳,以便他回答时知道。)


this is the question

Logged in, with database in a c# quiz application, im logged in, and make a test of a quiz, in the end whats the code of getting the result to a person database... what should i do..

what table should i make in the database, and whats for or code should i do in the c# application...
I dont know if you understand me or im clear with the question :/ ...

解决方案

Create a table that has columns:

ID - Int, Identity is fine, this serves as a unique row identifier
UserID which links to the User table and identifies the user answering the question. (Foreign key)
QuestionID which links to the table of questions to identify which question the user is answering (Foreign key)
Answer given - depends on rest of your system what this is.
Titmestamp - DateTime. This is optional, but I'd include it because I'm like that...



Probably, you have a Quiz table which the Questions table refers back to.

Then, when he answers a question you create a new row in the table which refers to the user, the question, and his answer (and timestamps it so you know when he answered).


这篇关于如何将测验问题的结果注册到数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆