Brushed up the backend, added writing task 1 academic prompt gen and grading ENCOA-274
This commit is contained in:
11
ielts_be/controllers/abc/__init__.py
Normal file
11
ielts_be/controllers/abc/__init__.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from .grade import IGradeController
|
||||
from .training import ITrainingController
|
||||
from .user import IUserController
|
||||
from .exam import *
|
||||
|
||||
__all__ = [
|
||||
"IGradeController",
|
||||
"ITrainingController",
|
||||
"IUserController",
|
||||
]
|
||||
__all__.extend(exam.__all__)
|
||||
13
ielts_be/controllers/abc/exam/__init__.py
Normal file
13
ielts_be/controllers/abc/exam/__init__.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from .level import ILevelController
|
||||
from .listening import IListeningController
|
||||
from .reading import IReadingController
|
||||
from .writing import IWritingController
|
||||
from .speaking import ISpeakingController
|
||||
|
||||
__all__ = [
|
||||
"IListeningController",
|
||||
"IReadingController",
|
||||
"IWritingController",
|
||||
"ISpeakingController",
|
||||
"ILevelController",
|
||||
]
|
||||
27
ielts_be/controllers/abc/exam/level.py
Normal file
27
ielts_be/controllers/abc/exam/level.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from fastapi import UploadFile
|
||||
from typing import Dict, Optional
|
||||
|
||||
|
||||
class ILevelController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def generate_exercises(self, dto):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_level_exam(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_level_utas(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def upload_level(self, file: UploadFile, solutions: Optional[UploadFile] = None):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_custom_level(self, data: Dict):
|
||||
pass
|
||||
22
ielts_be/controllers/abc/exam/listening.py
Normal file
22
ielts_be/controllers/abc/exam/listening.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from fastapi import UploadFile
|
||||
|
||||
|
||||
class IListeningController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def import_exam(self, exercises: UploadFile, solutions: UploadFile = None):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_listening_dialog(self, section_id: int, topic: str, difficulty: str):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_listening_question(self, dto):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_mp3(self, dto):
|
||||
pass
|
||||
20
ielts_be/controllers/abc/exam/reading.py
Normal file
20
ielts_be/controllers/abc/exam/reading.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import UploadFile
|
||||
|
||||
|
||||
class IReadingController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def import_exam(self, exercises: UploadFile, solutions: UploadFile = None):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_reading_passage(self, passage: int, topic: Optional[str], word_count: Optional[int]):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_reading_exercises(self, dto):
|
||||
pass
|
||||
|
||||
20
ielts_be/controllers/abc/exam/speaking.py
Normal file
20
ielts_be/controllers/abc/exam/speaking.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class ISpeakingController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def get_speaking_part(self, task: int, topic: str, second_topic: str, difficulty: str):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_avatars(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def generate_video(self, text: str, avatar: str):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def poll_video(self, vid_id: str):
|
||||
pass
|
||||
14
ielts_be/controllers/abc/exam/writing.py
Normal file
14
ielts_be/controllers/abc/exam/writing.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from fastapi.datastructures import UploadFile
|
||||
|
||||
|
||||
class IWritingController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def get_writing_task_general_question(self, task: int, topic: str, difficulty: str):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_writing_task_academic_question(self, task: int, attachment: UploadFile, difficulty: str):
|
||||
pass
|
||||
30
ielts_be/controllers/abc/grade.py
Normal file
30
ielts_be/controllers/abc/grade.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Dict
|
||||
from fastapi import BackgroundTasks
|
||||
from fastapi.datastructures import FormData
|
||||
|
||||
|
||||
class IGradeController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def grade_writing_task(
|
||||
self,
|
||||
task: int, dto: any,
|
||||
background_tasks: BackgroundTasks
|
||||
):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def grade_speaking_task(
|
||||
self, task: int, form: FormData, background_tasks: BackgroundTasks
|
||||
):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def grade_short_answers(self, data: Dict):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def grading_summary(self, data: Dict):
|
||||
pass
|
||||
|
||||
12
ielts_be/controllers/abc/training.py
Normal file
12
ielts_be/controllers/abc/training.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class ITrainingController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def fetch_tips(self, data):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_training_content(self, data):
|
||||
pass
|
||||
8
ielts_be/controllers/abc/user.py
Normal file
8
ielts_be/controllers/abc/user.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class IUserController(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def batch_import(self, batch):
|
||||
pass
|
||||
Reference in New Issue
Block a user