Start of the quizz on the backend

This commit is contained in:
2025-12-05 01:51:51 +01:00
parent 962e3e61f7
commit 0a8136dfb5
12 changed files with 20 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
from flask import Flask, jsonify, request
from flask import Flask, jsonify, request, render_template
import json
import os
@@ -36,6 +36,12 @@ def get_leaderboard():
leaderboard_sorted = sorted(leaderboard, key=lambda x: x['score'], reverse=True)
return jsonify({'leaderboard': leaderboard_sorted})
@app.route('/questions')
def show_questions():
with open('./data/quizz.json', 'r') as file:
questions = json.load(file)
return render_template('question.html', questions=questions)
if __name__ == '__main__':
app.run(debug=True, port=8080)