| |

VerySource

 Forgot password?
 Register
Search
View: 818|Reply: 7

Make an exam system, and come across a question when submitting the answer ...

[Copy link]

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-5 16:10:01
| Show all posts |Read mode
What I did was an exam system. I did this. I used a Datalist to bind a table, and put four Radiobuttons in the table to bind the four answers in the database. Now the question is: for example The user selects the answer of A, so how to take out the answer of A directly and compare it with the correct answer stored in the database? The younger brother is talented, please look at it, and help solve this problem
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-5 19:36:01
| Show all posts
Just use RadiobuttonList.

RadiobuttonList.SelectedValue
Reply

Use magic Report

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-5 19:39:01
| Show all posts
5555555555 Do you guys help me, please, please
Reply

Use magic Report

1

Threads

10

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-1-6 14:24:01
| Show all posts
It's OK to press the first floor
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-6 17:30:11
| Show all posts
用的窗体还是web?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-6 23:54:01
| Show all posts
I have encountered similar problems before:
If you choose an option and compare it with the correct answer in the database, it will undoubtedly cause a page refresh problem. My solution is to use Ajax, and the user submits the data after selecting the answer. This effect may be better
Reply

Use magic Report

2

Threads

13

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-7 11:21:01
| Show all posts
You query the database, and when you generate the test questions, you store the answers in the data, and later, when you want to score, this is achieved:
if (Aswer [i] == Rad.SelectValue)
{
  TotalCourseNum = TotalCourseNum + 2; // Bonus points!
}
Reply

Use magic Report

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-7 20:36:01
| Show all posts
The method of using AJAX is better, it does not refresh the page, and does not leak the answer. The method upstairs, as long as you check the page code, you can see all the answers
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list