latin/app/routes.py

33 lines
1.1 KiB
Python
Raw Normal View History

from app import app
2020-10-15 23:33:52 +02:00
from flask import render_template
@app.route('/')
@app.route('/index')
def index():
return "Hello, World!"
2020-10-15 23:33:52 +02:00
@app.route('/latin')
def latin():
return render_template('latin.html')
@app.route('/latin/llpsi')
def llpsi():
return render_template('LLPSI/01_Imperium_Romanum/Pensum_A.html')
2020-10-15 23:33:52 +02:00
@app.route('/latin/coniugationes')
def coniugationes():
return render_template('coniugationes.html')
@app.route('/latin/coniugationes/quod', methods=["GET", "POST"])
def coniugationes_test():
form = ConjugatioAnswer()
if form.validate_on_submit():
word = Word.query.filter_by(dictionarium=form.word.data).first()
if not form.next_word.data:
if int(form.radio.data) == word.coniugatio:
return render_template('coniugationes.html', dictionarium = word.dictionarium, form = form, success = True)
return render_template('coniugationes.html', dictionarium = word.dictionarium, form = form, fail = True)
word = Word.query.order_by(func.random()).first()
form.word.data = word.dictionarium
return render_template('coniugationes.html', dictionarium = word.dictionarium, form = form)