Difference between revisions of "InstaGov/schema/rating"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
m (a bit of "about" doc was still down under "SQL" -- moved it)
m (using new terms template)
Line 1: Line 1:
 
==About==
 
==About==
* '''Purpose''': implements {{instagov|concepts|rating}}s, i.e. a record of each user's current rating of each proposed solution.
+
* '''Purpose''': implements {{igov/term|rating}}s, i.e. a record of each user's current rating of each proposed solution.
 
* '''Rules''':
 
* '''Rules''':
 
** Any {{l/same|answer}} may have zero or more ratings.
 
** Any {{l/same|answer}} may have zero or more ratings.
 
** Each user sets the value of their rating for each answer, and can change that rating at any time.
 
** Each user sets the value of their rating for each answer, and can change that rating at any time.
 
** Changes to ratings are logged in the {{l/same|rating log}}.
 
** Changes to ratings are logged in the {{l/same|rating log}}.
** Users can set their ratings directly, or by choosing a {{instagov|concepts|proxy}} to rate for them.
+
** Users can set their ratings directly, or by choosing a {{igov/term|proxy}} to rate for them.
 
==SQL==
 
==SQL==
 
<mysql>CREATE TABLE `rating` (
 
<mysql>CREATE TABLE `rating` (

Revision as of 17:01, 6 January 2013

About

  • Purpose: implements ratings, i.e. a record of each user's current rating of each proposed solution.
  • Rules:
    • Any answer may have zero or more ratings.
    • Each user sets the value of their rating for each answer, and can change that rating at any time.
    • Changes to ratings are logged in the rating log.
    • Users can set their ratings directly, or by choosing a proxy to rate for them.

SQL

<mysql>CREATE TABLE `rating` (

  `ID` INT  NOT NULL AUTO_INCREMENT,
  `ID_User` INT COMMENT "user.ID who gave this rating",
  `ID_Answer` INT NOT NULL COMMENT "answer.ID for which this is a rating",
  `ID_Log` INT NOT NULL COMMENT "ID of log event which posted this value",
  `ID_Proxy` INT DEFAULT NULL COMMENT "if this approval was proxied, records which proxy was used",
  `Value` INT NOT NULL COMMENT "rating value",
  `WhenDone` DATETIME NOT NULL COMMENT "when this rating was posted",
  `Remark` VARCHAR(255) COMMENT "comments on this rating (can include link)",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>