Spaces:
Configuration error
Configuration error
Download backend/models/test.py from rockysreenivasa/MathTutor: direct link, hf CLI and curl.
- Browser
- Download file 936 Bytes
-
https://huggingface.co/spaces/rockysreenivasa/MathTutor/resolve/main/backend/models/test.py
- Command line
-
hf download hf://spaces/rockysreenivasa/MathTutor/backend/models/test.py
-
curl -L -o test.py https://huggingface.co/spaces/rockysreenivasa/MathTutor/resolve/main/backend/models/test.py
936 Bytes
| from pydantic import BaseModel, Field | |
| class TestGenerateRequest(BaseModel): | |
| topic: str = Field(..., min_length=2, max_length=200) | |
| grade: int = Field(..., ge=6, le=12) | |
| session_id: str | |
| class TestQuestion(BaseModel): | |
| question: str | |
| correct_answer: str | |
| solution_steps: list[str] | |
| type: str # "numerical" | "short_answer" | |
| class TestGenerateResponse(BaseModel): | |
| questions: list[TestQuestion] | |
| session_id: str | |
| class StudentAnswer(BaseModel): | |
| question_index: int | |
| question: str | |
| correct_answer: str | |
| student_answer: str | |
| class TestEvaluateRequest(BaseModel): | |
| session_id: str | |
| answers: list[StudentAnswer] | |
| attempt_number: int = 1 | |
| class QuestionResult(BaseModel): | |
| question_index: int | |
| is_correct: bool | |
| feedback: str | |
| class TestEvaluateResponse(BaseModel): | |
| results: list[QuestionResult] | |
| score: int | |
| passed: bool | |
| encouragement: str | |
| session_id: str | |