Spaces:
Sleeping
Sleeping
| # config/settings.py | |
| """Enhanced configuration settings for TriviaVerse""" | |
| # API Endpoints | |
| WIKIPEDIA_API = "https://en.wikipedia.org/w/api.php" | |
| WIKIDATA_API = "https://www.wikidata.org/w/api.php" | |
| WIKIBOOKS_API = "https://en.wikibooks.org/w/api.php" | |
| WIKI_REST_API = "https://en.wikipedia.org/api/rest_v1/page/summary/" | |
| # App Settings | |
| APP_NAME = "TriviaVerse" | |
| APP_VERSION = "2.0.0" | |
| APP_DESCRIPTION = "A Dynamic Quiz App Powered by Wikipedia, Wikidata & Wikibooks" | |
| # Difficulty Levels with scoring multipliers | |
| DIFFICULTY_LEVELS = { | |
| "Easy": { | |
| "description": "Direct Wikipedia summaries", | |
| "multiplier": 1.0, | |
| "time_limit": 45, | |
| "hints_allowed": 2, | |
| }, | |
| "Medium": { | |
| "description": "Deeper Wikidata relationships", | |
| "multiplier": 1.5, | |
| "time_limit": 30, | |
| "hints_allowed": 1, | |
| }, | |
| "Hard": { | |
| "description": "Conceptual flashcards requiring critical thought", | |
| "multiplier": 2.0, | |
| "time_limit": 20, | |
| "hints_allowed": 0, | |
| }, | |
| } | |
| # Topic Generation | |
| RANDOM_TOPICS = [ | |
| "Artificial Intelligence", | |
| "Climate Change", | |
| "Space Exploration", | |
| "Quantum Computing", | |
| "Renaissance Art", | |
| "Human Brain", | |
| "Ocean Biodiversity", | |
| "Ancient Egypt", | |
| "Renewable Energy", | |
| "Blockchain Technology", | |
| "Sustainable Energy", | |
| "Modern Architecture", | |
| "CRISPR gene editing", | |
| ] | |
| # Quiz Settings | |
| QUESTIONS_PER_QUIZ = 10 | |
| BASE_POINTS = 100 | |
| # Badge System | |
| BADGES = { | |
| "beginner": {"name": "Beginner", "threshold": 100, "icon": "π±"}, | |
| "learner": {"name": "Learner", "threshold": 500, "icon": "π"}, | |
| "scholar": {"name": "Scholar", "threshold": 1000, "icon": "π"}, | |
| "expert": {"name": "Expert", "threshold": 2500, "icon": "π"}, | |
| "master": {"name": "Master", "threshold": 5000, "icon": "π"}, | |
| } | |
| # Achievement System | |
| ACHIEVEMENTS = { | |
| "first_quiz": { | |
| "name": "First Steps", | |
| "description": "Complete your first quiz", | |
| "points": 50, | |
| }, | |
| "perfect_score": { | |
| "name": "Perfect!", | |
| "description": "Get 100% on a quiz", | |
| "points": 200, | |
| }, | |
| "streak_5": { | |
| "name": "On Fire", | |
| "description": "Answer 5 questions correctly in a row", | |
| "points": 150, | |
| }, | |
| "diverse_learner": { | |
| "name": "Diverse Learner", | |
| "description": "Play all 3 game modes", | |
| "points": 100, | |
| }, | |
| "early_bird": { | |
| "name": "Early Bird", | |
| "description": "Play before 6 AM", | |
| "points": 75, | |
| }, | |
| "night_owl": { | |
| "name": "Night Owl", | |
| "description": "Play after midnight", | |
| "points": 75, | |
| }, | |
| "week_warrior": { | |
| "name": "Week Warrior", | |
| "description": "Play 7 days in a row", | |
| "points": 300, | |
| }, | |
| "century": { | |
| "name": "Century", | |
| "description": "Answer 100 questions", | |
| "points": 500, | |
| }, | |
| } | |
| # Leaderboard Settings | |
| LEADERBOARD_SIZE = 10 | |
| LEADERBOARD_UPDATE_INTERVAL = 300 # 5 minutes in seconds | |
| # Cache Settings | |
| CACHE_TIMEOUT = 3600 # 1 hour in seconds | |
| MAX_CACHE_SIZE = 1000 # Maximum number of cached items | |
| # Rate Limiting | |
| API_RATE_LIMIT = 100 # requests per minute | |
| USER_RATE_LIMIT = 50 # actions per minute | |
| # Session Settings | |
| SESSION_TIMEOUT = 3600 # 1 hour in seconds | |
| REMEMBER_ME_DURATION = 604800 # 7 days in seconds | |