Judges Currency

Overview

The shell script ~webmaster/scripts/judges/daily-update.sh is invoked by ~webmaster/scripts/master-script.sh, and in turn invokes two PHP scripts: import.php and currency.php, described below.

Importing Judging Experience Records

The ~webmaster/scripts/judges/import.php script retrieves the "contest experience" factors listed above from IACCDB and stores them as Judging Experience records. The remaining factors are stored in the web server's database as Quiz, Judges School, and user records, respectively.

While many factors go into determining whether a judge is current, only two events can change a judge from current to non-current: expiration of their IAC membership (Rule 2.6(a)) and the publication of the new year's R&C exam.

Expired memberships are filtered out by the Current Judges view. (Note: For the sake of symmetry, there is also a Lapsed Judges view.)

In order to determine if a judge has passed this year's R&C exam, the IAC module must be updated with the exact title of the corresponding Quiz node. This is accomplished by editing the files /usr/local/share/drupal7/sites/www.iac.org/modules/iac/iac.module and /home/webmaster/scripts/judges/currency.php and adding an entry to each file's $rc_exams array:

  # Titles of each year's R&C exam. Will need to update this annually.

  $rc_exams = Array(

    2015 => '2015 Judges Revalidation & Currency Exam',

    2016 => '2016 Judge Revalidation & Currency Exam',

    2017 => '2017 JUDGE REVALIDATION & CURRENCY EXAM',

    2018=> '
2018 Judges Revalidation & Currency Exam',

  );

"First publication" is a somewhat outmoded concept because the list is now automatically updated nightly. Therefore I've created a script in ~webmaster/scripts/judges/bulk_expire.php that makes all judges non-current, to be invoked manually on whatever date the Judges and/or Rules Committee Chairs determine. (In 2015, the "pumpkin" date was supposed to be March 31st, but didn't actually happen until April 15th.) The script contains comments that explain how to run it from a Linux shell (requires ssh login as webmaster).

Before running the bulk_expire script I copied the output of the Lapsed Judges view to a flat file, ran the currency.php script (see below) to reinstate all judges who have already met the requirements for currency this year, and once again copied the output of the Lapsed Judges view to a flat file. Running diff on those before-and-after flat files produced the list judges who were newly expired. I then performed a little magic to convert that to a list of email addresses, and sent each judge a note stating that they have some requirements to fulfill before in order to become current again. That email linked to the Judging and Contest Experience view which shows the user all of the factors that are relevant to judge currency.

Making Judges Current

The script ~webmaster/scripts/judges/currency.php, typically invoked via cron, searches for all non-current judges and then looks for relevant experience in the various database records. If it determines that a non-current judge now meets the requirements of Rule 2.6.3, it will automatically reinstate that judge by setting the current field in the user's profile to true.

Changing a judge from non-current to current triggers a Drupal rule that sends the user a congratulatory email: https://www.iac.org/admin/config/workflow/rules/reaction/manage/rules_j…

The following diagram illustrates the data flow between people and systems: