Next in ServerApplication, I worked on generating the result documents. To generate the result document ID, Poco::UUIDGenerator is used. This UUID cannot be randomly generated, otherwise additional unwanted result documents could be created. With the createFromName() member function, the UUID created is set to be dependent on the performance ID. Thus, no extra result document will be created for a performance.

We also want to allow the result documents to be updated. For example, if one judge happens to only enter his/her score after the result document has been processed, we want to compute a new average mark that acknowledges this new score and ensure that this result document is updated with the new average. The If-Match header is set to the E-Tag to allow the re-writing of the result documents.

Using logger() from the Poco library, the responses in the code are monitored, with the appropriate action undertaken thereafter. If the response is not a success, the reason for this shall be logged. Then continue can be used to jump to the next iteration, or break can be used to jump out of the loop. If the response is a success, there can be output of a message indicating success and of additional information such as the number of documents retrieved.

Lastly I worked on exporting data from the database to a .tsv file on which analytics can be carried out. It would contain fields such as the player’s name, the name of the piece played and the result attained. A .csv file is not used in case the commas in the data itself were to be mistaken as delimiters.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.