feat: редизайн страницы создания/редактирования теста

- TestForm: смысловые блоки «Метаинформация» / «Версии теста» / «Содержание» / команды
- AI-генерация: мини-форма из 3 полей (тема, число вопросов, число вариантов)
- Кнопка «Проверить тест» переехала в нижнюю панель команд
- Backend: GenerateRequest принимает answers_count, передаётся в промпт
- Убрано упоминание API-ключа в fallback-сообщении формы

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Aleksey Razorvin
2026-04-25 16:44:34 +05:00
parent f6fc92298a
commit 51df045220
6 changed files with 335 additions and 33 deletions
+4 -1
View File
@@ -16,6 +16,7 @@ class CheckResponse(BaseModel):
class GenerateRequest(BaseModel):
topic: str
count: int = 7
answers_count: int = 3
class GenerateResponse(BaseModel):
@@ -73,7 +74,9 @@ async def check_connection(db: AsyncSession = Depends(get_db)):
@router.post("/api/llm/generate", response_model=GenerateResponse)
async def generate_questions(req: GenerateRequest, db: AsyncSession = Depends(get_db)):
try:
questions = await llm_service.generate_questions(db, req.topic, req.count)
questions = await llm_service.generate_questions(
db, req.topic, req.count, req.answers_count
)
return {"questions": questions}
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))