# Topic Ratings Plugin

**URL:** https://meta.discourse.org/t/topic-ratings-plugin/39578
**Category:** Plugin
**Tags:** pavilion
**Created:** [February 14, 2016, 9:06pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578 "2016-02-14T21:06:53Z")
**Posts on this page:** 20
**Page:** 21

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [May 13, 2023, 2:59pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/410 "2023-05-13T14:59:14Z")

</div>

Is it possible to use 2 step rating instead of stars?`

Like 👍 👎 With a result like

👍 (69%) 👎 (31%)

---

<div class="post-metadata">

### Author: ![n1bff](https://avatars.discourse-cdn.com/v4/letter/n/e95f7d/32.png) [@n1bff](https://meta.discourse.org/u/n1bff)
#### Post date: [June 22, 2023, 5:50pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/411 "2023-06-22T17:50:27Z")

</div>

Does this plugin expose the average rating and number of ratings of a topic as 1-2 simply API calls somehow?

---

<div class="post-metadata">

### Author: ![n1bff](https://avatars.discourse-cdn.com/v4/letter/n/e95f7d/32.png) [@n1bff](https://meta.discourse.org/u/n1bff)
#### Post date: [June 24, 2023, 5:32pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/412 "2023-06-24T17:32:00Z")

</div>

And is it possible to show the ratings when embedding Discourse as in [Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963) ?

---

<div class="post-metadata">

### Author: ![n1bff](https://avatars.discourse-cdn.com/v4/letter/n/e95f7d/32.png) [@n1bff](https://meta.discourse.org/u/n1bff)
#### Post date: [July 24, 2023, 8:33pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/413 "2023-07-24T20:33:47Z")

</div>

As a user, how can one see all one’s ratings?

PS: Sorry for posting question after question, but I think this is the appropriate please, yes?

---

<div class="post-metadata">

### Author: ![jumagura](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jumagura/32/244796_2.png) [@jumagura](https://meta.discourse.org/u/jumagura)
#### Post date: [July 26, 2023, 8:59pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/414 "2023-07-26T20:59:19Z")

</div>

HI @frold,

I appreciate your patience and apologize for the delay in my response. I’ve been preoccupied with other commitments but am back now and ready to address your questions.

The possibility of having a 2-step rating system is interesting. The current design of the Topics Ratings Plugin supports a star-based system, but I see the value in a simpler, thumbs up/down system. Although this is not currently a feature, it’s a compelling idea and I’ll certainly explore its feasibility for a future update. We are also open to sponsorships or funding for the development of specific features. If you’re interested in sponsoring this feature or any other, please feel free to get in touch.

---

<div class="post-metadata">

### Author: ![jumagura](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jumagura/32/244796_2.png) [@jumagura](https://meta.discourse.org/u/jumagura)
#### Post date: [July 26, 2023, 9:10pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/415 "2023-07-26T21:10:13Z")

</div>

Hi @n1bff,

My sincere apologies for the delayed response. Your patience is truly appreciated. I had other engagements that required my attention, but I’m now here to focus on your inquiries.

As of now, the plugin does not provide direct API calls for average rating and number of ratings for a topic. While we recognize the convenience this could provide, it’s not a current feature but something I’ll certainly consider for future enhancements.

Similarly, displaying ratings when embedding comments and providing a consolidated view of all a user’s ratings are not currently supported. These are thoughtful suggestions, and rest assured, I will look into their feasibility.

As we are an open-source project, any feature developments could be expedited through sponsorships or funding. If you or your organization are interested in sponsoring these or other features, please reach out.

---

<div class="post-metadata">

### Author: ![LoveMCJ](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@LoveMCJ](https://meta.discourse.org/u/LoveMCJ)
#### Post date: [October 10, 2023, 4:47pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/416 "2023-10-10T16:47:11Z")

</div>

**I cannot delete the Type because of an error.**

 ![Screenshot 2023-10-11 at 1.39.11 AM](https://global.discourse-cdn.com/meta/original/4X/8/0/9/809712d28e6c100c085bbf78f2f92c49b896a36c.png)

When I try to delete “The Name is … and the Type is empty”, an error message “The requested URL or resource could not be found.” is displayed and I cannot delete it.

Even if I uninstall and reinstall the plugin by “Rebuild the container”, the same error occurs.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [October 10, 2023, 6:49pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/417 "2023-10-10T18:49:54Z")

</div>

It appears that an invalid type was added, resulting in an empty type. The plugin definitely needs a sanity check for input validation.

For now, you can use the Rails console to delete the empty type:

```plaintext
cd /var/discourse
./launcher enter app
rails c
DiscourseRatings::RatingType.destroy("")
exit

