Skip to content

Commit

Permalink
Merge pull request #86 from Capstone-Projects-2024-Spring/CS2STT-31-l…
Browse files Browse the repository at this point in the history
…eaderboard-and-points-system

changing leaderboard stuff
  • Loading branch information
TU-Wenjie-Gao committed May 1, 2024
2 parents 9d85fd8 + b2e9aaf commit b57451b
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ def populate_sample_data_for_user(user_name:str):
}

# Generate unique top WPM value
top_wpm_value = random.randint(0, 100)
top_wpm_value = random.randint(0, 110)
while top_wpm_value in Database.used_top_wpm_values:
top_wpm_value = random.randint(0, 100)
top_wpm_value = random.randint(0, 110)

user_data_data = {
"_username": f"{user_name}",
Expand Down Expand Up @@ -599,19 +599,9 @@ def populate_sample_data_for_user(user_name:str):
"_double_quote": random.randint(0, 100),
}

user_race_data = {
"_username": f"{user_name}",
"_email": f"{user_name}@gmail.com",
"_average_wpm": random.randint(40, 100),
"_selected_mode": random.choice(["Practice", "Robot Opponent", "MultiPlayer"]),
"_time_limit": random.choice([None, 30, 60, 90]),
"_date_played": current_datetime - timedelta(days=random.randint(0, 5))
}

Database.insert(UserInfo, **user_info_data)
Database.insert(UserData, **user_data_data)
Database.insert(UserLetter, **user_letter_data)
Database.insert(UserRace, **user_race_data)

print(f"Sample data added successfully for user{user_name}")
except Exception as e:
Expand Down Expand Up @@ -1111,5 +1101,5 @@ def validate_username(self, key, _username):
# this method returns a list represention of top-n largest mistyped letters
# top_n_letters = Database.get_top_n_letters("user35", 6)
# print(top_n_letters)

app.socketio.run(app._app, host="localhost", debug=True)
Binary file modified instance/ThrillTyper.db
Binary file not shown.
Binary file modified static/pics/leaderboard_second.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/pics/leaderboard_third.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/pics/leaderboard_winner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b57451b

Please sign in to comment.