SQL Results?


I am trying to create a multiple choice test which will be available online soon, hopefully. The problem I am having is working out how I can use SQL to build the test, so the result of the test is added up and shown at the end of the test, the test taker can see their answers (right and wrong) and show the final results as a percentage at the end. I only started my apprenticeship 3 weeks ago so I am still not fully confident on some aspects of SQL, so any help would be much appreciated!


more ▼

asked Jan 13, 2012 at 02:24 AM in Default

avatar image

58 6 6 11

As with your first post, you need to offer up some of your work for us to help you with.

The idea here is to show us what you have and go from there. We will gladly assist, but not write the entire thing for you.

Jan 13, 2012 at 02:29 AM WilliamD

Thank you, We have not yet started ANY work on this, because before we start, we need to know whether it is possible to do it or not, and a way to do it, so that we can feed back to the company which we are building it for! :)

Jan 13, 2012 at 02:38 AM Amber-Rose
(comments are locked)
10|1200 characters needed characters left

3 answers: sort voted first

Ah, we didn't talk about grading the tests last time did we? When you set up the database you'll need to mark some of the answers as correct in the table that defines answers. Then, when you have all the test takers answers, you can join back to the answers table to correlate between correct and wrong answers on each question.

In short, yes, it's doable.

Just remember that SQL Server can return the results. To make the formatting pretty you need to use something else, either code or a SQL Server Reporting Services report or something.

more ▼

answered Jan 13, 2012 at 02:47 AM

avatar image

Grant Fritchey ♦♦
137k 20 44 81

Thanks! HUGE help!

Jan 13, 2012 at 02:54 AM Amber-Rose
(comments are locked)
10|1200 characters needed characters left

Is there a business process that represents the work that the new system is meant to facilitate? I think you might benefit from reviewing what you are trying to achieve, including the content of whatever data sources there are (questions, answer options, etc) and that will start to inform the database and system design process.

more ▼

answered Jan 13, 2012 at 03:21 AM

avatar image

Fatherjack ♦♦
43.8k 79 99 118

Beneath is an image of how the database looks already, by using this, could you demonstrate how we would be able to make the database recognise which answers the test taker has answered wrong or right?

I can explain the table in more detail if required!

Thanks! :)


Jan 13, 2012 at 03:40 AM Amber-Rose
(comments are locked)
10|1200 characters needed characters left

You can create one question master table to join with user transaction table to get correct or incorrect result set.

CREATE TABLE TEST_Question(Ques_NO. INT NOT NULL IDEINTITY(1,1), Question VARCHAR(MAX) NOT NULL,Answer1 VARCHAR(100),Answer2 VARCHAR(100),Answer3 VARCHAR(100),Answer4 VARCHAR(100), Correct_Answer VARCHAR(100))

more ▼

answered Jan 13, 2012 at 03:00 AM

avatar image

1.4k 90 93 96

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jan 13, 2012 at 02:24 AM

Seen: 1259 times

Last Updated: Jan 13, 2012 at 02:24 AM

Copyright 2017 Redgate Software. Privacy Policy