function execute($par)
 {
     global $wgUser, $wgOut, $wgRequest;
     if ($wgUser->isAnon()) {
         $wgOut->showErrorPage('nosuchspecialpage', 'prefsnologintext');
         return;
     }
     $rcTest = new RCTest();
     $testId = $wgRequest->getVal('id');
     $response = $wgRequest->getVal('response');
     $result = $rcTest->gradeTest($testId, $response);
     $wgOut->setArticleBodyOnly(true);
     wfLoadExtensionMessages('RCTestGrader');
     $this->printResponse($result, $response);
 }
Example #2
0
 static function getThumbsUpButton($result, &$rcTest)
 {
     $button = "";
     if (class_exists('RCTest') && RCTest::isEnabled()) {
         if ($rcTest && $rcTest->isTestTime()) {
             $result = $rcTest->getResultParams();
         }
     }
     if (class_exists('ThumbsUp')) {
         $button = ThumbsUp::getThumbsUpButton($result);
     }
     return $button;
 }
<?php

require_once 'commandLine.inc';
$dbr = wfGetDB(DB_SLAVE);
$res = $dbr->select('rctest_users', array('ru_user_id', 'ru_base_patrol_count'), array('ru_next_test_patrol_count' => 2, 'ru_base_patrol_count > 0'));
while ($row = $dbr->fetchObject($res)) {
    $u = User::newFromId($row->ru_user_id);
    $u->load();
    $enabled = RCTest::isEnabled($u->getId()) ? "on" : "off";
    $base = $row->ru_base_patrol_count;
    $wgUser = $u;
    $total = $dbr->selectField('logging', 'count(*)', RCPatrolStandingsIndividual::getOpts());
    $adjusted = $total - $base;
    if ($adjusted > 4) {
        echo "User: " . $u->getName() . ", preference: {$enabled}, adjusted: {$adjusted}\n";
    }
}
Example #4
-1
 static function getThumbsUpButton($result, &$rcTest)
 {
     $button = "";
     if (class_exists('RCTest') && RCTest::isEnabled()) {
         if ($rcTest && $rcTest->isTestTime()) {
             $result = $rcTest->getResultParams();
         }
     }
     if (class_exists('ThumbsUp')) {
         //-1 is a secret code to our thumbs up function
         $result['old'] = $result['old'] != 0 ? $result['old'] : -1;
         $button = ThumbsUp::getThumbsUpButton($result);
     }
     return $button;
 }