Contest Practice Sign-up

Requirements & Implementation Notes

  1. The Contest node author sets the start and end of the practice period(s)
    • Implemented via the Practice Periods field of the Contest content type, which has mandatory start/end times and an unlimited number of instances
  2. The Contest node author selects the length of each slot (10, 12, 15, or 20 minutes)
  3. All times are expressed in the contest's local time as of the contest start date (i.e. Standard or Daylight Saving Time)
    • Drupal DateTime values are GMT-based with a TZ offset
    • It would be difficult to infer the timezone at a given airport on a given date
    • We can't rely on CDs to provide the appropriate TZ offset
    • Aerobatic pilots have complained about having to translate UTC into local time (!)
    • Therefore we will use strings to represent times, e.g. "09:15"
  4. Contestants must pre-register before reserving a practice slot at a given contest
    • Note: We set the 'return' attribute of the PayPal button to /practice-slots, to route the user directly
  5. A contestant may only reserve one practice slot per contest
  6. A contestant may relinquish their practice slot, and optionally reserve another open slot
  7. A contestants may not reserve or delete practice slots for other people
  8. Contest organizers can view and download the practice slot reservations
  9. Contest organizers can assign and delete practice slots
  10. Non-requirement: Users must pay their contest registration fees before booking a practice slot. We can't enforce this because PayPal sends confirmation to the email address provided by the host chapter rather than the IAC web site.

Data Model

Contest Data Fields

We've added two new data fields to the Contest node type: practice_slot_duration and practice_periods.

Practice slot duration is a simple integer, the number of minutes per slot. The choices are 10, 12, 15, and 20 (that's 6, 5, 4, and 3 slots per hour, respectively.)

The practice periods are time windows that the system will populate with practice slots when the contest node is created. A contest may have an arbitrary number of practice periods, each of which has a start and end time.

Practice Slot Records

Each practice slot is represented by a Practice Slot node, consisting of a link to a Contest node and a start time. We use the author attribute to associate a slot to a user; unclaimed spots are "owned" by Anonymous (uid=0).These nodes are generated by the custom PHP function _gen_practice_slots() in the Drupal iac module, triggered when a contest is created.

At present, the software does not support changing the practice periods once the contest is saved. This would require logic to add and delete practice slot nodes to match the changes in the practice periods, and some way to notify people whose slots were deleted.

Reserving a Practice Slot

Upon creation of a Contest Registration node, the author (competitor) will be invited to select a practice slot (future: iff there are any open slots associated with that contest). This is implemented by the PHP basic page /select-practice-slot.

Changing a Practice Slot

If a contestant wants to change their slot, they must first relinquish their current slot before they can choose another from the list of available slots. Relinquishing a practice slot is implemented PHP basic page /relinquish-practice-slot.

Viewing Practice Sign-Ups.

(Drupal View)

Views:

  • practice-slots (radio buttons per contest for the current slot & any open ones)
  • contest-practice-slots/contest-id (the list of practice slots for a given contest)

Open Issues

  • What if a contest admin changes the practice periods and/or duration? Answer: we'll have to adjust the records manually, unless/until we put more smarts into _gen_practice_slots().
  • What about contests that are already scheduled? Answer: write tiny Drush scripts to invoke _gen_practice_slots().