Discourse Gamification

:discourse2: Summary Discourse Gamification adds customizable scoring (karma, kudos, points) and leaderboards to your instance.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-gamification
:open_book: Install Guide How to install plugins in Discourse
:test_tube: Demo Leaderboard

Features

While Discourse ships, out of the box, with gamification features (badges, trust levels) some communities want to take it to another level. That’s where GitHub - discourse/discourse-gamification comes in.

This plugin allows admins to easily create and tweak community scoring contests, where points are awarded by participating in the community.

Points are automatically updated every 5 minutes for events of the day, and we re-calculate scores from the last 10 days once a day.

Cheers

Users are awarded “cheers” by performing certain actions on the community. Each user cheer score appear on their user card, user profile and can be enabled on the user directory.

user card example with cheers

Like the plugin but the name cheers isn’t the best for your community? You can rename it to anything using Customize all text in Discourse.

Leaderboards

Admins can create multiple leaderboards, and each one can have a custom:

  • start date
  • end date
  • Competing users
  • Leaderboard privacy

By default, we ship with a default leaderboard at /leaderboard that will list all users from the first day where scores started to be awarded.

You can see a demo of it at Discourse Meta

Scorables

Currently, the following events award cheers:

See roadmap for upcoming scorables.

Score backfill

You can run a backfill to calculate the historical scores through the UI using the ‘Recalculate Scores’ button on your /admin/plugins/gamification page:

This can also be used to recalculate the leaderboard if you make any changes to your scorables or eligible scoring categories. You can generate a rescore up to 5 times a day, and can select a range of time frames (or set a custom one):

select timeframe timefarne options

Configuration

Global customizations are:

  • each action score multiplier
  • Restrict categories where points can be earned
  • enable and disable the plugin

Those plugin-level settings live at /admin/site_settings/category/plugins?filter=plugin%3Adiscourse-gamification.

To create, delete and update leaderboards, admins can visit /admin/plugins/gamification.

Use as widget

This can also be displayed as a widget in a smaller format, inside the Right Sidebar Blocks theme component. More info to be found there.

Badges based on score

You can have automatic badges based on the gamification score using Enable Badge SQL

Here is an example badge when a user has over 9000 cheers:

SELECT user_id, current_timestamp AS granted_at 
FROM gamification_scores
WHERE (:backfill OR user_id IN (:user_ids))
GROUP BY 1
HAVING SUM(score) > 9000

Changelog

  • 2022-05-02T03:00:00Z - Public Release
  • 2022-05-10T05:00:00Z - Update roadmap with recent changes

Roadmap

(roughly ordered)

  • Make leaderboard respect prioritize usernames in ux being disabled

  • Use higher resolutions avatars in leaderboard podium

  • Add custom per-badge scoring

  • Add per-reaction score awarding (requires Discourse Reactions - Beyond Likes)

  • Add chat-events scoring (requires Introducing Discourse Chat (BETA))

  • Add poll events scoring (created poll, voted in poll)

  • Add media events scoring (posted image, posted video, posted onebox)

Implemented:

  • Fix i18n table title in custom score column on user directory
  • Ignore staged users
  • Ignore anonymized users (email match @anonymized.invalid)
  • Style leaderboard edit form
  • Leaderboard “you” link needs a larger offset to accommodate floating header

  • Fix highlight of own user on the leaderboard not working if own user position is > 100
  • Add i18n thousands separator to user card / profile cheer score
  • Add time period filters to leaderboards
  • Add default time period filter to leaderboard settings
  • Add excluded_groups_ids to leaderboard settings
  • Allow admins to award/remove arbitrary points to users to allow integration with out-of-Discourse scorable events
  • Make scores click link to leaderboard (both in user profile and user card)

:discourse2: Hosted by us? This plugin is avaliable on our Business and Enterprise plans Gamification | Discourse - Civilized Discussion

93 Likes

Could Discourse Gamification have more options like the links below in the future? Showing the number of quotes the member received, how many people he quoted, the number of comments etc
 And have tabs, showing other categories, such as a top of tags (Of the most commented) a top of comments and topic partitions, a top of most commented topics, a top of most influential members, all showing the options and also with a filter showing week, day and month, see some examples below

Pandlr Charts (pandlr-charts.pages.dev)

Pandlr Charts (pandlr-charts.pages.dev)

It could but most of that is very out of the plugin scope.

  • Top topics is already baked in core, it’s the /top route

  • Top tags and categories it’s a cool concept, but something that either core or a dedicated plugin should handle

  • Top users of a week is already covered in the plugin today

  • Top gifs is something that core could do

1 Like

Hi @Falco,

One of our forum members (Monty-Bagati) noticed a mismatch between their current ranking in the Month view, specifically the “You” part right beneath the top three with the Kudos amount of 123 compared to 132 further down the leaderboard.

Strangely, this does not happen in the other views (Day, Week, Quarter, etc.)

Any idea what may be the cause of this? Thanks!

2 posts were split to a new topic: Add solutions marked scorable

Can you clarify if points can be customized for each action? We can decide how many points are awarded for each event?

1 Like

Yes

For example the scoring here was changed recently Experimenting with some new scoring defaults on Meta

2 Likes
  • Add excluded_groups_ids to leaderboard settings

It looks like this feature didn’t make it to development in 2022. At least, I don’t see it in the gamification plugin settings. Is there any way for people to individually be able to turn off participation in gamification? Alternately, is there a different way to exclude some users from gamification?

1 Like

Hi there. I believe you’d need to put them in a group. You can then exclude a group in the leaderboard settngs when you create a new leaderboard:

6 Likes

Where can I edit the word “Rank” here:
image

I tried in customize > text.

Thanks!

I just found these settings. Thank you! That’s a great solution.

2 Likes

I searched “rank” in Customize > Text and found this:

image

Yes, thanks. However, I had already tried that, but it also changed “Rank” on the main /leaderboard/1 page. I only wanted to change it in the sidebar.

Ah. They might be using the same variable for both then. Sorry.

1 Like