Is there a way to display the rating in comment given by a user in the node? For example, in this page http://www.yelp.com/biz/ikes-place-san-francisco at the top we can see the total rating, but in comments we can see the rating given by the user.
Is there some way to do this? Thanks!
Five Star module is what you are looking for,
The Fivestar voting module adds a clean, attractive voting widget to nodes and comments and any entity. It features:
jQuery rollover effects and AJAX no-reload voting
Configurable star sets
Support for anonymous voters
Spam protection to keep users from filling your DB with bogus votes
Easy-to-use integration with Views module for lists sorted by rating, or filtered by min/max ratings
A Fivestar CCK field for use in custom node types
An easy-to-use Form API element type for use in other modules
Compatible with all versions of jQuery (1.0 - 1.8)
Check out this awesome, Demo video
I achieved a similar thing with the Fivestar module. The trick is to let the users vote when they comment. You can find a whole description for the set-up at https://drupal.org/node/1308114. Here is an adapted version of the documentation:
Setting up the content type
- Go to
admin/config/content/fivestarand create a new tag, e.g. called Vote or Rating.
- Go to your content type and add a new Fivestar field, e.g. called "Rating".
- Select the widget type Stars (rated while viewing) and tag the Rating.
- Select the number of stars. Make sure it will be the same on both the content type and the comments.
- Go to your content type's display settings and click the settings button for the Fivestar field.
- Set Value to display as stars as Average Vote.
Setting up the comments
- Go to the comment field settings for your content type.
- Use Add existing field and add the same Fivestar field you created for the content type.
- Widget: Stars (rated while editing).
- Select the number of stars, equal to the amount that's used in your content type.
- Select the voting tag you created earlier and set the voting target to Parent Node.
- Go to the comment display settings and click the settings button for the Fivestar field.
- Set Value to display as stars as User's Vote and change Text to display under the stars to User's vote.
I asked a question about how to display the average rating as stars before: How to display the average rating of a node as stars in a view?. Maybe that can help you too.