Thanks for your interest in this project.
I am wanting to build a rating system for mediawiki. It will be used primarily on [url removed, login to view] to allow parents to rate a playground, each playground is a separate article. It is a fairly standard 5 star rating system with a few twists. Feel free to use opensource modules - I am happy for this work to be returned to the opensource community.
I guess it is a bit like this.
[url removed, login to view]:AjaxRatingScript
The system has 3 main "modules". Snippets like this will be placed in the article or template for articles to be rated.
This will display the main working area for users to rate a playground.
The form has 4 fields
1) Username (if user logged in default their username - but allow them to change)
2) star rating - 0 and 5 stars (in whole star increments)
3) one word comment (eg awesome, great, hot, windy, noisy) ie no spaces allowed limit to 25 characters
4) comment (allow users to have there say in a paragraph (do not allow HTML but do allow wiki markups)
in the database please also save the
a) user id (if logged in)
b) user id IP address
c) date and time created
d) article id (obviously needed)
e) report = 0
f) hidden = 0
this will display all the reviews in a list for this particular article - like a forum
This is where the parents will read through to see what other parents think of the playground.
Each review will also have a with "Report" link
If the user clicks on "Report" then an alert will popup with a message "would you like to alert the administrator to this post" Yes no? If the users clicks yes then the system should e-mail admin the content of the review, the IP of the reporter, and a link to the article on which the report was made - add 1 to the report count to the rating in the Database.
Give admin a "Hide" option which removes the review form site and from all reports. In future this review will only be viewable by admin and will be greyed out.
Timeago is calculated based on the date of rating.
if xx mins ago
if xx hrs ago
if xx days ago
if xx weeks ago
if xx months ago
else xx years ago
Format something link this
USERNAME RATING***** ONEWORD Timeagao (REPORT)(HIDE)
Mary ****. Best 2 days ago
I took my two boys here and it was really good, nice shade and friendly locals
This module will display the playground rating as a number of stars - based on users ratings.
if there are no ratings default to midway point (2.5 stars)
Display the average (median) number of stars.
ie show 3 yellow stars and 2 faint outlined stars if the playground is a 3/5
Round to the nearest half star.
Please maintain a table with article ID and star rating number for article sorting (the article sorting part is beyond the scope of this project, but I just need to table as part of this project.)
Please note that this code will need to work on site using mysql and postgres DB
I hope that all makes sense. Please feel free to ask questions.