ENCOA-311

This commit is contained in:
Carlos-Mesquita
2025-01-13 01:13:28 +00:00
parent 8550b520e1
commit b32e38156c
27 changed files with 126 additions and 62 deletions

View File

@@ -1,5 +1,6 @@
import logging
import re
import random
from typing import Dict, List
@@ -99,8 +100,9 @@ class SpeakingService(ISpeakingService):
}
async def get_speaking_part(
self, part: int, topic: str, second_topic: str, difficulty: str
self, part: int, topic: str, second_topic: str, difficulty: List[str]
) -> Dict:
diff = difficulty[0] if len(difficulty) == 1 else random.choice(difficulty)
task_values = self._tasks[f'task_{part}']['get']
if part == 1:
@@ -157,7 +159,7 @@ class SpeakingService(ISpeakingService):
]
response["type"] = part
response["difficulty"] = difficulty
response["difficulty"] = diff
if part in {2, 3}:
response["topic"] = topic