Let’s say, for example, this is a quiz where the answers are already loaded into a database from different students. Inside of the table with various student entries containing various student’s answers there is a row “masterentry” with all of the correct answers.
What I would like to do is code a button that will pull the master row on click and compare every other row against it. Starting with the first row, every time the column matches the master entry 1 point is assigned to a declared integer. When the row has completely been read the integer is stored in a “totalpoints” column. Then it moves on to the next row of answers.
I hope this makes sense the way I worded it, if there is an easier way to go about it I am open to suggestions. I don’t really need any help establishing the connection to the sql database. Any help would be greatly appreciated, thanks in advance for anyone’s time. I can provide more details if it would be helpful.
Just a rough guess based on vague idea of schema. You would just call this query from .NET (preferably stored in stored procedure, passing in a
@QuizID) unless you really want to do it less efficiently by looping after pulling all of the data to the client…There may be some shortcuts here based on the data types. E.g. if the quiz is true/false there are some little tricks you can do to reduce the
...part.