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