# Ratings and tsh

How to maintain a rating system using tsh.

Updated Sun 10 Jun 2018 15:31:21 EDT for tsh 3.300.

One of the more popular features of tsh is its calculation of tournament ratings. When you set up your tournament’s “.t” files with information about your players, you enter their pretournament ratings, and if necessary their career game totals (depending on your rating system, you may be able to use the “`USERATINGS`” command to do this automatically). As your tournament progresses, you can display current ratings using the “`RATings`” and “`ScoreBoard`” commands. At the end of your tournament, you can submit ratings data to your rating officer using the “`SUBMIT`” command (if your rating system is supported), or by generating a ratings report using commands like “`ABSPgrid`” or “`AUPAIR`” and emailing the results.

The rest of this section describes in greater technical detail what is involved in connecting tsh to a rating system, and its intended audience includes ratings officers and directors who want to discuss tsh with their ratings officers. As always, if there is anything that tsh doesn’t yet do that you would like it to do, please contact John Chew at poslfit@gmail.com. Each one of tsh’s features is there because someone asked for it; if a feature is missing, it’s just because you haven’t asked for it yet.

## Files

tsh stores pretournament rating information for each player in a tournament’s “.t” data files.

tsh stores information about rating systems in its “lib/ratings” folder. This folder contains one sub-folder per rating system. For historical reasons, NASPA ratings are stored as “nsa”. If you want tsh to support a new rating system, the first step is to ask John Chew to assign you a new, unique rating system name.

Rating system sub-folders contain contain files such as:

current.txt
  the current ratings file, a text file that contains current ratings and possibly other information for each rated player
new.txt
  the new ratings file, a text file that contains locally calculated new ratings and possibly other information for each rated player
MANIRATS.txt
  the timestamp file, a text file that contains timestamp data used to tell whether or not the current ratings file is obsolete

## Manual Rating Systems

Example users: Philippines, Toronto Speed

It’s easy to use tsh to run a small rating system for one or more people to use on one computer.

1. At the beginning of each rated event, use the “`USERATINGS`” command. This copies ratings from your current ratings file to your tournament data files.
2. At the end of your tournament, use the “`EXPORTRATINGS`” command. This creates a new ratings file.
3. Finally, save a copy of your old current ratings file in case you need to rerate a sequence of events (it happens more often than you would think), and replace it with the new ratings file.

## Legacy Rating Systems

Example users: WESPA

If you have an existing legacy rating system that cannot easily be connected to the web, you should determine what ratings data format it uses (tsh currently supports its native format, Homan, Aupair and ABSP grid formats), and have your tournament directors e-mail the appropriate reports to your ratings officer. If you can persuade your ratings officer to post current ratings online, your directors can use the “`USERATINGS`” command.

## Semiautomated Rating Systems (Type 1)

Example users: PSA

If you use more than one computer to run rated events but do not have a system set up to automatically receive online rating submissions, you can use an FTP client to maintain a shared rating database online.

First, ask John Chew to do the following:

- Set up an FTP account for you where you and your colleagues can store rating data.
- Set up a webpage that you can visit to register updates to your rating data. Its URL will include “update-ratings”.

Then, at each rated event:

1. Use the “`UPDATERATINGS`” command. This fetches the current ratings file from the FTP server.
2. Use the “`USERATINGS`” command. This copies ratings from your current ratings file to your tournament data files.
3. Run your event.
4. Use the “`EXPORTRATINGS`” command. This creates a new ratings file.
5. Use your FTP client to upload the new ratings file to your FTP account.
6. Visit the webpage that registers updates to your rating data.

## Semiautomated Rating Systems (Type 2)

Example users: Scrabble Kenya

If you use more than one computer to run rated events but do not have a system set up to automatically receive online rating submissions, you can use a web client to maintain a shared rating database online.

First, ask John Chew to do the following:

- Set up a webpage that you can visit to post updates to your rating data. Its URL will include “post-ratings”.

Then, at each rated event:

1. Use the “`UPDATERATINGS`” command. This fetches the current ratings file from the FTP server.
2. Use the “`USERATINGS`” command. This copies ratings from your current ratings file to your tournament data files.
3. Run your event.
4. Use the “`EXPORTRATINGS`” command. This creates a new ratings file.
5. Use your web client to upload the new ratings file. Note that this step could be done by a different individual (a ratings officer) from the previous step, in order to retain more control over the addition of rated events to the rating system.

## Automated Rating Systems

Example users: ABSP, NASPA

If you have a large rating system or like automation, you should set up (or ask John Chew to set up) a web page to which your tournament directors can upload ratings data using the “`SUBMIT`” command. Once it’s uploaded, your web site may immediately calculate new ratings and make them available for download to the “`USERATINGS`” command, or it may hold them for manual verification, as NASPA currently does.