有效集成 1-10 投票系统,避免常见陷阱
我计划将合理的排名/投票系统集成到现有的应用程序中。
我熟悉传统的 5 星级评级系统的工作原理,并了解 与它们相关的常见陷阱/问题因此想知道是否还有其他方法(我听说过威尔逊、贝叶斯等,但不太确定如何使用下面的结构来实现这一点):
- 我'我计划允许用户投票通过内容页面查看 1 到 10 之间的内容。
- 该内容的得分和总票数将显示在内容页面上。
- 我还将显示/列出前 10 名内容,因此我需要公平/现实的方法,而不是以总票数为 1 的 10 票直接排名第一。
我正在使用 PHP 和 MySQL
,我有一个内容表(其中有一个 content_id
,我想我可以JOIN
)。
我想知道您是否可以建议一种实现上述目标的方式/方法,如果您可以附加一些示例 PHP 代码和示例 MySQL 模式,以便我可以更好地理解它,我将不胜感激,因为我已经用谷歌搜索过并且可能有找到了潜在的解决方案,例如 Wilsons 和 Bayesian...但是他们提供了一篇冗长的文章,其中包含令人困惑的数学方程 - 并且没有提到实现上述目标的方法(即分数...并在 PHP/MySQL 中实现该方法)或至少由于没有任何例子PHP/MySQL 代码让我误解了这一点。
也许这比我想象的更容易 - 我不知道,因为我以前从未需要实现这种“更复杂”的排名/投票功能 - 所以我很感激您的回复。
I'm planning on integrating a reasonable ranking/voting system into an existing application.
I'm familiar with how the traditional 5 star rating systems work and know the common pitfalls/problems associated with them therefore was wondering if there is other ways (I've heard of Wilsons, Bayesian etc. but not really sure on how to implement this with the below structure):
- I'm planning on allowing users to vote on content between 1 to 10 via the contents page.
- The score and total votes for that content will be displayed on the contents page.
- I will also be displaying/listing the Top 10 Content so I'd need the method to be fair/realistic and not make a vote of 10 with total votes of 1 to go straight to number 1.
I'm using PHP
and MySQL
, I have a table for the content (which has a content_id
which I guess I can JOIN
on).
I'm wondering if you can suggest a way/method which achieves the above, I'd appreciate if you can attach some example PHP code and example MySQL schema so I can better understand it, as I've google'd and may have found potential solutions such as Wilsons and Bayesian...yet they provide a lengthy article with confusing mathematical equations - and mention no way which achieves the above (ie. the score....and implenting the method in PHP/MySQL) or atleast due to there not being any example PHP/MySQL code me misunderstanding this.
Perhaps this is easier then I think - I don't know as I've never had the need to implement this sort of "more complex" ranking/voting functionality before - so I'd appreciate your responses.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该首先在 YouTube 上观看此视频:构建网络信誉系统。
为了强调这一点,让我引导您访问 XKCD。
至于数据库结构,您需要以下部分:
total_votes
列)rating
列) ,如果你选择五星级的东西)You should start by watching this video on youtube : Building Web Reputation Systems.
To emphasize the point, let me direct you to XKCD.
As for DB structure, you need following parts:
total_votes
column )rating
column, if you go with 5star thing )