Start of the quizz on the backend
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user