In your database you must create 2 fields, one to store the amount of votes and the other to accumulate the amount of points.
As the maximum value of the note is 5, so in the following situation:
200 votes the maximum score will be 1000; 201 votes will be 1005 and so on;
Ex.:
CD 1 - received 2 votes
Vote 1 = 5.0
Vote 2 = 4.2
Final note 4,6
CD 2 - received 3 votes
Vote 1 = 5.0
Vote 2 = 4.2
Vote 3 = 1.5
Final note 3.5
To make the calculations
Final note: Total score / Number of votes
The insertion of the points must be conditional, the values must be between 0 and 5.
With this logic I believe you will be able to develop the steps.
If you want a script ready and want to adapt to your system click here, but it would be interesting to even try to do for own learning.
too broad Either there are many possible answers or good answers would be too long for this format. Add details to reduce the set of answers or isolate a question that can be answered in a few paragraphs.
– Silvio Andorinha