Patched backend eval
This commit is contained in:
@@ -8,7 +8,7 @@ class IGradeController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def grade_writing_task(
|
||||
self, session_id: str, exercise_id: str,
|
||||
self,
|
||||
task: int, dto: any,
|
||||
background_tasks: BackgroundTasks
|
||||
):
|
||||
|
||||
@@ -23,21 +23,22 @@ class GradeController(IGradeController):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
|
||||
async def grade_writing_task(
|
||||
self, session_id: str, exercise_id: str,
|
||||
self,
|
||||
task: int, dto: WritingGradeTaskDTO, background_tasks: BackgroundTasks
|
||||
):
|
||||
await self._evaluation_service.create_or_update_evaluation(
|
||||
dto.sessionId, dto.exercise_id, EvaluationType.WRITING, task
|
||||
await self._evaluation_service.create_evaluation(
|
||||
dto.userId, dto.sessionId, dto.exerciseId, EvaluationType.WRITING, task
|
||||
)
|
||||
|
||||
await self._evaluation_service.begin_evaluation(
|
||||
session_id, task, exercise_id, EvaluationType.WRITING, dto, background_tasks
|
||||
dto.userId, dto.sessionId, task, dto.exerciseId, EvaluationType.WRITING, dto, background_tasks
|
||||
)
|
||||
|
||||
return Response(status_code=200)
|
||||
|
||||
async def grade_speaking_task(self, task: int, form: FormData, background_tasks: BackgroundTasks):
|
||||
answers: Dict[int, Dict] = {}
|
||||
user_id = form.get("userId")
|
||||
session_id = form.get("sessionId")
|
||||
exercise_id = form.get("exerciseId")
|
||||
|
||||
@@ -79,12 +80,12 @@ class GradeController(IGradeController):
|
||||
|
||||
ex_type = EvaluationType.SPEAKING if task == 2 else EvaluationType.SPEAKING_INTERACTIVE
|
||||
|
||||
await self._evaluation_service.create_or_update_evaluation(
|
||||
session_id, exercise_id, ex_type, task
|
||||
await self._evaluation_service.create_evaluation(
|
||||
user_id, session_id, exercise_id, ex_type, task
|
||||
)
|
||||
|
||||
await self._evaluation_service.begin_evaluation(
|
||||
session_id, task, exercise_id, ex_type, items, background_tasks
|
||||
user_id, session_id, task, exercise_id, ex_type, items, background_tasks
|
||||
)
|
||||
|
||||
return Response(status_code=200)
|
||||
|
||||
Reference in New Issue
Block a user