|
Purpose
Much of the power of the web comes from interaction, and voting/rating systems are a long proven interaction practice.
This is an attempt to provide a simple 5-stars rating system to MoinMoin.
Installation / Setup
Download
Release 1.6.1, see #ChangeLog. |
-- ZoranIsailovski 2008-01-12 11:21:50 |
|
Version 1.6.1 should work with all MoinMoin versions from 1.3.4 up to and including Moin 1.6. |
||
Release 1.6, see #ChangeLog. |
-- ZoranIsailovski 2007-12-09 19:01:29 |
|
Version 1.6 has changed the licensing model to comprise MoinMoin's "native" licensing model (which is basically "GPL v2 or later"), in order to ease inclusion of the package in Moin's distribution. |
||
Release 1.5, see #ChangeLog. |
-- ZoranIsailovski 2007-11-10 23:39:50 |
|
Version 1.5 is major leap forward. The rating concept was radically changed, and so was the storage concept. The system now "remembers" individual user ratings, so a user can change his/her mind and re-rate without falsifying the rating (only his/her vote is changed). Also, the system optionally accepts anonymous votes now (but still only one per computer). However, there is a caveat: The old storage format is no longer valid. Hence, old rating data is (currently) being ignored, with the effect that existing rating subjects will apear unreated after the switch. If you have severe issues with this, contact me for help on a transition path (just drop me note in the discussion). |
||
Old Release 1.0, see #ChangeLog |
-- ZoranIsailovski 2007-11-04 19:09:33 |
|
I am curious: Anyone using this stuff? Please report use cases in /KnownUses. Thanks a lot. -- ZoranIsailovski |
||
Please report any issues in /KnownIssues. Thx. -- ZoranIsailovski |
Installation
Simply copy the folder named "wiki" from the archive into your wiki root directory (which should contain a folder named "wiki" already). The archive already contains the required directory layout and should add/create the appropriate files where they belong to. If you are upgrading, consider backing up the changes you've made, if any .
Note on themes with black backgrounds:
Stars included in some back-backgrounded themes look hideous. Download simple white-on black stars here: Stars_on_black.zip and copy them to your theme's img folder.
For a usage example see here.
Description
The rating system consists of two components, implemented as Moin macros:
- A 5-stars rating form
- A rank table
Rating Form
To insert a rating form, use:
<<Rating(subject)>>
- Users which are logged in can now rate by clicking on one of the five stars (first star="Rate as 1" fifth star="Rate as 5").
The subject serves two purposes:
It acts as a sort of a page-wide unique key to identify/distinguish ratings on the page. Rating forms on the same page that refer to the same subject will show the same rating.
Ratings across pages that refer to the same subject may be grouped in rank tables (see "Rank Table")
For example, the markup
Java has by far too many braces ... ;) ||'''Is It Comprehensible?''' || <<Rating(Comprehensible)>> || ||'''Batteries Included?''' || <<Rating(BatteriesIncluded)>> || ||'''How Does It Make You Feel?''' || <<Rating(MakesMeFeelGood)>> ||
establishes 3 rating subjects on the page, and may render into something like:
Rank Table
To insert a rank table, use:
<<Ratings([key],[subject_pattern],[page_pattern], [sortby=column_to_sort_by)>>
The argument key is similarl to subject: It serves the purpose to uniquely identify a table on the page.
The argument subject_pattern denotes a pattern expression - every subject that matches the expression will be included in the rank table.
The argument page_pattern denotes a pattern expression, too - every page name that matches the expression will be included in the rank table.
A pattern expression is an expression of the form
shell_pattern {"|" shell_pattern}
where a 'shell_pattern' is the form commonly used for file name matching, like: MySubject1|MySubject2, which is equivalent to MySubject[12], and similar to MySubject? or MySubject*.
The argument column_to_sort_by may be one of subject, rank, page and attendance and specifies the default ordering for that ranking table. The ordering can be changed by clicking on the corresponding column heading.
Note that a rank table only includes ratings actually displayed on pages, not ratings that have been commented out (by prefixing the corresponding line with a "##") or removed from the page.
For example, the markup
||<<Ratings(,Comprehensible,*/Sample/*)>>||<<Ratings(,BatteriesIncluded,*/Sample/*)>>|| ||<<Ratings(,MakesMeFeelGood,*/Sample/*)>>||||
will collect rank information for the individual subjects Comprehensible, BatteriesIncluded and MakesMeFeelGood from all sub-pages of any page named Sample, that is itself a sub-page of some other page.
The above example may render into something like:
Note that a combined table is also supported:
<<Ratings(,Comprehensible|BatteriesIncluded|MakesMeFeelGood,*/Sample/*)>>
More About Ratings
Acknowledgment: This chapter has been inspired by a discussion with OliverSiemoneit. |
Generally, there seem to be two alternative ways to view at / adopt a rating as such:
- Surveys
- Evalutaions and benchmarks
While each is a way for a community to provide feedback, and for the rating initiator to collect feedback, there are distinctions regarding focus and broadness of the process.
Surveys
A survey is aimed at collecting feedback about one particular global topic by means of a single multiple choice question.
By "global" I mean the fact that the rating is the result. The rating initiator does not need a rank table or other means of overview to get his/her answer to that particular question. The focus for providing feedback is the same as the focus for viewing feedback.
Surveys typically go all on a single page (or a few several pages grouped by superordinate topic), and are manually organized in tables or simlarly.
For example:
Evaluations And Benchmarks
In contrast to surveys, evalutaions imply a distinction in focus between providing feedback (rating) and viewing feedback.
During evaluation, the rater is focused on the review of individual items with regard to one or several aspects. For this process, a local view of the item is optimal. In a wiki, such items should be preferably placed on individual pages.
Even if individual item ranking might be interesting at times, it is much more interesting to view a comparison of evaluation results grouped by one or more selected aspects - i.e., to benchmark the items with regard to one or more selected aspects.
The presented rating system supports evaluation and benchmarking by
the notion of a subject - which may also read aspect under benchmark, and
- the provision of rank tables with selectable subjects on them.
The examples in the description chapter are all of the evaluation/benchmark kind.
Copyright
Copyright (C) 2007 Zoran Isailovski
Acknowledgments
I've got the inspiration for this when I played around with the macro RatingStars by NickKing, which is based on two nice ideas:
- Store rating results into an attachment file
- Utilize moin's smiley system for rendering rating stars
These are the ideas I have "borrowed". Besides that, I've written everything else from scratch.
Known Issues
Caching issues
Hi Zoran, I have observed the following minor issues in 1.5. Maybe you want to have a look at this. I'm using Firefox 2.0 in case it is browser related:
FIXED: 1.) After I have logged out I can still vote and the vote counts. It then jumps to the very beginning of the page and reloads it. After that no votes are possible anymore until I re-login. This happens with 1.5rc1 (switch to disallow anonymous voting set) and 1.5rc2.
I am using Moin 1.3.4 desktop edition and I just retried these steps with it (and Firefox 2.0), but I could not reproduce the effect. (The effect I do get, but only on one computer so far, is that the cookie does not get deleted at all.) However, if you get the chance to try it with an 1.3.x version of moin and DO get the effect there, too, please let me know. In the mean time, I'll install moin 1.5 and try it there. Cheers -- ZoranIsailovski 2007-11-07 16:18:26
Ok, I'm running Moin 1.5.8 on a Windows 2003 Server with Apache and authentication via LDAP and Moin Cookies (in that order). So it might actually be related to that somehow. -- AnkeHeinrich 2007-11-08 00:25:31
I checked this with Moin Desktop 1.5.5a-1 (the latest available ). Indeed, it seems to be an issue related to Moin somehow: After logging out in Moin 1.5, Moin's User API still returns the data (like user.name and user.exists()) of the user that just logged out - but only during the very first HTTP request. On the other hand, I wonder how the "logout" link changes to "login" immediately then... I'll need to investigate some more... -- ZoranIsailovski 2007-11-08 04:15:56
Workaround found -- ZoranIsailovski 2007-11-08 05:59:09
Zoran, I have tried with 1.5rc4. It looks still the same except that the vote is not counted anymore. But I still don't get the usual error message and it still jumps to the top and reloads the page. I guess that's what you meant with workaround. So, yeah fine for me -- AnkeHeinrich 2007-11-09 02:45:26
I never could reproduce that "jump-and-reload" behavior, just the thing about "anonymous-rating-allowed-once". What I meant was: I found a workaround for the MoinMoin misbehavior described above, but that workaround actually fixed your "anonymous-rating-allowed-once" issue. The "jump-and-relaod" thing remains mysterious to me. -- ZoranIsailovski 2007-11-09 06:28:17
CANNOT REPRODUCE: 2.) In 1.5rc2 after I have changed the template to display the number of votes in the rating I have again a caching issue. The number of votes seems never to be displayed for anonymous users (is this intended?). However, after I login I also don't get the vote number. Only after refreshing the page the votes are displayed. When I log out again the number of votes are still displayed and I'm allowed to vote until refresh (see 1).
Not displaying the numbers of votes in "anonymous mode" is encoded in the template, and though I had no particular reason not to display that information, you could say it is "intended". Joke. I probably just forgot to add it. I'll change it to show up in either mode. Thanks.
Regarding the other effect, it's the same as above. I could not reproduce that one either with moin 1.3.4. (On the other hand, I did post the rating system to the 1.3 section in the extension market actually, so ... ) -- ZoranIsailovski 2007-11-07 16:18:26
This effect does not always show and I consider this similar to the first one. Anyway, it's not really important. It just confused me, so I mentioned it. But when thinking about it you cannot really do much harm there, because this would only occur if the user has logged in before. -- AnkeHeinrich 2007-11-08 00:25:31
Unfortunately, I could not reproduce this one on my Moin Desktop 1.5.5a-1 either (I'm running it on a Win2000 server though). After logging in, I am immediately able to rate and see everything. Though the issue seemed closely related to the 1st one, it now seems something else. Weird stuff... -- ZoranIsailovski 2007-11-08 04:15:56
Forget about it. I can also not reproduce this anymore. Whatever it was it's gone. -- AnkeHeinrich 2007-11-09 02:45:26
FIXED: 3.) The display of too many decimals is a bit annoying, e.g. (total: 3.66666666667). I think 3 decimal places would be enough or maybe another configuration option can help if one really needs more. This was already the case in the 1.0 release, but now that there is more space needed for the other info, e.g. 'mine:3.0' its simply more eye catching.
Yeah. That one is annoying me, too. I just considered it low prio... -- ZoranIsailovski
2007-11-07 16:18:26
Fixed -- ZoranIsailovski 2007-11-08 05:59:09
It shows now only one decimal place for logged-in users, e.g. 3.3: mine: 3. However, anonymous users still see the long numbers (after refresh), e.g. 3.33333333333 out of 3 votes.
Now really fixed, I hope. -- ZoranIsailovski 2007-11-09 06:28:17
Regards -- AnkeHeinrich 2007-11-07 03:45:00
FIXED: 4.) In addition, probably related to the changes for (3.) anonymous users can see the number of votes, no matter how SHOW_ATTENDANCE_IN_FORM is configured. Logged-in users on the other hand never see the number of votes, no matter how SHOW_ATTENDANCE_IN_FORM is configured (I tried True and False). I have removed the old directory completely and deleted the cache to make sure I really used 1.5rc4. Please, check again on this. -- AnkeHeinrich 2007-11-09 02:45:26
Hmm, that last one sentence sounds a lot like project managers sound...
Anyway: Finally, I fixed that last one, too. You are welcome! -- ZoranIsailovski (who is missing the nice American way of showing appreciation a little bit lately). 2007-11-09
Sorry about that Zoran, I was a bit tired yesterday. I really do appreciate your nice work and the quick responses and patches If I had you in my project we would probably have finished it 3 weeks ago already and not have to test late night until the very last day before the deadline. So, please bear with me. I apologize for the "sound". I'll re-test tonight after I have delivered my product and I promise I will be more relaxed than -- AnkeHeinrich 2007-11-09 11:42:30
Zoran, I have now tested with 1.5rc5 and everything looks good.
FIXED: Just one small thing: Anonymous users who are not allowed to vote see now the following text: (total: 3.67 out of 3 votes; mine: none yet). Before it was only (total: 3.67 out of 3 votes) which makes more sense IMHO. Anyway great work. I personally hope you can solve the licencing issues with the MoinMoin team, so it gets included in one of the future versions -- AnkeHeinrich 2007-11-09 22:31:59
I have fixed the "mine: none yet" thing now. Anke, many many thanks for your unremitting input. I hope everything went well with your project. (I think so, because you really did appear more relaxed. ) -- ZoranIsailovski 2007-11-10 23:55:29
Yep, works! That really is a piece of mature software now! And yes, my project is finished (just in time) -- AnkeHeinrich 2007-11-11 02:03:41
Rights to change the rating
I was trying to use it on my privat site (http://www.heavy.ch/Saga/Album/10.000_Days) the main problems are, that I want either:
- see wich user changed the points/stars from e.g. 3 to 5 points (so it would evolve to a kind of user rating system with history) or
REJECTED - would break anonymity principle -- ZoranIsailovski 2007-11-08 06:22:09
- preventing over acl; that only the "site creator" or "admin" can change it (but the rest of the page should stay writeable for the public).
REJECTED due to lack of comprehensible information -- ZoranIsailovski 2007-11-08 06:22:09
bye MarcelHäfner
Hi Marcel, and thanks for your feedback. Though... I don't quite see the issue in the rating system?!? I mean, if you only wanted rating rights for yourself (as site admin), then it's not a rating - it's a 5-star display only.
Regarding the visibility of ratings in the edit log: I'm very ambivalent about this. In general, ratings should be anonymous, so showing who rated what and how in the edit log (or anywhere else) contradicts that idea. On the other hand, there are situations when such information may be useful (see the doodle discussion). Perhaps I just don't quite get your intention with the rating system. If you 'd like to explain it, I might be able to help.
Cheers -- ZoranIsailovski 2007-11-04 17:23:11
Hi Zoran; sorry, but got no time to write my idea in some usefull way down. anyway my message should go under questions and definitly not Issues/Bugs. So it's ok to reject it! thx -- MarcelHäfner 2007-11-08 07:14:04
History
- 1.6.1
-
Integrated community-provided fixes for MoinMoin 1.6 in a manner that preserves backward compatibility. Many thanks to ReimarBauer, BenjaminWeber and JonathanRogers.
- Fixed some minor ("cosmetic") bugs.
- 1.6
Changed license terms to comprise "GPL v2 or later", in order to ease inclusion in MoinMoin distribution.
- 1.5
Promoted status of 1.5rc6 to 1.5 final - the RC has been stable long enough now.
- 1.5rc6
- This revision adds some more flexibility to the system.
Added option DEFAULT_SORT_ORDER to MoinRatings/main.py that denotes default sorting for ALL ranking tables.
The ranking table macro, Ratings, accepts an extra parameter to specify the default sort ordering for THAT ranking table. The macro may now be invoked like this: <<Ratings([key],[subject_pattern],[page_pattern],[sortby=column])>>, for example <<Ratings([Overview],relevance|urgency,Ideas/*,sortby=rank)>>.
Users not allowed to vote do not see the (useless) "mine: none yet" information any more. (Reported by AnkeHeinrich)
- 1.5rc5
Unfortunately, some oversights slipped into the last release. Hence this release, which fixes these issues:
- Formatting was not two decimal places max, as stated, but just one. Now it is.
- Due to a (sort of) misspelling in the template, SHOW_ATTENDANCE_IN_FORM had no effect. Now it has.
Due to a violation of the DRY principle, users w/o vote permission would still see long numbers for ranks. (I should do what I preach )
- 1.5rc4
Found workaround for Moin 1.5 issue that led to a state when anonymous rating would be accidentally enabled immediately after logout - but not after the next page update (i.e., the next HTTP request). (Reported by AnkeHeinrich)
Rank is now displayed with at most 2 decimal places in rating forms.
Added option SHOW_ATTENDANCE_IN_FORM in MoinRatings/main.py so that users won't have to mess around with template files just to change whether the total number of votes is shown in the rating form or not. The option is preset to False (for reasons discussed elsewhere).
- Fixed some minor template bugs.
- 1.5rc3
Many thanks to AnkeHeinrich for the valuable hints that helped in shaping this release.
- The rating form respects write permissions now. Users with no write permissions will not be able to rate.
As a consequence, anonymous ratings are now enabled by default.
- When a rating is rejected, a (hopefully) appropriate message is shown, depending on anonymous rating inhibition and user log-in state.
- 1.5rc2
- The ranking table has got a new column, 'Votes', showing the total number of votes, too. The column is clickable, providing for 'sort by attendence'.
The rating form has been prepared to show the total number of votes. However, I consider that information as psychologically questionable, so that this feature is disabled in the form template. Users may enable it by simply uncommenting the corresponding line near the end of the form template file.
- Anonymous votes are now disabled by default (but may be easily enabled by users). I'll keep it this way until I find a way to take ACL's into account properly.
Fixed some minor bugs (there are no major bugs, as it seems )
- 1.5rc1
Version 1.5 is major leap forward. The rating concept was radically changed, and so was the storage concept. The system now "remembers" individual user ratings, so a user can change his/her mind and re-rate without falsifying the rating (only his/her vote is changed). Also, the system optionally accepts anonymous votes now (but still only one per computer). However, there is a caveat: The old storage format is no longer valid. Hence, old rating data is (currently) being ignored, with the effect that existing rating subjects will apear unreated after the switch. If you have severe issues with this, contact me for help on a transition path (just drop me note in the discussion).
- 1.0
- (In)Formaly promoted last stable RC to final.
- 1.0rc4
Fixed hyperlink url issue in ranking table headers (reported by AnkeHeinrich).
- 1.0rc3
Workaround for buggy (in moin 1.3.4) method Page.getPageText that caused some ratings to not appear in rank tables (now using get_raw_body() or '')
- Some code cleanup
- 1.0rc2
- Fixed missing references in the package (something went wrong when packaging the 1.0rc1 zip file)
- Added row numbers to rank tables
- 1.0rc1
- initial public release
Discussion
All discussions over here please! -- ZoranIsailovski 2008-01-12 11:03:28 |