Some experiences of the online examination system

Source: Internet
Author: User
Tags bind
Note: When asp.net + sqlserver2000 is used, the question is only for multiple choice questions.
I. Database design
1. There is a table in the question.
Fields include: ID (ID field), question content, and answer
2. An option exists in a table.
Fields include: ID (ID field), Question ID, and display order
II. Page design
The personnel will not talk about the login or anything, but the key point is to talk about the problem.
1. If questions are randomly asked, you can use order by newid () when querying questions in the database ()
For example, select * from tablename order by newid ()
After reading the question, search for the question option in the option table based on the question ID, and then bind it. At the same time, you need to read the answer and bind it to the page.
If the option is single-choice, you can bind a radiobuttonlist, and use checkboxlist for the check.
After binding, a session ["time"] is generated to save the time DateTime. Now ().
2. if the question is fixed and the answer to each question is the same, it is best to put the question and option in static display on the page, or read the question and option from the database and put it in a static variable (for example: APPLICATION), which greatly improves the efficiency and reduces the pressure on the server.
3. Record the submission time during submission and subtract from the session ["time"] generated on the page to obtain the answer time. Compare the submitted answers with the standard answers saved on the page, calculate the correct answer rate and the number of correct answers, and save the answers to the database together with the answer time.
Some client verification is required for submission. The following is a verified javascript code.
Function CheckItem ()
{

Alchk = 0; // used to save the number of answers
For (k = 0; k <44; k ++) // 44 indicates there are 44 questions
{
Chkc = 0; // There are several choices in the answer to each question. Here I use checkbox. If radiobottonlist is used, only one choice is allowed.
For (j = 0; j <4; j ++) // 4 indicates that each question has four options.
{
Strid = 'dlquestion _ ctl '+ k +' _ dlSelection _ ctl '+ j +' _ ckSelection '; // obtain the ID of the option on the page

If (document. getElementById (strid). checked) // if selected
{
Chkc ++;
}

}
If (chkc> 1) // indicates more than one option
{
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.