r72530 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72529‎ | r72530 | r72531 >
Date:11:59, 7 September 2010
Author:reedy
Status:ok
Tags:
Comment:
Better comments for SQL and ArticleAssessmentPilot.php

Remove some unused functions from ArticleAssessmentPilotHooks (Never used after being added.. in r71945)
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.php (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.sql (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/api/ApiQueryArticleAssessment.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.sql
@@ -1,42 +1,49 @@
22 -- Store mapping of i18n key of "rating" to an ID
33 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/article_assessment_ratings (
 4+ --Rating Id
45 aar_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 6+ --Text (i18n key) for rating description
57 aar_rating varchar(255) binary NOT NULL
68 ) /*$wgDBTableOptions*/;
79
 10+--Default article assessment ratings for the pilot
811 INSERT INTO /*$wgDBprefix*/article_assessment_ratings (aar_rating) VALUES
912 ('articleassessment-rating-wellsourced'), ('articleassessment-rating-neutrality'),
1013 ('articleassessment-rating-completeness'), ('articleassessment-rating-readability');
1114
 15+-- Store article assessments (user rating per revision)
1216 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/article_assessment (
1317 -- Foreign key to page.page_id
1418 aa_page_id integer unsigned NOT NULL,
 19+ -- User Id (0 if anon)
1520 aa_user_id integer NOT NULL,
16 - -- unique user identifier
 21+ -- Username or IP address
1722 aa_user_text varchar(255) binary NOT NULL,
 23+ -- Unique token for anonymous users (to facilitate ratings from multiple users on the same IP)
1824 aa_user_anon_token binary(32) DEFAULT '',
1925 -- Foreign key to revision.rev_id
2026 aa_revision integer unsigned NOT NULL,
2127 -- MW Timestamp
2228 aa_timestamp binary(14) NOT NULL DEFAULT '',
23 - -- Rating info
 29+ -- Foreign key to article_assessment_ratings.aar_rating
2430 aa_rating_id int unsigned NOT NULL,
 31+ -- Value of the rating (0 is "unrated", else 1-5)
2532 aa_rating_value int unsigned NOT NULL,
2633 -- 1 vote per user per revision
2734 PRIMARY KEY (aa_revision, aa_user_text, aa_rating_id, aa_user_anon_token)
2835 ) /*$wgDBTableOptions*/;
2936 CREATE INDEX /*i*/aa_user_page_revision ON /*_*/article_assessment (aa_user_id, aa_page_id, aa_revision);
3037
 38+-- Aggregate rating table for a page
3139 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/article_assessment_pages (
3240 -- Foreign key to page.page_id
3341 aap_page_id integer unsigned NOT NULL,
34 - -- Which "rating"
 42+ -- Foreign key to article_assessment_ratings.aar_rating
3543 aap_rating_id integer unsigned NOT NULL,
3644 -- Sum (total) of all the ratings for this article revision
3745 aap_total integer unsigned NOT NULL,
3846 -- Number of ratings
3947 aap_count integer unsigned NOT NULL,
 48+ -- One rating row per page
4049 PRIMARY KEY (aap_page_id, aap_rating_id)
4150 ) /*$wgDBTableOptions*/;
\ No newline at end of file
Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.php
@@ -1,14 +1,14 @@
22 <?php
33
4 -// settings
5 -
6 -// number of new revisions to mark the last rating as old
 4+// If the number of page revisions (since users last rating) is greater than this
 5+// then consider the last rating "stale"
76 $wgArticleAssessmentStaleCount = 5;
87
98 // Number of "ratings" to store. Allows it to be a bit more dynamic
109 $wgArticleAssessmentRatingCount = 4;
1110
12 -//Category the pages are in (with _ in text)
 11+// Which category the pages must belong to have the rating widget added (with _ in text)
 12+// Extension is "disabled" if this field is an empty string (as per default configuration)
1313 $wgArticleAssessmentCategory = '';
1414
1515 // Auto-load files
@@ -36,7 +36,7 @@
3737 $wgExtensionCredits['other'][] = array(
3838 'path' => __FILE__,
3939 'name' => 'Article Assessment Pilot',
40 - 'author' => array( 'Nimish Gautam', 'Sam Reed' ),
 40+ 'author' => array( 'Nimish Gautam', 'Sam Reed', 'Adam Miller' ),
4141 'version' => '0.1.0',
4242 'descriptionmsg' => 'articleassessment-desc',
4343 'url' => 'http://www.mediawiki.org/wiki/Extension:ArticleAssessmentPilot'
Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php
@@ -135,23 +135,4 @@
136136 __METHOD__
137137 );
138138 }
139 -
140 - /**
141 - * Adds a reference to a javascript file to the head of the document
142 - * @param string $src Path to the file relative to this extension's folder
143 - * @param object $version Version number of the file
144 - */
145 - public static function addScript( $src, $version = '' ) {
146 - // The key is Andrew's snarky 20-character way of stopping multiple inclusion of the same file.
147 - self::$scripts["$src?$version"] = array( 'src' => $src, 'version' => $version );
148 - }
149 -
150 - /**
151 - * Adds internationalized message definitions to the document for access
152 - * via javascript using the mw.usability.getMsg() function
153 - * @param array $messages Key names of messages to load
154 - */
155 - public static function addMessages( $messages ) {
156 - self::$messages = array_merge( self::$messages, $messages );
157 - }
158139 }
Index: trunk/extensions/ArticleAssessmentPilot/api/ApiQueryArticleAssessment.php
@@ -1,10 +1,4 @@
22 <?php
3 -/**
4 - *
5 - *
6 - * @file
7 - * @ingroup API
8 - */
93 class ApiListArticleAssessment extends ApiQueryBase {
104 public function __construct( $query, $moduleName ) {
115 parent::__construct( $query, $moduleName, 'aa' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71945ArticleAssessment - completed the majority of the front end code. Just need t...adam12:52, 30 August 2010

Status & tagging log