From 0ed244ef2dd27a835ec12fdbc93a1f20bbcd89eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olli=20Vil=C3=A9n?= Date: Thu, 16 Nov 2023 22:11:46 +0200 Subject: More db actions and forms. --- quiz.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 quiz.py (limited to 'quiz.py') 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") -- cgit v1.2.3