Frage-Formular

This commit is contained in:
Tahar Lamred & Theresa Nerz 2026-06-19 14:05:14 +02:00
parent 3e5451c0e8
commit 41a663eade

View file

@ -1,4 +1,4 @@
from flask import Flask
from flask import Flask, request
app = Flask(__name__)
@ -6,5 +6,14 @@ app = Flask(__name__)
def hello():
return "Willkommen in unserem Escape Room!"
@app.route("/frage", methods=["GET", "POST"])
def frage():
if request.method == "POST":
if request.form["antwort"] == "8":
return "Richtig!"
return "Leider falsch."
return '<form method="post">Was ist 3 + 5? ' \
'<input name="antwort"><button>OK</button></form>'
if __name__ == "__main__":
app.run(host="0.0.0.0", port=9003)