Skip to content

Upload results

Thomas Emil Jensen edited this page Oct 2, 2023 · 11 revisions

🇩🇰 Dansk | 🇬🇧 English

Previous: Create your competition


Testing without results?

So... You've installed the client, configured it for your computer, gotten in touch with a server, created your competition on said server, and filled in all the data and definitions that make it yours. All that's left to do is to upload results to the server (or to go back one or more pages if you haven't done all that).

Now, if this is your first time using the client, you probably (and hopefully) aren't doing all this setup work on the day of the competition. That means two things. One: You're at least a little bit sensible and do preparations in advance. And two: Your competition does not have any results yet, which makes uploading results a little bit difficult. If you want to test the full workflow before the first runner crosses the finish line (and you really should), you will need some fake results. Fortunately, MeOS has built-in functionality to do just that.

You will need your competition to have courses, classes and participants, but for testing, you don't need to wait for the signup to close and get all participants. You'd typically have your MeOS competition in this state when configuring divisions in Divisionsmatchberegning anyways, so this shouldn't be a major hurdle. Also, don't be concerned about testing on the live server; you can always overwrite your results on the server with empty results or even remove the results entirely.

To prepare for testing, first create a backup of your MeOS competition, because we don't want fake results in the real competition. I would also suggest closing the competition, then importing the newly-created backup and adding "TEST" or similar to the name. That way, you not only have the exported backup, but also two separate entries within MeOS: the clean, real competition and a duplicate for testing.

In your MeOS test competition, navigate to the Services tab. Open the Punching Test service, choose how frequently new results should be generated, and start the service. Do not use the test race generation feature, as results from generated test races are unlikely to be relevant for division matches. Next... Well, that's it, actually. You should see a steady stream of fake results being created. In fact, you may want to stop it again for a moment while you carry on reading.

The update process

Whether you're running a test competition with fake results or you have real runners crossing the finish line and reading out their cards, the upload process is the same. The process involves more than just uploading, however. It also involves pretty much everything we have used and defined up until now. Specifically, the full update process contains the following steps:

  • Perform a difference check with MeOS to see if there are new results available - cancel the update if there aren't
  • Fetch results in IOF XML 3.0 format from MeOS and write them to a file
  • For every division:
    • Run Divisionsmatchberegning to generate division results in HTML format
    • Load the results into memory
    • Trim away the style sheets and modify the HTML slightly to reduce request size and accommodate the styling on the server
  • Send a request to the server containing the competition metadata and results

At every step, various checks are carried out to ensure the process runs smoothly. Should an issue arise, such as a connection dropout, then an error will be printed to the log, and this instance of the update process is cancelled prematurely, also resetting the difference check.

Upon receiving the request, the server then validates the (insecure) credentials, unpacks the request body, runs the HTML content through a sanitiser and updates the database entries for both competition metadata and results. When viewing the competition page in the browser, data is of course fetched at initial load, but to achieve live behaviour, the browser will also ask the server for changes every 30 seconds. Therefore, it may be a few seconds before changes show up in the browser, but if you don't want to wait, you can simply reload the page.

Actually update results

Head down to the Update Results pane. Here, you'll find a single setting to set the update interval and a few buttons to control the action. They do roughly what you'd expect, but we'll go over them just to be safe.

There are two modes of operation. With the Run Once button, you can trigger a single run of the update process. This is useful for a quick test or to upload results from a specific state of the competition, such as the initial, empty state or at the end of the competition once all complaints have been taken care of.

To run the update process on a schedule, however, you use the Start and Stop buttons. Pressing Start will trigger the update process immediately and start the update timer. Once the timer expires, the update process is triggered again, and the timer starts over. This cycle continues until the Stop button is pressed, after which no new update processes are started. However, to prevent the client from landing in an undefined state, the Stop button does not cancel ongoing updates. Likewise, it is recommended to stop the timer and wait for any updates to complete before closing the client.

Update interval

The length of the timer is determined by the update interval, which is specified in a whole number of seconds. There are a few considerations to make when deciding the update interval. First, use Run Once to find out roughly how long a single update process takes. The update interval should be at least this long, since the client will immediately cancel new updates triggered while one is already underway.

Secondly, consider how much delay is acceptable from a participant reading out until the results on the competition page are updated. In the best case, readout happens just before an update is triggered, and the update lines up perfectly with the periodic check from the competition page in the browser, resulting in near-zero delay. In the worst case, readout happens just after an update, and the check in the browser happens just before the new data arrives, meaning the delay is roughly equivalent to the length of the update interval plus the 30 seconds from the check interval on the competition page. What is considered acceptable is up to you, but at a busy event with frequent readouts, you probably want to keep the delay fairly low.

Finally, on less powerful computers, MeOS may struggle to serve requests for results if it also has other tasks to fulfill, such as card readout or another timed service. In this case, a longer update interval can give MeOS a little extra breathing room to ensure smooth operation.

My personal recommendation? For a competition with two or three divisions, an update can usually be completed in less than 10, maybe 15 seconds. Keeping in mind that the update process is cancelled early when the results haven't changed, an interval of 30 to 60 seconds seems reasonable. This yields a worst case delay of 60 or 90 seconds, respectively, and it leaves a comfortable margin on top of the update duration.

Interruptions

If the update timer is running, but you need to make adjustments to the configuration, simple press the Stop button and wait for any updates to finish. Then, make your changes and hit the Start button again. The competition's metadata will automatically be updated along with the results right away, since pressing Start (or Run Once, for that matter) resets the difference check, and because a results update is also an implicit metadata update.

As loosely mentioned earlier, errors during the update process will cause it to cancel prematurely, also resetting the difference check. However, this does not affect the update timer. If started, it will continue running and resetting as usual, triggering a new update process whenever it runs out. Therefore, intermittent problems such as connection dropouts do not require manual intervention in the client.

Removing results

So you've been a good organiser and have just finished a thorough round of testing? Excellent! Technically, you're all set now. As soon as the competition begins and you start uploading real results, the fake ones will all be gone. Still, you may want to remove them in advance. After all, people might check out the page if you publish a link, and some of them may start to wonder if something has gone wrong or if you can somehow see into the future (most likely the former). To remove the fake results (or real ones, for that matter), you have three options:

The first is to simply set the competition to PRIVATE and create a new one, linking to that one instead. I would not recommend this, as you can more easily achieve this outcome with the third method.

The second is to open your real (and blank, as far as results are concerned) MeOS competition. Start the information server, then run a single result update. This will overwrite the results on the competition page, showing all classes empty and with zero points scored in this round. Doing it this way leaves the page in a nice, initial state, displaying a bit of context for the divisions, such as the clubs involved and the outcomes of any previous matches in the season. I would personally recommend this approach.

The third (and easiest) method is to use the Delete Results button in the Online pane. As its name would suggest, it simply deletes the results of all divisions in this competition on the server - at least if you confirm your decision in the ensuing dialog box. After this, it's as if you never uploaded results to the competition in the first place (essentially equivalent to the first method). A clean slate, yes, but do note that this replaces the results content with a frowny face.


Next: Analytics

Clone this wiki locally