From 83eefd51d79dc2c0fa778303042c581b4691e82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eila=20V=C3=A4yrynen?= Date: Sun, 3 Dec 2023 13:28:36 +0200 Subject: Rearrenge rest of db actions. --- routes/answer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'routes/answer.py') diff --git a/routes/answer.py b/routes/answer.py index f3a506c..2307a83 100644 --- a/routes/answer.py +++ b/routes/answer.py @@ -63,7 +63,7 @@ def answer(): nick = get_nick() ) - if D.is_user_answered(aid, sid): + if D.quiz.user(aid, sid): return render_template( "answer.html", caller = "answer", @@ -76,7 +76,7 @@ def answer(): caller = "answer", alert = get_alert(), nick = get_nick(), - questions = rows2dicts( D.get_questions(aid), ['i','q','n','p'] ), + questions = rows2dicts( D.quiz.questions(aid), ['i','q','n','p'] ), link = D.quiz.get_link( aid ) ) @@ -99,7 +99,7 @@ def set_answers(): if int(answer) < 0 or int(answer) > 999: session["alert"]="Luvattoman pieniƤ tai suuria lukuja!" return redirect( "/#answer" ) - elif D.get_user_answer(int(sid), int(question)) != -1: + elif D.answer.get(int(sid), int(question)) != -1: session["alert"]="Kyselyyn olikin jo saatu vastauksia." return redirect( "/#answer" ) except ValueError: @@ -109,6 +109,6 @@ def set_answers(): for question, answer in request.form.items(): if question=="csrf": continue - D.answer_new(int(sid), int(question), int(answer)) + D.answer.new(int(sid), int(question), int(answer)) return redirect("/#analyse") -- cgit v1.2.3