Make sure you check out all the site settings for this plugin by searching for āRatingā in your admin settings.
Before you post in this topic, bug reports or feature requests over at thepavilion.io are much appreciated (itās easier to manage than one big topic!). If you just have a quick question, itās fine to post that here.
Ideally, Iād like to modify the topic and/or post guardians on the server to prevent a user from posting in a ratings topic twice. However, with my limited ruby skills, I canāt see an easy way to do this without just overriding the existing methods (assuming thatās possible this isnāt a very sustainable thing to do)ā¦ any ideas/tips? @sam
Where is the button in the composer UI or for the finished post to rate the thread?
I have installed the plugin, given the thread the āratingā tag, and can see the empty stars at the top. But no button to actually rate it. (Or must I use a non-admin account for that?)
EDIT: looked closely at the screenshots, and see that there is supposed to be a āYour ratingā line there. Well, itās missing in my instance.
Thought of a second reason this might not work: My instance is German. If the translation is missingā¦
Will create a test user and set his user interface to English. If it still does not work then something is broken.
OK, mystery solved. As a normal user, I can answer even though my user interface is still in German.
Warn a guy about stuff like that, will ya!
(An option to allow admins to vote too would be honestly appreciated, though.)
Edit: Celebrated too early, its still broken.
I had the option to select stars on posting the initial reply. That did not affect the overall rating, though. And on editing the reply, the āYour ratingā line is missing again.
Switched the user interface of the test user to English - no change.
@fackelwind Thanks for the feedback! I appreciate it. This precipitated a significant refactor to get it working as expected. In retrospect Iām surprised it worked before at allā¦
The only thing that doesnāt work now is the topic average will not get automatically updated for other users when a new user publishes a post with a rating or edits a rating in a post. Other users will see the updated rating on the new or updated post itself, but the topic average rating wonāt update until those other users refresh. I will fix that soon.
@zogstrip@riking Hey guys, could you give me some advice on the best way to push topic updates to other clients from the server? Iām pushing the post updates using the aptly named post method publish_change_to_clients which uses the MessageBus. But Iām not sure of the best way to do the same for the average_rating custom field Iāve created for topics. I can send it to back to the current userās client easily enough, but other clients? Iām sure itās relatively straight forward, but with my basic ruby skills the answer isnāt jumping out at meā¦
Alright, installed and quickly tested.
Rating now works (great!). However, I can rate all threads, whether or not they have a rating Tag attached. I also see stars under each Thread title (again, no rating Tag). Not idealā¦
Klicking on the stars on the published post does not work (I think having to edit the post is fine, but since you advertised it, I am telling you about it).
Is there a way for the user to remove a rating again? (Not necessary, but nice to have.)
I will test more later today.
Just one more request: When you implement your restriction to one post per user in any rating thread, can you make that a setting? I think for my use case having a proper back and forth discussion might be better (of course with a limit of one rating per user ).
Thanks, Iāve got it working now. I was getting confused by the last parameter, i.e. the user or group ids, on the publish function; it made me think it wasnāt apposite for this case.
The topic controller subscribes to the message bus here. The ārevisedā type case already handles the post update, so all I needed to do was set the bus message type to ārevisedā and then add extra logic to save the average to the clientās topic model for the ārevisedā case, i.e.
Yes, I see the issue, Iāll fix it tomorrow morning.
Klicking on the stars on the published post does not work (I think having to edit the post is fine, but since you advertised it, I am telling you about it).
Yes I should have mentioned, I removed that functionality (updated the description accordingly now). So you can only rate in the composer itself.
Just one more request: When you implement your restriction to one post per user in any rating thread, can you make that a setting? I think for my use case having a proper back and forth discussion might be better (of course with a limit of one rating per user ).
Thanks a bunch for your fast response!
I did not have a lot of time this morning, so I just sent of a very quick response. I want to really thank you for this plugin, it matches perfectly with what I want to make possible for our community! (completely new site, so I am free to play around with a still maturing plugin. )
Another Bug Report from me:
Right now, every post can vote, even when that user has already replied and voted in the thread.
If you do not vote, it counts as 0 stars. I donāt think this is the correct way to handle it: A non-vote should not influence the average at all. And just posting into a thread which can rate should not lower the average opinion about the topic. Besides, once you have klicked onto 1-5 stars, you can never go back to 0 stars, so even if there just had to be a default vote, it would not be correct.
And a wishlist item: Some way to see the precise average, and how many people have rated the topic how highly. Kinda obvious if you look at amazon or wherever. Just making sure.
EDIT: Since it might not be obvious: Even though I report everything that looks wrong to me, and even write down whishlist items, the most important thing is that the plugin does not influence threads which it shouldnāt (no rating Tag, category not marked for rating). People are starting to use my discourse instance. Whether this plugin does or doesnāt work correctly is not a big deal as long as only the rating trial topic is influenced. When every single thread is modified, that is a much bigger problem. (All topics created today show starsā¦)
I have deinstalled the plugin again for now (rebuild the docker instance without it), to get rid of the visual clutter on threads that were not supposed to be rated.
I will happily retry it once that bug is fixed (though having to rebuild the instance for that, with the associated downtime, is unfortunate).
I have made sure the topic averages will not be applied to new topics in a non-ratings category or without the ratings tag. Unfortunately this wonāt fix existing topics with empty ratings youāve made in your instance. If that is a significant issue, Iāll see if I can figure out how to fix it.
Right now, every post can vote, even when that user has already replied and voted in the thread.
I canāt reproduce this one. Could you check again if you re-install the plugin. Thanks.
If you do not vote, it counts as 0 stars. I donāt think this is the correct way to handle it: A non-vote should not influence the average at all. And just posting into a thread which can rate should not lower the average opinion about the topic. Besides, once you have klicked onto 1-5 stars, you can never go back to 0 stars, so even if there just had to be a default vote, it would not be correct.
Yes this is an issue. I think the way to handle it is if the user does not select a rating in a post, that post does not get a rating included. That user could still post on that topic with a rating in another post. Of course, once I add the setting to prevent a user posting in a ratings topic more than once, I will have to require that the user adds a rating to their single post. I will fix this one within the next two days.
And a wishlist item: Some way to see the precise average, and how many people have rated the topic how highly. Kinda obvious if you look at amazon or wherever. Just making sure.
Yes this is possible. I think Iāll add it next to the topic stars and add later a setting to show/hide it. I will do this one on the weekend.
This is a significant issue, but not in the way you think. Having an SQL query to run against the DB (to remove the empty ratings) would not really help.
Think about this: How do you intend to handle the case where someone removes the āratingā tag from a topic? Or in any other way removes a topic from being a rated one?
I would argue that the only sane way for you to handle that case is to treat it as a vanilla topic: No stars, no possibility to rate, no restrictions in the amount of posts. So you donāt only look whether there are ratings when deciding on whether to draw stars or not, you always check whether the topic fulfills the criteria of being a rated one. (I have honestly no idea what you intend to do when someone tags an existing topic with āratingā, the setting to restrict it to one post per user is active, and users have already posted more than onceā¦)
And if you have implement that, I wonāt have any problems with stale ratings either.
Iāve got a discourse docker instance lying around on my desktop. Tell me when you have a version which you think should work, and Iāll test it there.
Ok! Finally had some time to work on this. Made various bugfixes and updates. Inter alia, I changed the category property that signified whether the category had ratings enabled, so existing categories with ratings enabled will have to be re-enabled to work.
The ratings tag and category toggle is now handled within the composer. If the creator of a topic removes/adds a ratings tag or changes from a ratings category in the first post of a topic the topic will refresh after they post and the ratings will show/hide depending on whether their action was to turn ratings on or off. If ratings are turned āoffā on a topic they are still there in the DB. If ratings are turned back on the same ratings will appear again.
Tomorrow or the next day, Iāll apply the same logic to the topic title edit (i.e. if the creator of the topic changes the category or tags by editing the topic title).
Then Iāll add the exact numeric rating to topics title sections and add a setting to toggle it. Then Iāll add an indication that a topic has ratings if those ratings are hidden (i.e. if the category or tags were changed) and a setting to toggle this too.
Tomorrow or the next day, Iāll apply the same logic to the topic title edit (i.e. if the creator of the topic changes the category or tags by editing the topic title).
It seems that the ratings plugin makes messages unavailable. Here are some logs. It looks like somehow messages donāt know that they donāt have ratings.