gemischteAufgaben 0 < e < 100
This commit is contained in:
13
app.py
13
app.py
@@ -43,16 +43,25 @@ def index():
|
||||
else:
|
||||
count = len(alle)
|
||||
|
||||
for i in range(1,count):
|
||||
while count > 1:
|
||||
if len(alle) == 0:
|
||||
break
|
||||
term = alle.pop(random.randint(0,len(alle)-1))
|
||||
term.c = ''
|
||||
if request.form.get('gemischteAufgaben'):
|
||||
maxValue = eval(str(term.a) + term.t.typ + str(term.b))
|
||||
term.c += ' + ' if random.randint(0,1) else ' - '
|
||||
if random.randint(0,1):
|
||||
term.c += ' + '
|
||||
t = int(100 - maxValue)
|
||||
maxValue = t
|
||||
else:
|
||||
term.c += ' - '
|
||||
if maxValue <= 1:
|
||||
alle.append(term)
|
||||
continue
|
||||
term.c += str(random.randint(1,maxValue))
|
||||
zufall.append(term)
|
||||
count -= 1
|
||||
return render_template('arbeitsblatt.html',aufgaben=zufall,maxPerPage=int(request.form.get('maxPerPage')))
|
||||
else:
|
||||
return render_template('generator.html', reihen=rt_rechenreihen)
|
||||
|
||||
Reference in New Issue
Block a user