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
50% on Test 1 amounts to 0.5 x 10% of the overall grade = 5%.
50% on Test 2 ...... 0.5 x 30% = 15%.
Thus, from test 1 and 2 you have a total of 20%
if you want 50% overall, then you need to get a contribution of 50-20=30% from the final assessment.
30% from something that is worth 60% is just 30/60 = 50%.