forked from technolyceum/ai6-m2
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
from flask import Flask, render_template, request, jsonify, session
|
|
import json
|
|
import random
|
|
import os
|
|
|
|
app = Flask(__name__)
|
|
app.secret_key = 'quizimoto_secret_key'
|
|
|
|
# TODO: Dima - Implement prize structure (15 levels)
|
|
PRIZE_LEVELS = [
|
|
# Format: [1000, 2000, 4000, 8000, 16000, 32000, ... up to 15 values]
|
|
]
|
|
GUARANTEED_LEVELS = [5, 10] # First and second guaranteed levels
|
|
|
|
@app.route('/')
|
|
def index():
|
|
return render_template('index.html')
|
|
|
|
@app.route('/start')
|
|
def start_game():
|
|
# TODO: Dima - Initialize game session
|
|
# Set up: score, current_question, lifelines, questions
|
|
return render_template('game.html')
|
|
|
|
@app.route('/get_question')
|
|
def get_question():
|
|
# TODO: Dima - Serve questions to frontend
|
|
# Return: question, options, question_number, current_prize
|
|
return jsonify({"error": "Not implemented"})
|
|
|
|
@app.route('/answer', methods=['POST'])
|
|
def check_answer():
|
|
# TODO: Dima - Validate answers and update score
|
|
# Check if answer is correct, update session, return result
|
|
return jsonify({"error": "Not implemented"})
|
|
|
|
@app.route('/lifeline/<lifeline_name>')
|
|
def use_lifeline(lifeline_name):
|
|
# TODO: Dima - Implement 50:50 and Phone a Friend
|
|
# Note: Ask AI will be version 2
|
|
return jsonify({"error": "Not implemented"})
|
|
|
|
if __name__ == '__main__':
|
|
app.run(debug=True)
|