How to handle meet events?

Now that I have the standard events working with drag and drop reordering, I need to propagate events to each meet.  My thinking has been that a meet will start by importing the standard events and then add, delete, edit, and reorder as necessary to support a specific swim meet.

While I have had this model in my head, my first look at actually implementing it raised a bunch of questions – where I do put it?  How does it work?  The event management isn’t as simple as other meet management tasks so it sort of breaks in the way that I implemented the meet data.  I have an idea how to solve it but it will take some experimenting to see if it will work.

Phase 1 of Drag and Drop Event Ordering

Today I got the first part of Ajax based Drag and Drop Event Ordering working.  A few weeks ago when I was skimming the Internet looking for some Ajax tips I found this interesting jQuery demo called Portlets.  You really need to see the example to get the idea of how it works.  When I found it I knew it was exactly what I was looking for to do event order (and hopefully heat sheets at some point).

I finally got some cycles to work on it yesterday and earlier today I got the first phase of it working.  I can display the events to the user and they can drag and drop them to order them however they see fit.  This part of it works as I hoped it would.  Now that it is working, I need to get Ajax handshaking worked out so the database gets updated with the new sort order.  Hopefully that won’t be to difficult but working with this type of Ajax problem is new ground for me.

Drag and Drop Event Ordering

Drag and Drop Event Ordering

Code Cleanup in progress

It is interesting to go back and revisit code which I wrote early in this project.  When  I go back and look at it, I ask myself why I implemented things the way I did.   The change to the  tabbed menu bar has required me to go back and visit almost every page which is presented as a menu to a user of the system.

Some of the early functionality like Age Groups and Seasons had a clunky implementation of the decision tree logic and resulted in processing the same variables to make decisions repeatedly.  I have migrated the code I developed latter on for things like the Roster and Events pages and implemented “Guidance” for all pages as well.

Now that I have all of the code cleaned up, at least I think I have it all done, I need to return to the Events functionality.  I need the ability to add events to a meet and then re-order them.  The standard events can be used to seed the events for a meet and reordering works although it is clunky.  This should probably be done with AJAX so events can be dragged and dropped into the desired order.

Standard Event functionality completed

This afternoon I committed a bunch of changes which complete (I hope) the standard event functionality.  Standard Events are the events a team would typically run at every meet.  I envision them being set up for a team’s home pool so the course should be set to match the home pool but it is up to the end user.  Once defined, the meets can be reordered to match the typical order of events.

The next phase will allow creating of meet specific meets and the standard events can be used to initialize the events for a meet.  When creating meet events, the the course for the pool is different than the standard events, the meet events will be adjusted acordingly.  This will allow a team with a home pool in meters to easily set up a meet at yards pool – if the same events are used in the same order, it will be a simple task.

Once the events are created for meet, the order can be changed on a per meet basis and other events can be added or deleted.

Started Adding Event Functionality

In order to keep a history of swim times (aka results), the events the times are associated with need to be defined.  I guess technically that isn’t true, a simple time history could be kept but as long as I am going to import times and keep them as a history, might as well associate them with a meet too.

To do this I started working on defining the events for each meet.  Since most teams swim the same events in the same order at most of their meets, I have established a “default” set of events.  I have this new functionality working now.  What is left to do is to elegantly re-order the events (since re-ordering them is inevitable) and to use them as a basis for populating the events for an actual meet.

This functionality is also the basis of Opt-in/Opt-out because I have decided to let swimmers opt in or out of individual events and as well as entire meets.  This is a need for the MacDolphins because we many of our swimmers are in year round school and since our league swims on Tuesday nigths, for some portion of our team, it is a school night.  We have a fair number of swimmers who opt out of the later events because of it being a school night.