The BGA rating system is controlled by code and files held on the BGA website in public_html/rating/graph
It runs every night to process the info from EGD and produce various web pages, messages and files of output.
The following needs updating as a result of moving to Bytemark and changing the system in February 2011 - John
The contents of the rating/graph directory are:
all.hst graph.php results_pages.txt alleuro.html hisgor.zip tlist.html archive index.php tournament_names.txt calibration.txt name_changes.txt update.pl calibration_backup.txt percentiles.html update.pl.2008 certificates.txt percentiles.pl update.pl.2009a championship_qualifiers.html player_names.txt update.pl.old club_names.txt possible_certificates.php update_cal.pl comparison.html possible_promotions.txt update_tlist.pl data qualifiers.html exclusions.txt readme.txt
Some of those are old versions of code, etc
The main program is update.pl but also update_cal.pl and update_tlist.pl are used. The later two seldom need changing. It is update.pl that does the bulk of the work and is the thing that needs changing from time to time. It was written by Tim Hunt, but I have changed some bits of it from time to time.
Beware that I (Tony Atkins) usually change the sources I keep and then upload, so any changes should be notified back to me.
Some of the things in the directory are subdirectories:
data contains .txt files for the playerids of each player. archive contains dated comparison.html files for the grader's reference (comparison between BGA and EGF grades etc).
The .pl programs are automatically run each night, but can be manually run using ./xxxxx.pl from within the rating/graph directory. Login to the maproom user using PuTTY or equivalent and cd into public_html/rating/graph
If you can file transfer directly into the directory then do so, but if your free FTP program will not allow this (due to permissions problems in the Pair setup) then file transfer in to directory tournament_results and use mv -i filename ../public_html/rating/graph/filename to move the file across.
There are certain things that need changing from time to time, for example the name of the EGD file (when they change it), and the qualification year (eg 2010). All the constants such as the year number and filenames are defined at the beginning and are easy to find. Note that the dates used start at month 0 so 2 is March and 3 is April. The qualification year is currently set to 1st April 2010 to 30th March 2011. This will need resetting April next year to set the new candidates qualifiers in file qualifiers.html.
It creates 2 web pages: the main rating list page, the qualifiers page.
Various messages can be sent upon each run. The code has been set to supress these (using boolean $supress). Some may still be issued in some failure conditions. When the code ran monthly it was no problem to generate messages, but with a run every night too many messages are produced if not supressed.
The EGD file is transfered in and unzipped for processing. It overwrites the previous version in the directory.
Each event has a 8 character code made the type, startdate and a unique suffix. The results_pages.txt file needs updating after each event to point to the results page on the BGA web site. If no BGA page is available the EGF page can be used. Other country and tournament pages are unreliable and often disappear so for most foreign events it is best just to point to the tournaments entry in the EGD database using the key.
This file needs to end up in rating/graph once amended. It will be picked up on the next run (eg overnight).
Then on the rating page there will be a link on the last played date for each person, and on each person's page to all the rated events they have played.
When a person is awarded a dan certificate their entry should be updated or created in certificates.txt. This is used when looking for promotions to recommend to the secretary in possible_promotions.php (by way of the equivalent possible_certificates.txt file).
To exclude someone from the ratings file eg deceased players there is a list held in the update.pl code:
my %exclude = ( '10537659','10537659','13074061','13074061','10613801','10613801');
This was originally intended to be held in a file of exclusions.txt, but due to a bug in perl on Pair's system the implemented code never worked.
The number is the EGD playerid.
EGD uses 4-char club codes and formerly 3-char ones. Our code converts those to real names using club_names.txt
Check the rating list for new codes appearing unconverted (most club names are longer than 3 or 4 characters so they are easy to spot) or get an update from Geoff Kaniuk.
This program updates the calibration reports for Geoff.
This program runs first to see if the EGD data has changed since the last run and aborts the rating run if no change is detected.
Geoff Kaniuk also gets his list of players/clubs/grades from the rating update for use in GoDraw. The update_players_list.pl script runs at the nightly ratings update. The script and its associated workhorse 'playerlist.c' resides in .../godrawsys.