Feat: Implement AI DPP CBT conversion and frontend sync

This commit is contained in:
2026-07-07 16:12:56 +05:30
parent b6ebb9d9c3
commit 988923ef4b
11 changed files with 168 additions and 18 deletions

View File

@@ -76,10 +76,15 @@ def verify_otp(phone_or_email: str, code: str, session: Session = Depends(get_se
# --- CBT TEST ENVIRONMENT CONTENT DELIVERY ENDPOINTS ---
@app.get("/api/tests", response_model=List[models.Test], tags=["CBT Engine"])
def list_active_tests(exam_pattern: Optional[str] = None, session: Session = Depends(get_session)):
def list_active_tests(exam_pattern: Optional[str] = None, type: Optional[str] = None, session: Session = Depends(get_session)):
query = select(models.Test).where(models.Test.is_active == True)
if exam_pattern:
query = query.where(models.Test.exam_pattern == exam_pattern)
if type:
query = query.where(models.Test.type == type)
else:
# If type isn't specified, don't return DPS in regular tests query
query = query.where(models.Test.type != "DPS")
return session.exec(query).all()