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) | ||||
|  | ||||
| @ -28,12 +28,12 @@ | ||||
|         <br/> | ||||
|         <label for="anzahl">max. Aufgaben: </label> | ||||
|         <select name="anzahl"> | ||||
|             <option value="">Alle</option> | ||||
|             <option value="78">78</option> | ||||
|             <option value="39">39</option> | ||||
|             <option value="">Alle</option> | ||||
|         </select><br/> | ||||
|         <label for="maxPerPage">max. Aufgaben pro Seite</label> | ||||
|         <input name="maxPerPage" value="78"><br/> | ||||
|         <input name="maxPerPage" value="39"><br/> | ||||
|         <br/> | ||||
|         <input type="submit" value="zum Arbeitsblatt"> | ||||
|     </form> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user