I'm fairly new to PHP and trying to sort a class project. I've banged away and can't see to sort it out, this is the last remaining piece.
I have a form - submit essentially 2 arrays I'm trying to determine the average score for based upon the category groupings. 1. ($_post['category']), ($_post['score']) - with category being a text based array and score obviously being numbers based.
How would I go about finding the average score for each category? I've tried various options to for mapping the two arrays and then trying to average the grades. I can get the total score average pretty easily, but finding a ways to do this by each category individually is tripping me up.
I need to apply a weight to each category score, but that seems pretty easy once you get the above sorted.
Thanks, Steve
$_POST example:
Array (
[0] => Assignment
[1] => Assignment
[2] => Assignment
[3] => Assignment
[4] => Assignment
[5] => Assignment
[6] => Exam
[7] => Assignment
[8] => Assignment
[9] => Assignment
[10] => Exam
[11] => Exam
[12] => Final Project
)
Array (
[0] => 100
[1] => 100
[2] => 100
[3] => 98
[4] => 90
[5] => 92
[6] => 100
[7] => 100
[8] => 100
[9] => 100
[10] => 100
[11] => 92
[12] => 100
)