Author Topic: Weighting Results  (Read 1863 times)

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Weighting Results
« on: August 14, 2009, 01:32:12 PM »
I need some help thinking through the best process do this...

basically, I have a pool of a few hundred exam questions of which I pick 35 to generate an exam.  This in itself would be pretty easy:
Code: [Select]
SELECT * FROM question_pool ORDER BY rand() LIMIT 35
but its a little more complicated.  There are 10 sections of the exam, each with its set of pooled questions.  Some sections pull 6 questions from the pool, others only 2 or 3.   This two is still petty simple, I just use several queries, like:
Code: [Select]
SELECT * FROM question_pool WHERE section = 1 ORDER BY rand() LIMIT 6 and repeat that changing the section id and the limit number.
(I'm physically making 10 different queries - I know I could just make one really long SQL statement too -- this seems simpler for now.)

So here's where it gets REALLY complicated.

These are technically "practice" exams which can be taken over and over again... each time, the test questions will be changed BUT, since I'm tracking what questions have already been asked and if the user got them right or wrong, I want to weight the questions that end up on the exam to show something like:

50% new questions not asked yet
35% questions incorrectly answered before
15% question previously answered correctly.

Thoughts about the best way to do this?
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."

micah

  • A real person, on the Internet.
  • Ass Wipe
  • Posts: 6915
  • Karma: +58/-55
  • Truth cannot contradict truth.
    • micahj.com
Re: Weighting Results
« Reply #1 on: August 18, 2009, 11:59:28 AM »
Ok, I had to take a break for a few days and come back to this to keep my brain from exploding.

Here's my current game plan:

step 1) run the 10-query script to create an initial version of the test with 35 random questions that have not yet been asked yet.

step 2) run another query to find 12 or 13 random questions from the pool that have already been answered wrong and 5 random questions that were answered right (35% and 15% respectively)

step 3) sub these 17 or 18 previously answered questions into the newly created quiz (noting their correct placement based on sub section) and removing an equal number of "unasked" questions from the quiz.  Ta-da!

the only problem I forsee is that, at some point, the user will have seen all the question and I can't pick 35 random questions to start with.  In that case, I'll just change the percentage of right/wrong questions that are repeated.
"I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.  I use it to look at pictures of cats and get in arguments with strangers."