feat: add substract with image reference
This commit is contained in:
@@ -10,6 +10,10 @@ from app.schemas.grade_1.join_pictures_with_quantity import (
|
||||
JoinPicturesWithQuantityProblem,
|
||||
JoinPicturesWithQuantityRequest,
|
||||
)
|
||||
from app.schemas.grade_1.subtract_with_image_reference import (
|
||||
SubtractWithImageReferenceProblem,
|
||||
SubtractWithImageReferenceRequest,
|
||||
)
|
||||
from app.schemas.grade_1.sum_with_image_reference import (
|
||||
SumWithImageReferenceProblem,
|
||||
SumWithImageReferenceRequest,
|
||||
@@ -26,6 +30,8 @@ __all__ = [
|
||||
"JoinCorrespondingSumsRequest",
|
||||
"JoinPicturesWithQuantityProblem",
|
||||
"JoinPicturesWithQuantityRequest",
|
||||
"SubtractWithImageReferenceProblem",
|
||||
"SubtractWithImageReferenceRequest",
|
||||
"SumWithImageReferenceProblem",
|
||||
"SumWithImageReferenceRequest",
|
||||
"WhereAreMoreItemsProblem",
|
||||
|
||||
40
app/schemas/grade_1/subtract_with_image_reference.py
Normal file
40
app/schemas/grade_1/subtract_with_image_reference.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from pydantic import BaseModel, Field, NonNegativeInt, PositiveInt
|
||||
|
||||
|
||||
class PictureAsset(BaseModel):
|
||||
id: str = Field(min_length=1)
|
||||
name: str = Field(min_length=1)
|
||||
image_path: str = Field(min_length=1)
|
||||
|
||||
|
||||
class SubtractionEquation(BaseModel):
|
||||
initial_quantity: PositiveInt
|
||||
removed_quantity: PositiveInt
|
||||
remaining_quantity: NonNegativeInt
|
||||
symbol: str = "-"
|
||||
equals_symbol: str = "="
|
||||
|
||||
|
||||
class FigureGroup(BaseModel):
|
||||
label: str = Field(min_length=1)
|
||||
quantity: NonNegativeInt
|
||||
picture: PictureAsset
|
||||
|
||||
|
||||
class SubtractWithImageReferenceProblem(BaseModel):
|
||||
title: str = "¿Cuántos quedan?"
|
||||
question: str
|
||||
object_name: str = Field(min_length=1)
|
||||
actor_name: str = Field(min_length=1)
|
||||
figure: PictureAsset
|
||||
remaining_group: FigureGroup
|
||||
subtracted_group: FigureGroup
|
||||
equation: SubtractionEquation
|
||||
|
||||
|
||||
class SubtractWithImageReferenceRequest(BaseModel):
|
||||
object_name: str = Field(min_length=1)
|
||||
initial_quantity: PositiveInt
|
||||
removed_quantity: PositiveInt
|
||||
figure: PictureAsset
|
||||
actor_name: str = Field(default="Diego", min_length=1)
|
||||
Reference in New Issue
Block a user