diff --git a/backend/app/api/v1/challenges.py b/backend/app/api/v1/challenges.py index 677d31c..b08fdee 100644 --- a/backend/app/api/v1/challenges.py +++ b/backend/app/api/v1/challenges.py @@ -366,7 +366,7 @@ async def save_challenges( description=ch_data.description, type=ch_type, difficulty=difficulty, - points=max(1, min(500, ch_data.points)), + points=max(1, ch_data.points), estimated_time=ch_data.estimated_time, proof_type=proof_type, proof_hint=ch_data.proof_hint, diff --git a/backend/app/schemas/challenge.py b/backend/app/schemas/challenge.py index 56af620..f51f055 100644 --- a/backend/app/schemas/challenge.py +++ b/backend/app/schemas/challenge.py @@ -19,7 +19,7 @@ class ChallengeBase(BaseModel): description: str = Field(..., min_length=1) type: ChallengeType difficulty: Difficulty - points: int = Field(..., ge=1, le=1000) + points: int = Field(..., ge=1) estimated_time: int | None = Field(None, ge=1) # minutes proof_type: ProofType proof_hint: str | None = None @@ -34,7 +34,7 @@ class ChallengeUpdate(BaseModel): description: str | None = None type: ChallengeType | None = None difficulty: Difficulty | None = None - points: int | None = Field(None, ge=1, le=1000) + points: int | None = Field(None, ge=1) estimated_time: int | None = None proof_type: ProofType | None = None proof_hint: str | None = None diff --git a/backend/app/schemas/game.py b/backend/app/schemas/game.py index 91a4a18..ef73e77 100644 --- a/backend/app/schemas/game.py +++ b/backend/app/schemas/game.py @@ -20,7 +20,7 @@ class GameCreate(GameBase): game_type: GameType = GameType.CHALLENGES # Поля для типа "Прохождение" - playthrough_points: int | None = Field(None, ge=1, le=1000) + playthrough_points: int | None = Field(None, ge=1) playthrough_description: str | None = None playthrough_proof_type: ProofType | None = None playthrough_proof_hint: str | None = None @@ -46,7 +46,7 @@ class GameUpdate(BaseModel): game_type: GameType | None = None # Поля для типа "Прохождение" - playthrough_points: int | None = Field(None, ge=1, le=1000) + playthrough_points: int | None = Field(None, ge=1) playthrough_description: str | None = None playthrough_proof_type: ProofType | None = None playthrough_proof_hint: str | None = None diff --git a/backend/app/services/gpt.py b/backend/app/services/gpt.py index f430158..fafafc2 100644 --- a/backend/app/services/gpt.py +++ b/backend/app/services/gpt.py @@ -124,12 +124,6 @@ points: easy=20-40, medium=45-75, hard=90-150 points = ch.get("points", 30) if not isinstance(points, int) or points < 1: points = 30 - if difficulty == "easy": - points = max(20, min(40, points)) - elif difficulty == "medium": - points = max(45, min(75, points)) - elif difficulty == "hard": - points = max(90, min(150, points)) return ChallengeGenerated( title=ch.get("title", "Unnamed Challenge")[:100], diff --git a/frontend/src/pages/LobbyPage.tsx b/frontend/src/pages/LobbyPage.tsx index cdf72c7..d892c8e 100644 --- a/frontend/src/pages/LobbyPage.tsx +++ b/frontend/src/pages/LobbyPage.tsx @@ -949,7 +949,6 @@ export function LobbyPage() { value={editChallenge.points} onChange={(e) => setEditChallenge(prev => ({ ...prev, points: parseInt(e.target.value) || 0 }))} min={1} - max={1000} />