add maxPerPage
This commit is contained in:
parent
724ce039da
commit
a487d6d70b
2
app.py
2
app.py
@ -53,7 +53,7 @@ def index():
|
|||||||
term.c += ' + ' if random.randint(0,1) else ' - '
|
term.c += ' + ' if random.randint(0,1) else ' - '
|
||||||
term.c += str(random.randint(1,maxValue))
|
term.c += str(random.randint(1,maxValue))
|
||||||
zufall.append(term)
|
zufall.append(term)
|
||||||
return render_template('arbeitsblatt.html',aufgaben=zufall)
|
return render_template('arbeitsblatt.html',aufgaben=zufall,maxPerPage=int(request.form.get('maxPerPage')))
|
||||||
else:
|
else:
|
||||||
return render_template('generator.html', reihen=rt_rechenreihen)
|
return render_template('generator.html', reihen=rt_rechenreihen)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<div class="w3-responsive">
|
<div class="w3-responsive">
|
||||||
{% for a in aufgaben %}
|
{% for a in aufgaben %}
|
||||||
<table class="w3-left" width="auto"><tr><td class="w3-right-align" style="width: 7em">{{ a.a }} {% if a.t.typ == '*' %}·{% elif a.t.typ == '/'%}:{% else %}{{ a.t.typ }}{% endif %} {{ a.b }}{{ a.c }}</td><td> = </td><td class="w3-border-bottom" style="width: 5em; height: 2em"></td></tr></table>
|
<table class="w3-left" width="auto"><tr><td class="w3-right-align" style="width: 7em">{{ a.a }} {% if a.t.typ == '*' %}·{% elif a.t.typ == '/'%}:{% else %}{{ a.t.typ }}{% endif %} {{ a.b }}{{ a.c }}</td><td> = </td><td class="w3-border-bottom" style="width: 5em; height: 2em"></td></tr></table>
|
||||||
{% if (loop.index % 60 == 0) and (not loop.last) %}
|
{% if (loop.index % maxPerPage == 0) and (not loop.last) %}
|
||||||
<div style="break-after: page; clear: both;"></div>
|
<div style="break-after: page; clear: both;"></div>
|
||||||
<div style="margin-bottom: 3em"></div>
|
<div style="margin-bottom: 3em"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -29,10 +29,11 @@
|
|||||||
<label for="anzahl">max. Aufgaben: </label>
|
<label for="anzahl">max. Aufgaben: </label>
|
||||||
<select name="anzahl">
|
<select name="anzahl">
|
||||||
<option value="">Alle</option>
|
<option value="">Alle</option>
|
||||||
<option value="80">80</option>
|
<option value="78">78</option>
|
||||||
<option value="40">40</option>
|
<option value="39">39</option>
|
||||||
<option value="20">20</option>
|
</select><br/>
|
||||||
</select>
|
<label for="maxPerPage">max. Aufgaben pro Seite</label>
|
||||||
|
<input name="maxPerPage" value="78"><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<input type="submit" value="zum Arbeitsblatt">
|
<input type="submit" value="zum Arbeitsblatt">
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user