Erstellung Frage
This commit is contained in:
parent
1de9e4eab1
commit
c4f36b15e5
1 changed files with 17 additions and 1 deletions
18
app.py
18
app.py
|
|
@ -1,4 +1,4 @@
|
||||||
from flask import Flask
|
from flask import Flask, request
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
|
@ -8,5 +8,21 @@ def hello():
|
||||||
return "Glück Auf aus meinem Escape-Room!"
|
return "Glück Auf aus meinem Escape-Room!"
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/frage", methods=["GET", "POST"])
|
||||||
|
def frage():
|
||||||
|
if request.method == "POST":
|
||||||
|
if request.form["antwort"] == "8":
|
||||||
|
return "Richtig! Tür offen."
|
||||||
|
return "Leider falsch."
|
||||||
|
|
||||||
|
return (
|
||||||
|
'<form method="post">'
|
||||||
|
"Was ist 0+4? "
|
||||||
|
'<input name="antwort">'
|
||||||
|
"<button>OK</button>"
|
||||||
|
"</form>"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(host="0.0.0.0", port=9007)
|
app.run(host="0.0.0.0", port=9007)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue