Thought I had staged it

This commit is contained in:
Carlos-Mesquita
2024-11-09 09:30:54 +00:00
parent 09998478d1
commit e955a16abf
15 changed files with 343 additions and 466 deletions

View File

@@ -1,8 +1,10 @@
import random
from typing import Optional
from dependency_injector.wiring import Provide, inject
from fastapi import APIRouter, Depends, Path, Query, UploadFile
from app.configs.constants import EducationalContent
from app.dtos.reading import ReadingDTO
from app.middlewares import Authorized, IsAuthenticatedViaBearerToken
from app.controllers.abc import IReadingController
@@ -21,8 +23,6 @@ async def upload(
solutions: UploadFile = None,
reading_controller: IReadingController = Depends(Provide[controller])
):
print(exercises.filename)
#print(solutions.filename)
return await reading_controller.import_exam(exercises, solutions)
@reading_router.get(
@@ -36,6 +36,7 @@ async def generate_passage(
passage: int = Path(..., ge=1, le=3),
reading_controller: IReadingController = Depends(Provide[controller])
):
topic = random.choice(EducationalContent.TOPICS) if not topic else topic
return await reading_controller.generate_reading_passage(passage, topic, word_count)
@reading_router.post(