feat:更新练习题接口
This commit is contained in:
@@ -1,19 +1,4 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
|
||||
|
||||
class QuestionRequest(BaseModel):
|
||||
type: str
|
||||
question: str
|
||||
options: List[str]
|
||||
answer: List[str]
|
||||
|
||||
|
||||
class QuestionResponse(QuestionRequest):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class LibraryFileRequest(BaseModel):
|
||||
@@ -24,13 +9,10 @@ class LibraryFileRequest(BaseModel):
|
||||
type: str
|
||||
content: str
|
||||
|
||||
questions: List[QuestionRequest] = []
|
||||
|
||||
|
||||
class LibraryFileResponse(LibraryFileRequest):
|
||||
id: int
|
||||
uploadTime: str
|
||||
questions: List[QuestionResponse] = []
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
@@ -3,8 +3,7 @@ from typing import List
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class MistakeResponse(BaseModel):
|
||||
id: int
|
||||
class MistakeRequest(BaseModel):
|
||||
subject: str
|
||||
module: str
|
||||
name: str
|
||||
@@ -12,7 +11,13 @@ class MistakeResponse(BaseModel):
|
||||
question: str
|
||||
options: List[str]
|
||||
answer: List[str]
|
||||
wrongCount: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class MistakeResponse(MistakeRequest):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
@@ -2,8 +2,6 @@ from typing import List
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from schemas.library import QuestionRequest
|
||||
|
||||
|
||||
class PracticeRecordRequest(BaseModel):
|
||||
libraryFileId: int
|
||||
@@ -20,14 +18,6 @@ class PracticeRecordResponse(PracticeRecordRequest):
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class PracticeQuestionResponse(QuestionRequest):
|
||||
id: int
|
||||
select: List[str]
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class PracticeCheckResult(BaseModel):
|
||||
id: int
|
||||
answer: List[str]
|
||||
@@ -35,4 +25,4 @@ class PracticeCheckResult(BaseModel):
|
||||
isCorrect: bool
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
from_attributes = True
|
||||
|
||||
Reference in New Issue
Block a user