Frage-Formular
This commit is contained in:
parent
4d26fa88be
commit
2167f8025e
1 changed files with 9 additions and 0 deletions
|
|
@ -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)
|
||||||
Loading…
Reference in a new issue