Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to calculate the 5 star rating in forum? please can anyone give some sample calculation for rating method.


Thanks In Advance
Posted
Comments
Sandeep Mewara 2-Jul-12 2:47am    
Did you try anything so far?
Flex_Query 2-Jul-12 3:04am    
No...this is first time to implement...but don't have any idea for that..
Sergey Alexandrovich Kryukov 2-Jul-12 3:02am    
Not enough information. What is the problem? What are the requirements?
--SA
Flex_Query 2-Jul-12 3:08am    
Now i want to give option for user,to give rating for reply for every answers.for Example this site also give option to user (5 star rating)
Sergey Alexandrovich Kryukov 2-Jul-12 4:00am    
This site has pretty complicated weighted rating calculation method, which you can find in documentation. Not clear what is your problem.
--SA

1 solution

It is up to you to decide based on your own rules. For example you could allocate a basic number of points for each star that a poster gives to an entry, such as:
1 star = -2 point
2 stars = -1 point
3 stars = 2 points
4 stars = 4 points
5 stars = 6 points

You can then add weights to those values based on the user's reputation; so multiply the base points by the weighting value to give the final points allocated. Then decide how many points per star and that is your final value.
 
Share this answer
 
Comments
Flex_Query 2-Jul-12 5:26am    
Thanks for Reply..Plz Can you give some more detail.
Flex_Query 2-Jul-12 6:02am    
If I allocated basic number of points for each star, such as
1 star = 1 point
2 stars = 2 point
3 stars = 3 points
4 stars = 4 points
5 stars = 5 points

For Example:
Users gave some star value to particular Reply Mean.
3 Person gave 5 Stars, So = 3* 5 = 15
2 Person gave 2 Stars, So = 2 *2 = 4
Calculation = 15 + 4 = 19
Finally, Rating for that Answer is = 19/5 = 3.8
Is This Correct or Not, Please Reply.
Richard MacCutchan 2-Jul-12 6:15am    
Is this correct? If that is the way you wish to do your calculations, then yes. As I said before it is up to you to decide what you want and then figure out the algorithm you need to achieve that result.
Flex_Query 2-Jul-12 6:29am    
Thanks Richard.Can u give some idea about algorithm usage for my calculation.
Richard MacCutchan 2-Jul-12 6:44am    
I already said that you need to work it out for yourself. I have no idea what your rules are going to be so I cannot write the algorithm.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900