Merge branch 'main' of ssh://git.furtest.fr:2222/furtest/Tigrou
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Nuit de l'info quiz</title>
|
||||
<link href="test.css" rel="stylesheet">
|
||||
<link href="logo_n2i_color_moon.svg" rel="icon">
|
||||
<script src="test.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a href="test.html"><img class="logo" src="logo_n2i_color_moon.svg"></a>
|
||||
<h1 id="txt">page du quiz</h1>
|
||||
<button id="strt" onclick="startQuiz()">Start Quiz!</button>
|
||||
<div class="test" id="test1">
|
||||
<h2>Question</h2>
|
||||
<label class="ans">answer 1<input id="tgl11" type="checkbox" onclick=""></input></label><br>
|
||||
<label class="ans">answer 2<input id="tgl21" type="checkbox" onclick=""></input></label><br>
|
||||
<button class="ans" id="sub1" onclick="tog()">sub</button>
|
||||
<p class="ans" id="answer1"><br></p><br>
|
||||
</div>
|
||||
<div class="test" id="test2">
|
||||
<h2>Question</h2>
|
||||
<label class="ans">answer 1<input id="tgl12" type="checkbox" onclick=""></input></label><br>
|
||||
<label class="ans">answer 2<input id="tgl22" type="checkbox" onclick=""></input></label><br>
|
||||
<button class="ans" onclick="tog()">sub</button>
|
||||
<p class="ans" id="answer2"><br></p><br>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Nuit de l'info tkt</title>
|
||||
<link href="test.css" rel="stylesheet">
|
||||
<link href="logo_n2i_color_moon.svg" rel="icon">
|
||||
<script src="test.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a href="test.html"><img class="logo" src="logo_n2i_color_moon.svg"></a>
|
||||
<h1 id="demo">Nuit de l'Info</h1>
|
||||
<p>hello world!</p>
|
||||
<a href="quiz.html"><button>useless button</button></a>
|
||||
<a href="https://google.com"><button type = "button">Google</button></a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -1,10 +1 @@
|
||||
[
|
||||
{
|
||||
"name": "Alice",
|
||||
"score": 100
|
||||
},
|
||||
{
|
||||
"name": "salut",
|
||||
"score": 30
|
||||
}
|
||||
]
|
||||
[]
|
||||
26
flask_base/data/quizz.json
Normal file
26
flask_base/data/quizz.json
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
15
flask_base/templates/quiz.html
Normal file
15
flask_base/templates/quiz.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Nuit de l'info quiz</title>
|
||||
<link href="/static/quiz.css" rel="stylesheet">
|
||||
<link href="/static/logo_n2i_color_moon.svg" rel="icon">
|
||||
<script src="static/quizz.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a href="test.html"><img class="logo" src="static/logo_n2i_color_moon.svg"></a>
|
||||
<h1 id="txt">page du quiz</h1>
|
||||
<button id="strt" onclick="startQuiz()">Start Quiz!</button>
|
||||
{% include 'question.html' %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user