[Eva] ChooseWord /next: time_limit + новый return
This commit is contained in:
+2
-8
@@ -113,20 +113,14 @@ async def get_next_quiz(request: Request):
|
|||||||
options = wrong_options + [correct_polish]
|
options = wrong_options + [correct_polish]
|
||||||
random.shuffle(options)
|
random.shuffle(options)
|
||||||
|
|
||||||
if total_guessed <= 10:
|
time_limit = 10 if difficulty == "hard" else None
|
||||||
difficulty = "easy"
|
|
||||||
elif total_guessed <= 30:
|
|
||||||
difficulty = "medium"
|
|
||||||
elif total_guessed <= 60:
|
|
||||||
difficulty = "hard"
|
|
||||||
else:
|
|
||||||
difficulty = "expert"
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"correct_polish": correct_polish,
|
"correct_polish": correct_polish,
|
||||||
"translation": translation,
|
"translation": translation,
|
||||||
"options": options,
|
"options": options,
|
||||||
"difficulty": difficulty,
|
"difficulty": difficulty,
|
||||||
|
"time_limit": time_limit,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user