diff options
author | Eila Väyrynen <evayryne@local> | 2023-12-03 13:28:36 +0200 |
---|---|---|
committer | Eila Väyrynen <evayryne@local> | 2023-12-03 13:28:36 +0200 |
commit | 83eefd51d79dc2c0fa778303042c581b4691e82e (patch) | |
tree | bb957d130855e7ba798f90604468c3665a81528d /routes/answer.py | |
parent | e0ca9caf5a49981ad999b1c0c3fec69d7c4871e4 (diff) |
Rearrenge rest of db actions.
Diffstat (limited to 'routes/answer.py')
-rw-r--r-- | routes/answer.py | 8 |
1 files changed, 4 insertions, 4 deletions
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") |