diff --git a/Quiz/quiz.html b/Quiz/quiz.html deleted file mode 100644 index 23bd702..0000000 --- a/Quiz/quiz.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - Nuit de l'info quiz - - - - - - -

page du quiz

- -
-

Question

-
-
- -



-
-
-

Question

-
-
- -



-
- - diff --git a/Quiz/test.html b/Quiz/test.html deleted file mode 100644 index 451cff5..0000000 --- a/Quiz/test.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Nuit de l'info tkt - - - - - - -

Nuit de l'Info

-

hello world!

- - - - - - \ No newline at end of file diff --git a/Quiz/test.php b/Quiz/test.php deleted file mode 100644 index e69de29..0000000 diff --git a/flask_base/app.py b/flask_base/app.py index fcfc691..8ff22c0 100644 --- a/flask_base/app.py +++ b/flask_base/app.py @@ -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,18 @@ 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('quiz.html', questions=questions) + +@app.route('/softwares_data') +def show_questions(): + with open('./data/softwares.json', 'r') as file: + softwares = json.load(file) + return render_template('pokemon.html', data=softwares) + if __name__ == '__main__': app.run(debug=True, port=8080) diff --git a/flask_base/data/leaderboard.json b/flask_base/data/leaderboard.json index a1e83b5..0637a08 100644 --- a/flask_base/data/leaderboard.json +++ b/flask_base/data/leaderboard.json @@ -1,10 +1 @@ -[ - { - "name": "Alice", - "score": 100 - }, - { - "name": "salut", - "score": 30 - } -] \ No newline at end of file +[] \ No newline at end of file diff --git a/flask_base/data/quizz.json b/flask_base/data/quizz.json new file mode 100644 index 0000000..1d8db8a --- /dev/null +++ b/flask_base/data/quizz.json @@ -0,0 +1,26 @@ +[ + { + "question" : "coucou", + "nb" : 1, + "answer" : [ + { + "answer" : "salut", + "nb" : 1 + } + ] + }, + { + "question" : "hello", + "nb" : 2, + "answer" : [ + { + "answer" : "salut", + "nb" : 1 + }, + { + "answer" : "deux", + "nb" : 2 + } + ] + } +] diff --git a/Quiz/logo_n2i_color_moon.jpg b/flask_base/static/logo_n2i_color_moon.jpg similarity index 100% rename from Quiz/logo_n2i_color_moon.jpg rename to flask_base/static/logo_n2i_color_moon.jpg diff --git a/Quiz/logo_n2i_color_moon.png b/flask_base/static/logo_n2i_color_moon.png similarity index 100% rename from Quiz/logo_n2i_color_moon.png rename to flask_base/static/logo_n2i_color_moon.png diff --git a/Quiz/logo_n2i_color_moon.svg b/flask_base/static/logo_n2i_color_moon.svg similarity index 100% rename from Quiz/logo_n2i_color_moon.svg rename to flask_base/static/logo_n2i_color_moon.svg diff --git a/Quiz/test.css b/flask_base/static/quiz.css similarity index 100% rename from Quiz/test.css rename to flask_base/static/quiz.css diff --git a/Quiz/test.js b/flask_base/static/quizz.js similarity index 100% rename from Quiz/test.js rename to flask_base/static/quizz.js diff --git a/Quiz/question.html b/flask_base/templates/question.html similarity index 100% rename from Quiz/question.html rename to flask_base/templates/question.html diff --git a/flask_base/templates/quiz.html b/flask_base/templates/quiz.html new file mode 100644 index 0000000..91d105e --- /dev/null +++ b/flask_base/templates/quiz.html @@ -0,0 +1,15 @@ + + + + Nuit de l'info quiz + + + + + + +

page du quiz

+ + {% include 'question.html' %} + +