Add server-side ELO ratings
This commit is contained in:
@@ -62,12 +62,9 @@ func get_profile() -> Dictionary:
|
||||
|
||||
func apply_block_results(results: Dictionary) -> void:
|
||||
_ensure_daily_current()
|
||||
profile["xp"] = int(profile["xp"]) + int(results.get("xp_earned", 0))
|
||||
profile["level"] = ProgressionService.level_for_xp(int(profile["xp"]))
|
||||
profile["current_streak"] = int(results.get("ending_streak", profile["current_streak"]))
|
||||
profile["best_streak"] = max(int(profile["best_streak"]), int(profile["current_streak"]))
|
||||
profile["daily_questions_answered"] = int(profile["daily_questions_answered"]) + int(results.get("total", 0))
|
||||
profile["daily_xp_earned"] = int(profile["daily_xp_earned"]) + int(results.get("xp_earned", 0))
|
||||
|
||||
var unlocked_badges: Array = results.get("badges_unlocked", [])
|
||||
for badge in unlocked_badges:
|
||||
@@ -91,7 +88,7 @@ func apply_block_results(results: Dictionary) -> void:
|
||||
"system": results.get("system", "All Systems"),
|
||||
"correct": results.get("correct", 0),
|
||||
"total": results.get("total", 0),
|
||||
"xp_earned": results.get("xp_earned", 0)
|
||||
"xp_earned": 0
|
||||
}
|
||||
profile["block_history"].push_front(summary)
|
||||
if profile["block_history"].size() > 12:
|
||||
@@ -135,12 +132,9 @@ func reset_qbank_memory() -> void:
|
||||
|
||||
func apply_question_results(results: Dictionary) -> void:
|
||||
_ensure_daily_current()
|
||||
profile["xp"] = int(profile["xp"]) + int(results.get("xp_earned", 0))
|
||||
profile["level"] = ProgressionService.level_for_xp(int(profile["xp"]))
|
||||
profile["current_streak"] = int(results.get("ending_streak", profile["current_streak"]))
|
||||
profile["best_streak"] = max(int(profile["best_streak"]), int(profile["current_streak"]))
|
||||
profile["daily_questions_answered"] = int(profile["daily_questions_answered"]) + int(results.get("total", 0))
|
||||
profile["daily_xp_earned"] = int(profile["daily_xp_earned"]) + int(results.get("xp_earned", 0))
|
||||
|
||||
var unlocked_badges: Array = results.get("badges_unlocked", [])
|
||||
for badge in unlocked_badges:
|
||||
|
||||
Reference in New Issue
Block a user