modified: app.py
This commit is contained in:
6
app.py
6
app.py
@@ -250,9 +250,13 @@ def check_answer():
|
|||||||
game_mode = data.get('game_mode', 'artist')
|
game_mode = data.get('game_mode', 'artist')
|
||||||
playlist_id = data.get('playlist_id')
|
playlist_id = data.get('playlist_id')
|
||||||
|
|
||||||
|
# Speichere die originale Antwort für die Anzeige
|
||||||
|
display_answer = correct_answer
|
||||||
|
|
||||||
if game_mode == 'title':
|
if game_mode == 'title':
|
||||||
guess = clean_title(guess)
|
guess = clean_title(guess)
|
||||||
correct_answer = clean_title(correct_answer)
|
correct_answer = clean_title(correct_answer)
|
||||||
|
display_answer = clean_title(display_answer) # Auch für die Anzeige bereinigen
|
||||||
|
|
||||||
if game_mode == 'year':
|
if game_mode == 'year':
|
||||||
is_correct = guess == correct_answer
|
is_correct = guess == correct_answer
|
||||||
@@ -266,7 +270,7 @@ def check_answer():
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
"correct": is_correct,
|
"correct": is_correct,
|
||||||
"correct_answer": correct_answer
|
"correct_answer": display_answer
|
||||||
}
|
}
|
||||||
|
|
||||||
@app.route("/play_track", methods=["POST"])
|
@app.route("/play_track", methods=["POST"])
|
||||||
|
|||||||
Reference in New Issue
Block a user