Index: trunk/extensions/ArticleAssessmentPilot/api/ApiArticleAssessment.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | class ApiArticleAssessment extends ApiBase { |
4 | 4 | public function __construct( $query, $moduleName ) { |
5 | | - parent::__construct( $query, $moduleName, 'aa' ); |
| 5 | + parent::__construct( $query, $moduleName, '' ); |
6 | 6 | } |
7 | 7 | |
8 | 8 | public function execute() { |
— | — | @@ -118,6 +118,8 @@ |
119 | 119 | */ |
120 | 120 | private function insertUserRatings( $pageId, $revisionId, $user, $token, $ratingId, $ratingValue ) { |
121 | 121 | $dbw = wfGetDB( DB_MASTER ); |
| 122 | + |
| 123 | + $timestamp = $dbw->timestamp(); |
122 | 124 | |
123 | 125 | $res = $dbw->insert( |
124 | 126 | 'article_assessment', |
— | — | @@ -127,7 +129,7 @@ |
128 | 130 | 'aa_user_id' => $user->getId(), |
129 | 131 | 'aa_user_text' => $user->getName(), |
130 | 132 | 'aa_revision' => $revisionId, |
131 | | - 'aa_timestamp' => wfTimestampNow(), |
| 133 | + 'aa_timestamp' => $timestamp, |
132 | 134 | 'aa_rating_id' => $ratingId, |
133 | 135 | 'aa_rating_value' => $ratingValue, |
134 | 136 | ), |
— | — | @@ -141,7 +143,7 @@ |
142 | 144 | $dbw->update( |
143 | 145 | 'article_assessment', |
144 | 146 | array( |
145 | | - 'aa_timestamp' => wfTimestampNow(), |
| 147 | + 'aa_timestamp' => $timestamp, |
146 | 148 | 'aa_rating_value' => $ratingValue, |
147 | 149 | ), |
148 | 150 | array_merge( |
— | — | @@ -202,6 +204,10 @@ |
203 | 205 | 'Submit article assessments' |
204 | 206 | ); |
205 | 207 | } |
| 208 | + |
| 209 | + public function mustBePosted() { |
| 210 | + return true; |
| 211 | + } |
206 | 212 | |
207 | 213 | public function isWriteMode() { |
208 | 214 | return true; |
Index: trunk/extensions/ArticleAssessmentPilot/js/ArticleAssessment.js |
— | — | @@ -275,13 +275,13 @@ |
276 | 276 | url: wgScriptPath + '/api.php', |
277 | 277 | data: { |
278 | 278 | 'action': 'articleassessment', |
279 | | - 'aarevid': config.revID, |
280 | | - 'aapageid': config.pageID, |
281 | | - 'aar1' : results['wellsourced'], |
282 | | - 'aar2' : results['neutrality'], |
283 | | - 'aar3' : results['completeness'], |
284 | | - 'aar4' : results['readability'], |
285 | | - 'aaanontoken': config.userID, |
| 279 | + 'revid': config.revID, |
| 280 | + 'pageid': config.pageID, |
| 281 | + 'r1' : results['wellsourced'], |
| 282 | + 'r2' : results['neutrality'], |
| 283 | + 'r3' : results['completeness'], |
| 284 | + 'r4' : results['readability'], |
| 285 | + 'anontoken': config.userID, |
286 | 286 | 'format': 'json' |
287 | 287 | }, |
288 | 288 | dataType: 'json', |