Riflelytics provides Australian rifle shooters with access to a digital record of their shooting history at riflelytics.com. It is based off the Flask framework.
-- Created by Ryan Tan, Henry Guo, Dylan Huynh and Rishi Wig
Function Name | Description | Parameters | Output |
---|---|---|---|
/submit_notes | POST Adds the given notes to the databse |
[stageId: integer, fieldVal: string] |
{success: 'success'} |
/get_avg_shot_graph_data | POST Collect shots for use in the averages/standard dev line graph |
userId: integer | {scores: int[], times: int[], sd: int[]} |
/get_users | POST Generates a list of names used to complete the autofill fields. Used in autofill.js Returns a list of dictionaries |
List of {label: string, value: string} | |
/get_shots | POST Collect shots for use in the recent shots cards |
[userId: int, numLoaded: int, dateRange: string] |
{scores: stage.format_shots()['scores'], totalScore: string, groupSize: int, distance: string, timestamp: '%d %b %Y %I:%M %p', std: int, duration: UNKNOWN, stageId: int, sighters: UNKNOWN} |
/get_target_stats | POST Provides database information for ajax request in ajax_target.js MAY BE REDUNDANT |
stageId: integer | {success: 'success'} | {error: 'userID'} |
/get_all_shots_season | POST Collects every shot in the time-frame selected by the user |
{distance: string, userID: int, dateRange: string} |
{target, boxPlot: int[], bestStage: {id: int, score: int, time: string}, worstStage: {id: int, score: int, time: string}} |
/submit_table | POST Updates a user object(given by ID) with the new information provided in the user profile table |
[userId: int, dictionary of table fields] | {success: 'success'} |
auth
Profile
Function | Description | Parameters | Output |
---|---|---|---|
generate_username | Generates unique username and appends it to user.username | user: User(self) user.fName, user.sName must be defined |
N/A |
get_school_year | Determines the user's school year based on their graduation year and current year | user: User(self) user.gradYr must be defined |
On Success int: gradYr Excepts Error if GradYr is undefined |
season_stats | Returns {mean, median, std, groupSize, duration} of a shooter at a specific distance. If no stages are found all the about fields will equal 0. | user: User(self) distance: string |
On Success {mean, median, std, groupSize, duration} |