A quiz always has 10 questions. Correct answer results in 1 mark. No negative marking.
A user can take the quiz as many times as he likes. I want to show his 'Average Score' based on last 5 quiz scores (irrespective of how many times he takes the quiz).
I do not want to store his individual scores per se, only the Average.
One way to do this:
Current Average Score: 3
Quiz Score: 8
New Average Score: (8+3)/2 = 5.5
Next Quiz Score: 4
New Average Score: (4+5.5)/2 = 4.75
I am wondering if there is a better way to do this? I don't want Average Scores to jump around rapidly, it should be based on how you are performing recently over a period of time (like last 5 quizzes).
Any other better ideas welcome too.
Essentially i am trying to present to him what is 'current' level of Expertise is.
Your proposed method gives too much weight to the most recent test. If you want each test (of the most recent 5) to have the same weight the formula you want is:
$$New\;Average=\frac{4(Old\; Average) + New\; Score}{5}$$
In the first example you mention (old average = 3, most recent test = 8) you get 4.