x

SQL Results?

Hello!

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!

Thanks!
more ▼

asked Jan 13 '12 at 02:24 AM in Default

Amber-Rose gravatar image

Amber-Rose
58 5 6 8

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 '12 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 '12 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 '12 at 02:47 AM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
91k 19 21 74

Thanks! HUGE help!
Jan 13 '12 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 '12 at 03:21 AM

Fatherjack gravatar image

Fatherjack ♦♦
41.3k 73 77 107

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! :)

http://www.print4tomorrow.co.uk/assets/ExamQuestion_dbImage.jpg
Jan 13 '12 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 '12 at 03:00 AM

Amardeep gravatar image

Amardeep
1.3k 84 88 89

(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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x673
x22
x7

asked: Jan 13 '12 at 02:24 AM

Seen: 927 times

Last Updated: Jan 13 '12 at 02:24 AM