Frage-Formular

This commit is contained in:
ElenaRJ 2026-06-17 16:03:42 +02:00
parent 4d26fa88be
commit 2167f8025e

View file

@ -6,5 +6,14 @@ app = Flask(__name__)
def hello(): def hello():
return "Hallo aus meiner Flask-App! Willkommen in unseren Escape Room! Wuhuuuu es wird Gruselig" return "Hallo aus meiner Flask-App! Willkommen in unseren Escape Room! Wuhuuuu es wird Gruselig"
@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__": if __name__ == "__main__":
app.run(host="0.0.0.0", port=9008) # 90 + Raumnummer (Wir: 08) app.run(host="0.0.0.0", port=9008) # 90 + Raumnummer (Wir: 08)