Feat: Implement AI DPP CBT conversion and frontend sync
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user