import os
# =========================
# Configuration
# =========================
API_BASE_URL = os.environ.get("CODEHOUSE_API_URL", "https://cli.codehouse.cloud/quiz/")  # <<-- set your API base URL here
SESSION_FILE = os.path.expanduser("~/.codehouse_session")

# endpoints mapping — match your Django urls
ENDPOINTS = {
    "logo": "sys/logo/",
    "check_email_exists": "auth/check-email-exist/",
    "check_phone_exists": "auth/check-phone-exist/",
    "register": "auth/register/",
    "verify_email": "auth/verify-email/",
    "login": "auth/login/",
    "recover_request": "recover-password/",            # maps to views.recover_password
    "verify_recovery": "verify-recovery-token/",       # maps to verify_recovery_token
    "reset_password": "reset-password/",               # maps to reset_password
    "courses": "courses/{sti}/",
    "quiz_status": "quiz/{course_id}/status/{sti}/",
    "quiz_question": "quiz/{course_id}/question/{q_index}/{sti}",
    "pending_quiz": "quiz/pending/{sti}/",
    "submit_answer": "quiz/{course_id}/question/{question_id}/submit/{sti}/",
    # "submit_answer": "submit-answer/{course_id}/{sti}/",
    "leaderboard": "leaderboard/",
    "wallet": "wallet/",
    "withdraw": "withdraw/",
    "leaders_top_scorers": "leaders/quiz/{course_id}/top/{sti}/",
    # "leaders_top_scorers": "quiz/{course_id}/top/{sti}/",
    "top_scorers": "quiz/top-cli/{course_id}>/{str:sti}/",
    "qz_top_scorers": "leaders/quiz/top-cli/{course_id}>/{str:sti}/",
    # https://cli.codehouse.cloud/quiz/quiz/1/top/STI09886B9FCB/
    # optional: finish, result_pdf if present on backend
    "finish": "quiz/{course_id}/finish/{sti}/",
    "result_pdf": "results/{result_id}/pdf/",
    "appeal_block": "auth/appeal/"

}
DEFAULT_RETRIES =5
REMOTE_TIMEOUT= 10