New Season
New Season
This is my fifth update to my Alternative Formula E Points Format project. You can now switch between collections, operations and Formula E seasons more easily now and the program automatically checks that a competitor is eligible for a secondary championship (Customer Driver/Team, Nelson Piquet Jr Trophy Driver). I will keep track of the championships for the current Formula E season, along with updating weekly the results for older seasons starting with Season 1, with a review of the season at the end. These updates will begin from 10th February.
As always, all files and documents are found in the GitHub repository: https://github.com/CulverT01/altfepointsformat
Please note that I have removed the username and password for the database from the admin program in the interest of security, but not from the viewer program as the user signed on there has read only permissions.
Updates
The viewer and admin programs have new function called finish that asks a user if they're finished what they're doing and returns a boolean True value if yes, otherwise returns a boolean False value. For example for the viewer program, the 2 options available to users are now in while loops, along with one that surround both options, which ends if a boolean variable no longer not True. This also applies to the admin program, but with more while loops and variables due it having more options available to the user.
Below is the afepf viewer program which evidences these changes.



The afepf_function program has 2 new functions that check if a driver/team is eligible for a secondary championship (Customer Driver/Team, Nelson Piquet Jr Trophy Driver) and these are the checkDriver and checkTeam respectively. The former takes 2 arguments when called (init and either 'customer' or 'npjt') and performing a search query that outputs either all driver initials for documents whose customer driver points or npjt driver points are more than equal to 0 as well as sorting in ascending order according to those points totals and stores each item in the cursor in a list. The program checks if the value that the init argument stores is in the list and if so, then it returns True otherwise it returns False. The latter function operates the same except it only takes 1 argument (init) and searches the Team collection instead of the Driver collection. The functions are called where the user is asked if the competitor they are entering the results for is a customer driver/team or npjt driver with the if statement below checking i the are equal to True instead of 'yes'.
The 2 functions are displayed below.

Changes and Clarifications
As this program was initially designed for only season 10, the database that stored the data was known as AltFePointsFormat and MongoDB prevents you from renaming a database, so it name will stay while all other databases will be named after the season for which they store the results for.