I thought of one way, but it seems a long way around the
Ultimately I'd like to be able to change the weight of a
question (for scoring). I'd like it to be transparent where no
matter how many questions I add - and fix weight for - the total is
still a max 100%.
If a question is weighted at 1 or undefined, the question
will automatically have a weight of 1 for scoring purposes.
If the weight is greater than 1 the weight will be multiplied
by the weight score.
If the total number of questions is 10, and they each have a
weight score of 1 - then the weight would equal.
100/10 - or 10% for each question.
Total Percent = 10% x 10
If all ten are answered correctly, then Total Score would be
In a case where the number of correct answers is 9 and there
is one incorrect answer:
100/10 - or 10% for each question. Total Percent = 10% x 9 -
And so on.
In a case where weighting comes in, if a question had a
weight of 2 - The total number of questions is increased by 2, to
100/12 - 8.333
The weight factor of 2 would be figured as such:
The total number of questions is decreased by 2, to 8
100/8 - 12.5
The total correct are added up to make total score.
you have 2 independent variables: the number of questions and
the weight for each question. (the weight for each question might
be viewed as a number of independent variables, but would be
simplest to consider as an array of weights and the array of
weights is an independent variable.)
the total score and percentage correct are dependent
variables and easily calculated once you establish the number of
questions and the array of weights. for example, if you have N
questions and with the weight for question 0,...,N-1 given by