Spaces:
Sleeping
Sleeping
| import pytest | |
| from app.services.exam_service import ExamService | |
| from app.services.assignment_service import AssignmentService | |
| from app.services.evaluation_service import EvaluationService | |
| from app.contracts.dtos import Submission | |
| def test_exam_generation(): | |
| service = ExamService() | |
| exam = service.generate_exam("L1", {"target_concept_id": "C_TEST"}) | |
| assert exam.learner_id == "L1" | |
| assert len(exam.questions) > 0 | |
| assert exam.questions[0].concept_id == "C_TEST" | |
| assert exam.difficulty.startswith("adaptive") | |
| def test_assignment_generation(): | |
| service = AssignmentService() | |
| assignment = service.generate_assignment("L1", {"industry": "Tech", "world_feed_item": "AI News"}) | |
| assert assignment.id is not None | |
| assert "Tech" in assignment.context_tags | |
| assert "AI News" in assignment.title | |
| def test_evaluation_logic(): | |
| service = EvaluationService() | |
| submission = Submission( | |
| assessment_id="A1", | |
| learner_id="L1", | |
| type="assignment", | |
| responses={"text": "This is a good response."} | |
| ) | |
| result = service.evaluate_submission(submission) | |
| assert result.assessment_id == "A1" | |
| assert result.score > 0 | |
| assert "P_STRATEGY" in result.mastery_deltas | |
| assert result.feedback is not None | |