# Discourse 游戏化

**URL:** https://meta.discourse.org/t/discourse-gamification/225916
**Category:** Plugin
**Tags:** official, gamification, included-in-core
**Created:** [2022年五月2日 19:14 UTC](https://meta.discourse.org/t/discourse-gamification/225916 "2022-05-02T19:14:25Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [2025年八月14日 13:21 UTC](https://meta.discourse.org/t/discourse-gamification/225916/434 "2025-08-14T13:21:39Z")

</div>

是否可以手动重置排行榜网址？

例如，将 `leaderboards/2` 重置为 `leaderboards/1`。

---

<div class="post-metadata">

### Author: ![gilles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gilles/32/549022_2.png) [@gilles](https://meta.discourse.org/u/gilles)
#### Post date: [2025年九月1日 15:09 UTC](https://meta.discourse.org/t/discourse-gamification/225916/435 "2025-09-01T15:09:44Z")

</div>

是否可以将积分作为额外奖励分配给用户？ 😁

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [2025年九月1日 23:17 UTC](https://meta.discourse.org/t/discourse-gamification/225916/436 "2025-09-01T23:17:47Z")

</div>

您可能想看：

> [@How to adjust gamification points without retroactively updating point values for old score-able actions](https://meta.discourse.org/t/how-to-adjust-gamification-points-without-retroactively-updating-point-values-for-old-score-able-actions/308447):
>
> Problem statement If you use the [Discourse Gamification Plugin](https://meta.discourse.org/t/discourse-gamification-plugin/225916) to award users points for contributing to your community, you may have come across a need to adjust point values based on emerging trends. In the [SailPoint Developer Community](https://developer.sailpoint.com/discuss), we use the Gamification Plugin to power our [Ambassador program](https://developer.sailpoint.com/ambassadors/). Users who make valuable contributions to our community earn points which in turn are used to determine the level of perks they receive. As our community has grown and the number of contributions…

其中包含此 curl 请求：

```plaintext
curl --location 'https://my.discourse.com/admin/plugins/gamification/score_events' \
--header 'Api-Key: <您的密钥>' \
--header 'Api-Username: <您的用户名>' \
--header 'Content-Type: application/json' \
--data '{
    "user_id": "101",
    "date": "2024-05-15",
    "points": "-141",
    "description": "Gamification point adjustment"
}'

```

---

<div class="post-metadata">

### Author: ![elorze\_ether](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elorze_ether/32/520198_2.png) [@elorze\_ether](https://meta.discourse.org/u/elorze_ether)
#### Post date: [2025年九月4日 08:24 UTC](https://meta.discourse.org/t/discourse-gamification/225916/437 "2025-09-04T08:24:26Z")

</div>

我在admin打开了这个插件，但是标签栏并没有自动出现Leaderboard，我添加了新的榜单也没出现。这是为什么？我应该去哪里看这些榜单？

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [2025年九月4日 08:48 UTC](https://meta.discourse.org/t/discourse-gamification/225916/438 "2025-09-04T08:48:29Z")

</div>

我认为您必须自己将它们添加到侧边栏 🤔。排行榜位于 `/leaderboard`、`/leaderboard/2`、`/leaderboard/3` 等。

---

<div class="post-metadata">

### Author: ![wangya123](https://avatars.discourse-cdn.com/v4/letter/w/ccd318/32.png) [@wangya123](https://meta.discourse.org/u/wangya123)
#### Post date: [2025年九月18日 13:08 UTC](https://meta.discourse.org/t/discourse-gamification/225916/439 "2025-09-18T13:08:06Z")

</div>

是否可以为特定类别或标签创建排行榜？

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2025年九月18日 13:23 UTC](https://meta.discourse.org/t/discourse-gamification/225916/440 "2025-09-18T13:23:17Z")

</div>

排行榜与群组相关联。但是，您可以在游戏化设置中指定哪些类别会影响所有排行榜。将此移至排行榜似乎是个有趣的主意，例如在此社区中设置一个#support 排行榜。

 ![Screenshot 2025-09-18 at 6.21.53 AM](https://global.discourse-cdn.com/meta/original/4X/a/f/b/afbf86a4c27508ac1a2dd5d571d1cb0d289e10f0.png)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2025年十月22日 22:04 UTC](https://meta.discourse.org/t/discourse-gamification/225916/442 "2025-10-22T22:04:28Z")

</div>

2 篇帖子已拆分为新主题：[为被标记的用户减少积分](https://meta.discourse.org/t/reducing-points-for-flagged-users/386482)

---

<div class="post-metadata">

### Author: ![Ari\_Waller](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ari_waller/32/490672_2.png) [@Ari\_Waller](https://meta.discourse.org/u/Ari_Waller)
#### Post date: [2026年一月22日 23:31 UTC](https://meta.discourse.org/t/discourse-gamification/225916/443 "2026-01-22T23:31:04Z")

</div>

我有什么办法将自己从排行榜中排除吗？

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2026年一月22日 23:36 UTC](https://meta.discourse.org/t/discourse-gamification/225916/444 "2026-01-22T23:36:11Z")

</div>

是的，将您自己添加到一个新组（称之为“leaderboard-exclusion”或类似名称），然后在插件设置中排除该组。

编辑：这样以后您也可以轻松地将任何其他人添加到同一组中以将其排除在外。🙂

---

<div class="post-metadata">

### Author: ![Ari\_Waller](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ari_waller/32/490672_2.png) [@Ari\_Waller](https://meta.discourse.org/u/Ari_Waller)
#### Post date: [2026年一月23日 00:06 UTC](https://meta.discourse.org/t/discourse-gamification/225916/445 "2026-01-23T00:06:51Z")

</div>

非常感谢。这很有道理。

---

<div class="post-metadata">

### Author: ![singi2016cn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/singi2016cn/32/532755_2.png) [@singi2016cn](https://meta.discourse.org/u/singi2016cn)
#### Post date: [2026年一月30日 02:51 UTC](https://meta.discourse.org/t/discourse-gamification/225916/446 "2026-01-30T02:51:54Z")

</div>

我升级到2026.1.0版本后，新建了一个月度排行榜，然后访问下面的路由出现了报错：

[http://localhost:4200/admin/plugins/discourse-gamification/leaderboards](http://localhost:4200/admin/plugins/discourse-gamification/leaderboards)

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/4/5/8456e760e0fc07e64bbe4749270b0de587c78d19.png)

报错如下：

```javascript
assert.js:40 
 Uncaught (in promise) Error: Assertion Failed: You attempted to update `_value` on `TrackedStorageImpl`, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.

`_value` was first used:

- While rendering:
  {{outlet}} for -top-level
    -top-level
      {{outlet}} for application
        application
          DiscourseRoot
            {{outlet}} for admin
              admin
                {{outlet}} for adminPlugins
                  admin-plugins
                    {{outlet}} for adminPlugins.show
                      show
                        AdminPluginConfigPage
                          AdminPluginConfigArea
                            {{outlet}} for adminPlugins.show.discourse-gamification-leaderboards
                              adminPlugins.show.discourse-gamification-leaderboards
                                {{outlet}} for adminPlugins.show.discourse-gamification-leaderboards.index
                                  discourse-gamification-leaderboards
                                    DPageSubheader
                                      (result of a `unknown` helper)

Stack trace for the update:
    at TrackedArray._dirtyCollection2 (array.ts:163:13)
    at Object.set (array.ts:126:15)
    at Proxy.sort (<anonymous>)
    at AdminPluginsShowDiscourseGamificationLeaderboardsIndexController.sortedLeaderboards (index.js:23:1)
    at AdminPluginsShowDiscourseGamificationLeaderboardsIndexController.<anonymous> (handle-descriptor.js:67:17)

```

然后我定位到出问题的文件如下：

```plaintext
plugins/discourse-gamification/admin/assets/javascripts/discourse/controllers/admin-plugins/show/discourse-gamification-leaderboards/index.js

```

具体代码：

```glimmer-javascript
  @discourseComputed("model.leaderboards.@each.updatedAt")
  sortedLeaderboards(leaderboards) {
    return (
      leaderboards?.sort((a, b) => compare(b?.updatedAt, a?.updatedAt)) || [] // 22行
    );
  }

```

错误的原因是：

**Ember.js（准确说是 Glimmer 跟踪系统）的响应式状态管理断言错误** ，核心原因是：在同一个计算周期内，你先读取了一个`tracked`（跟踪状态）的值，随后又试图修改这个值，这种 “先使用后更新” 的操作会导致逻辑混乱、无限循环或性能问题，因此 Ember 直接禁止了该行为。

关键问题：

- `Array.sort()` **原地修改原数组** ，会更新`@tracked`的`leaderboards`状态

- 计算属性（`sortedLeaderboards`）的职责是 **派生新值** ，而非修改原始状态，它本身应该是 “纯函数”（无副作用、不修改输入源）

下面是修复的方案：

```glimmer-javascript
  @discourseComputed("model.leaderboards.@each.updatedAt")
  sortedLeaderboards(leaderboards) {
    return (
      //leaderboards?.sort((a, b) => compare(b?.updatedAt, a?.updatedAt)) || []
      leaderboards?.slice().sort((a, b) => compare(b?.updatedAt, a?.updatedAt)) || []
    );
  }

```

修复后截图：

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/2/3/b23c6682b2028cf06246fe6988c362bc4947a3b3.png)

然后这种类似的问题好像不是个例。我猜想是emberjs升级后导致的不兼容问题。而，很多插件中的这些地方并没有随着升级而同步修改，毕竟这项工作并没有说起来这么简单。

---

<div class="post-metadata">

### Author: ![long](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@long](https://meta.discourse.org/u/long)
#### Post date: [2026年二月19日 17:51 UTC](https://meta.discourse.org/t/discourse-gamification/225916/449 "2026-02-19T17:51:52Z")

</div>

问题：积分授予是否有延迟？例如，新用户正在进行需要积分的操作，比如发布新主题或点赞，但他们的分数没有显示出来。我在设置中包含了信任等级 0，所以我想知道这是否只是积分分配的延迟？如果是这样，它多久计算和更新一次？谢谢！

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2026年二月19日 18:05 UTC](https://meta.discourse.org/t/discourse-gamification/225916/450 "2026-02-19T18:05:08Z")

</div>

> [@Discourse](#):
>
> 积分会根据当天的事件每小时自动更新一次，我们每天会重新计算过去 10 天的得分。

---

<div class="post-metadata">

### Author: ![Eviepayne](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviepayne/32/352733_2.png) [@Eviepayne](https://meta.discourse.org/u/Eviepayne)
#### Post date: [2026年四月1日 17:04 UTC](https://meta.discourse.org/t/discourse-gamification/225916/451 "2026-04-01T17:04:09Z")

</div>

> [@tobiaseigen](#):
>
> 将（可评分的类别）移至排行榜似乎是个有趣的想法，例如在此社区中为 #Support 设立一个专属排行榜。

我想重新探讨这个想法。目前我已将排行榜限制为单一类别，但将其改为独立的排行榜会更好。

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2026年四月1日 17:16 UTC](https://meta.discourse.org/t/discourse-gamification/225916/452 "2026-04-01T17:16:46Z")

</div>

> [@Eviepayne](#):
>
> 我想重新探讨这个想法。目前我将排行榜锁定为单一类别，但如果能改为每个类别拥有独立的排行榜会更好。

这正是我们非常想实现的功能，只是需要找到合适的时间来完成，或者争取到客户赞助以推动这项工作。

---

<div class="post-metadata">

### Author: ![james10](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@james10](https://meta.discourse.org/u/james10)
#### Post date: [2026年五月15日 12:50 UTC](https://meta.discourse.org/t/discourse-gamification/225916/453 "2026-05-15T12:50:02Z")

</div>

你好，

我创建了一个新的排行榜，但它清空了原始排行榜的设置。

有没有办法让用户在前端选择查看哪个排行榜？

---

<div class="post-metadata">

### Author: ![gilles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gilles/32/549022_2.png) [@gilles](https://meta.discourse.org/u/gilles)
#### Post date: [2026年五月18日 07:30 UTC](https://meta.discourse.org/t/discourse-gamification/225916/454 "2026-05-18T07:30:31Z")

</div>

你可以自定义一个版块，直接跳转到所选的排名链接

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/d/7/1d70fb67c795421d305604e88bb806ba9c93f898.png)

---

<div class="post-metadata">

### Author: ![jdc20181](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jdc20181/32/515028_2.png) [@jdc20181](https://meta.discourse.org/u/jdc20181)
#### Post date: [2026年五月27日 16:10 UTC](https://meta.discourse.org/t/discourse-gamification/225916/455 "2026-05-27T16:10:26Z")

</div>

如果能支持自定义事件也颁发积分那就太好了。例如，我打算为我们的版主（甚至未来可能包括社区成员）使用 [Discourse Points Mall](https://meta.discourse.org/t/discourse-points-mall-check-in-shop-orders-makeup-cards-ledger/398080/9) 插件，作为在我们 Discord 频道乃至未来游戏内发放奖励的一种方式。

它可以设计成手动发放系统，或者通过兑换码来领取。我理解该插件的范围主要聚焦于 Discourse 平台内的互动，但若能将其功能扩展到其他场景那就更好了。因为就我的用例而言，Discourse 只是我们生态系统的一部分，而非唯一的落脚点。

补充说明：我知道可以通过 API 实现上述功能，但那些方法更偏向于外部来源。虽然它们也能颁发积分，但我认为拥有一个原生功能会更好 😉

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2026年五月28日 02:54 UTC](https://meta.discourse.org/t/discourse-gamification/225916/456 "2026-05-28T02:54:22Z")

</div>

您看过[如何将 Discourse 游戏化与外部系统集成（兑换和奖励积分）](https://meta.discourse.org/t/how-to-integrate-discourse-gamification-with-an-external-system-redeem-and-award-points/262968)吗？

[上一頁](https://meta.discourse.org/t/discourse-gamification/225916.md?page=2)

[下一頁](https://meta.discourse.org/t/discourse-gamification/225916.md?page=4)
