Posted 24 July 2006 - 12:40 AM
Okay, the crux of the matter is this:
At the college here we teach Japanese. The application presents a sentence (in japanese) with a certain part of the sentence underlined, which is in effect a question. There are 20 questions. Each user gets their own table created, $username, and each users table has the columns 'actual_sentence', 'correct_answer', 'your_answer'. This is repeated 20 times so we end up with 'actual_sentence1', 'correct_answer1', 'your_answer1'.......'actual_sentence2', 'correct_answer2', 'your_answer2'...all the way up to 20. The questions (sentences) are displayed one at a time in a random sequence. The total pool of questions is over 500, but I am selecting 20 at one time, at random.
Lets suppose a user gets a final score of 16 correct and 4 incorrect. I want to let the user resit their incorrectly answered questions in the same way. ie to display the 4 incorrect questions, at random, one at time....until eventually they end up with all questions correctly answered. They can then choose another test, which will reset the fields to 'NULL' before re-populating them with another 20 questions.
I know this would be more simple if I made 20 fields, rather than 20 columns, but for many reasons it can't be that way.
So at the end of the test, I want to allow the users to re-sit their wrong answers. I have all the info in the table, it's just a matter of getting the info out!!
In laymans terms, I want to select * where 'your_answer1 != correct_answer1' AND WHERE 'your_answer2 != correct_answer2 etc etc.'
In the end, I want to be able to show the incorrectly answered questions, at random one at a time, and let the user answer them until eventually (hopefully) they have 100% correct. Then they can choose a new test.
I'll go and have a coffee and a think :-)