Over My Head - Java Quiz (requesting help)

I am developing a 25 - 30 question, Javascript, Multiple Choice Quiz.

Each question has 4 choices.

I need some help in learning how to 'categorize' sets of 'general culminations' of the answers.

That is, the answers are to produce a range of different Categories.

For instance;

Each of the 4 choices has a value, say 1, 2, 3, or 4.

Then, if there are more "1's" than 2's, 3's or 4's - then the 'Category' would be labeled say, "10" - (or 20 or 30 or 40)

Also, if there is a relatively equal amount of each of the 4 choices (by a +/- 2) - then the 'Category' would be labeled say, "00"

And/Or - something like "12" would equal, say > mostly 1's & 2's - etc.

So, can someone suggest where I might learn how to do some things like this?

With appreciation :)