```

Refresh the page, and it should be gone!  
Keep the type simple, such as `my_type`, and you are good. 😄

---

<div class="post-metadata">

### Author: ![LoveMCJ](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@LoveMCJ](https://meta.discourse.org/u/LoveMCJ)
#### Post date: [October 10, 2023, 7:24pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/418 "2023-10-10T19:24:51Z")

</div>

> [@Arkshine](#):
>
> It appears that an invalid type was added, resulting in an empty type. The plugin definitely needs a sanity check for input validation.
> 
> For now, you can use the Rails console to delete the empty type:
> 
> ```plaintext
> cd /var/discourse
> ./launcher enter app
> rails c
> DiscourseRatings::RatingType.destroy("")
> exit
> 
> ```
> 
> Refresh the page, and it should be gone!

That’s super cool! Thanks for telling me.

---

<div class="post-metadata">

### Author: ![LoveMCJ](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@LoveMCJ](https://meta.discourse.org/u/LoveMCJ)
#### Post date: [October 11, 2023, 8:40am UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/419 "2023-10-11T08:40:12Z")

</div>

![Screenshot 2023-10-11 at 5.36.57 PM](https://global.discourse-cdn.com/meta/original/4X/2/3/1/231c706b08d7527b74f58a762a1b4695b8f86717.png)

Text categories other than English are not displayed.

Categories must be displayed for non-English text to be managed.

How do I display them?

※ Also, In the case of Type, an error will occur if a non-English character is entered.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [October 11, 2023, 1:57pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/420 "2023-10-11T13:57:02Z")

</div>

@LoveMCJ A quick fix for this is to define a _slug_ for your category, then delete/add the category for the rating again. This should work!

@jumagura

I see an issue here:  
[https://github.com/paviliondev/discourse-ratings/blob/main/assets/javascripts/discourse/components/rating-object.js.es6#L52](https://github.com/paviliondev/discourse-ratings/blob/main/assets/javascripts/discourse/components/rating-object.js.es6#L52)

`Category.slugFor` will return either the `slug` if it exists or `{id}-category` if not defined.

The plugin uses `findBySlugPath`, which only looks for categories with a `slug` defined.  
For categories without, `findSingleBySlug` should likely be used as well.

[https://github.com/paviliondev/discourse-ratings/blob/main/assets/javascripts/discourse/components/rating-object.js.es6#L29](https://github.com/paviliondev/discourse-ratings/blob/main/assets/javascripts/discourse/components/rating-object.js.es6#L29)

I hope that helps! 🙂

---

<div class="post-metadata">

### Author: ![LoveMCJ](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@LoveMCJ](https://meta.discourse.org/u/LoveMCJ)
#### Post date: [October 11, 2023, 3:17pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/421 "2023-10-11T15:17:30Z")

</div>

😍I really appreciate it from the bottom of my heart.

---

<div class="post-metadata">

### Author: ![restivulmu](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@restivulmu](https://meta.discourse.org/u/restivulmu)
#### Post date: [February 18, 2024, 11:12am UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/422 "2024-02-18T11:12:23Z")

</div>

Hi,  
The rating star appears on any topic title page.  
But on the homepage, I see [object Object] instead of the rating star of the posts.

How can I fix this?

\*Note: The problem occurred after the update.( Discourse and Topic Ratings Plugin and other Everything is up to date)

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/3/7/737540c877c95c5c36ed38e145fd304bb92ceb98.png)

---

<div class="post-metadata">

### Author: ![restivulmu](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@restivulmu](https://meta.discourse.org/u/restivulmu)
#### Post date: [February 18, 2024, 6:09pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/423 "2024-02-18T18:09:18Z")

</div>

When I remove this option, the [object Object] text disappears. Are you planning to do anything about this? I think this should be fixed.

Kind regards. Good Work. @jumagura

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/0/0/7003ed8f34984f257bc32bad94ba89a387e00b5a.png)

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [February 18, 2024, 8:11pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/424 "2024-02-18T20:11:26Z")

</div>

@merefield

On your last changes

[https://github.com/paviliondev/discourse-ratings/commit/6673f6ebea36a98c31be04e39de1531074154182](https://github.com/paviliondev/discourse-ratings/commit/6673f6ebea36a98c31be04e39de1531074154182)

It misses:

```js
import { registerRawHelper } from "discourse-common/lib/helpers";

registerRawHelper("rating-list", _ratingList);

```

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 18, 2024, 8:17pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/425 "2024-02-18T20:17:12Z")

</div>

Ooooops! You are quite right! thx!

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 18, 2024, 8:21pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/426 "2024-02-18T20:21:34Z")

</div>

done:

[https://github.com/paviliondev/discourse-ratings/pull/66](https://github.com/paviliondev/discourse-ratings/pull/66)

---

<div class="post-metadata">

### Author: ![bdfl](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@bdfl](https://meta.discourse.org/u/bdfl)
#### Post date: [April 26, 2024, 9:08pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/427 "2024-04-26T21:08:25Z")

</div>

Hi, can this plugin be used for rating posts rather than topics? If so, could someone let me know if it also do these 3 things?

- enable rating on all posts in a topic after the posts are created
- be configured so that users can’t see other users’ ratings or average ratings
- export a CSV with each user name and their ratings for each post

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 26, 2024, 9:52pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/428 "2024-04-26T21:52:32Z")

</div>

Hi, 👋

That’s not possible with this plugin.

The closest plugin I could find is [Discourse Post Voting](https://meta.discourse.org/t/discourse-post-voting/227808) (_thanks, Jammy, for correcting my silliness 😅_). Users can upvote posts once per topic (except the first post), so the rating would be the number of upvotes.

To export a list of users with ratings, you can use this plugin: [Discourse Data Explorer](https://meta.discourse.org/t/discourse-data-explorer/32566). You can create an SQL query, and you will be able to download the list in CSV format. Check #data-reporting #sql-query if you need help.

Also, there is #Marketplace if you can afford to sponsor someone to make the exact plugin you’re looking for. 👍

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 26, 2024, 11:28pm UTC](https://meta.discourse.org/t/topic-ratings-plugin/39578/429 "2024-04-26T23:28:28Z")

</div>

> [@Arkshine](#):
>
> The closest plugin I could find is [Question Answer Plugin](https://meta.discourse.org/t/question-answer-plugin/56032). Users can upvote posts once per topic (except the first post), so the rating would be the number of upvotes.

Just an FYI, that plugin has been deprecated in favour of the #official [Discourse Post Voting](https://meta.discourse.org/t/discourse-post-voting/227808) plugin.

[Previous page](https://meta.discourse.org/t/topic-ratings-plugin/39578.md?page=20)

[Next page](https://meta.discourse.org/t/topic-ratings-plugin/39578.md?page=22)
