A standard procedure (frequently -and loosely- called 'bayesian average') is to make a weighted average between the individual rating and the 'a priori' rating:
$R_a = W \; R + (1 - W ) \; R_0$
where
$R_a = $ averaged ('bayesian') rating
$R = $ individual rating: average rating for this item.
$R_0 = $ a priori rating: global average rating, for all items in your database.
$W = $ weight factor: it should tend to $0$ if this items has few votes, and it should tend to $1$ if it has many.
Some choices: $W = \frac{n}{N_{max}}$, or $W = max( \alpha \frac{n}{N_{av}},1)$ , etc ($n=$ number of votes for this item, $N_{max}=$ maximum number of votes for all items, $N_{av}=$average, $\alpha=$ some number between 0.5 and 1... )
Also, frequently one discards items that have very low/big values when computing the statistics.
See some examples
Added: for another approach, specially for yes/no like/diskike votes, see here.
What I interpret you as asking is this: you can just store all the scores for the quiz, ever, and calculate the average when some user asks for it, but you're wondering if you can provide the same data without having to store all the scores.
If I understand correctly, you can calculate a "running average" (called a "cumulative moving average" here) like this: let the $n$-th score be $s_n$. The average of the first $n$ scores is:
$$
\overline{s_n} = \frac{s_0 + s_1 + \dots + s_n}{n}
$$
Now you've got a new score, $s_{n+1}$. The new average should be:
$$
\overline{s_{n+1}} = \frac{s_0 + s_1 + \dots + s_n + s_{n+1}}{n + 1}
$$
Doing some algebra, we can try to rearrange this to involve values we know:
$$
\begin{aligned}
\overline{s_{n+1}} &= \frac{s_0 + s_1 + \dots + s_n + s_{n+1}}{n + 1}\\
&= \frac{s_0 + s_1 + \dots + s_n}{n + 1} + \frac{s_{n+1}}{n+1}\\
\end{aligned}
$$
The right-hand term we can calculate. The left-hand term is almost $\overline{s_n}$, but it has that pesky $n + 1$ in the denominator. So we multiply by $\frac{n+1}{n}$ to get rid of it.
$$
\frac{s_0 + s_1 + \dots + s_n}{n + 1} \cdot \frac{n + 1}{n} = \frac{s_0 + s_1 + \dots + s_n}{n} = \overline{s_n}
$$
Rearranging that:
$$
\frac{s_0 + s_1 + \dots + s_n}{n + 1} = \overline{s_n} \cdot \frac{n}{n+1}
$$
And substituting back in:
$$
\begin{aligned}
\overline{s_{n+1}} &= \overline{s_n}\cdot \frac{n}{n+1} + \frac{s_{n+1}}{n+1}\\
\overline{s_{n+1}} &= \frac{n\overline{s_n} + s_{n+1}}{n+1}\\
\end{aligned}
$$
So that's your formula for the new average, in terms of the old average, $n$, and the new score.
Now, what I just found with algebra can also be found with common sense. We think, if we think of the new score as an "average" (of a data set with one element) then we're asking: how do I combine two averages to make a new one?
Seems like that should be some kind of weighted sum. We should weight the old average by $n$, since it was around for $n$ scores, (treat is as a big fat data point) and weight the new average by just $1$, since it was around for one score. Then just divide by the total number of scores.
(You might do a similar calculation to figure out your new GPA given your current GPA, your new grades, and the number of classes you've taken so far).
Best Answer
Everybody is showing you how to compute the weighted average, but not why.
What you have is 28 votes. The average of 28 values is the sum of those values, divided by 28. In this case, that means:
$$\frac{1+1+1+1+1+2+2+2+3+4+\cdots+4+5+5}{28}$$
This, we see, is the same as:
$$\frac{1\cdot 5 + 2\cdot 3+ 3\cdot 1 + 4\cdot 17+5\cdot 2}{28}$$