• RalphWilson (8/30/2010)


    A "skipped" question is one that has not been answered but has a Question Number that is lower than the highest Question number that has been answered.

    Why not just store the results as the questions are asked?

    Table_Answers(

    Answerid int identity(1,1) PRIMARY KEY,

    Testid int NOT NULL,

    questionid int NOT NULL,

    TestAnswer int,

    TestScore int NOT NULL)

    As the questions are asked and answered/skipped just store either

    1 in testscore if it's correct

    -3 in testscore if it's wrong

    -1 in testscore if it's skipped

    Then left join Table_Answers to Table_questions if you care about the unanswered questions.

    If Testanswer can be more than multiple choices throw in a varchar(max) or nvarchar(max) column for the free form answers... but those will be harder to grade via SQL anyway.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]