adjust map score tolerance

This commit is contained in:
juhn
2025-10-24 13:09:43 +02:00
committed by ben8
parent fa544d8228
commit 0d098c38eb

View File

@@ -194,7 +194,7 @@ class GameConsumer(AsyncWebsocketConsumer):
@database_sync_to_async
def save_answer_map(self, participant_id, answer_location, time_remaining):
answer_index = -1
answer_index = 0
try:
# Get all necessary data first
participant = QuizGameParticipant.objects.get(
@@ -207,9 +207,6 @@ class GameConsumer(AsyncWebsocketConsumer):
target_location = question_data['target_location']
tolerance_radius = question_data.get('tolerance_radius', 1000) # Default 1km if not set
print(f"Raw target_location: {target_location}")
print(f"Raw answer_location: {answer_location}")
print(f"tolerance_radius: {tolerance_radius}")
# Parse coordinates if they are strings
def parse_coords(coord):
@@ -242,11 +239,9 @@ class GameConsumer(AsyncWebsocketConsumer):
is_correct = False
score = 0
else:
print(f"Parsed target_location: {target_location}")
print(f"Parsed answer_location: {answer_location}")
# Configuration - Make these easily adjustable
MAX_DISTANCE_KM = 1000 # Maximum distance for scoring (in km)
MAX_DISTANCE_KM = 200 # Maximum distance for scoring (in km)
DIRECT_HIT_BONUS = 200 # Extra points for direct hit within tolerance
try: