ENCOA-311
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user