summaryrefslogtreecommitdiff
path: root/quiz.py
diff options
context:
space:
mode:
authorOlli Vilén <oviln@local>2023-11-16 22:11:46 +0200
committerOlli Vilén <oviln@local>2023-11-16 22:11:46 +0200
commit0ed244ef2dd27a835ec12fdbc93a1f20bbcd89eb (patch)
treeba673352e44f2e1e55b8dc762b45a9cd769376e3 /quiz.py
parent93a927b130ba09cea29aba2077848f785ac48844 (diff)
More db actions and forms.
Diffstat (limited to 'quiz.py')
-rw-r--r--quiz.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/quiz.py b/quiz.py
new file mode 100644
index 0000000..a136209
--- /dev/null
+++ b/quiz.py
@@ -0,0 +1,13 @@
+from app import app
+from flask import render_template, session, request, redirect
+import db_actions as D
+
+
+@app.route("/new_quiz",methods=["POST"])
+def new_quiz():
+ if not "id" in session.keys():
+ session["alert"]="Tarvitset nimimerkin loudaksesi"
+ return redirect("/#nick")
+ user_id = session["id"]
+ session["quiz_id"] = D.quiz_new( user_id )
+ return redirect("/#create")