Added questions counter
This commit is contained in:
		
							parent
							
								
									4e006889e7
								
							
						
					
					
						commit
						34e20ead6e
					
				
					 3 changed files with 20 additions and 5 deletions
				
			
		
							
								
								
									
										5
									
								
								game.py
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								game.py
									
										
									
									
									
								
							|  | @ -68,7 +68,10 @@ def hello(): | ||||||
|             {'A': str(ab[0]), 'B': str(ab[1])} |             {'A': str(ab[0]), 'B': str(ab[1])} | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|     return render_template('index.html', title=title, separator=separator, content=ablines) |     with open("ab.txt", "rbU") as f: | ||||||
|  |         num_lines = sum(1 for _ in f) | ||||||
|  | 
 | ||||||
|  |     return render_template('index.html', title=title, separator=separator, content=ablines, num_lines=num_lines) | ||||||
| 
 | 
 | ||||||
| def getContent(): | def getContent(): | ||||||
|     lines = [a.strip() for a in open("ab.txt").readlines()] |     lines = [a.strip() for a in open("ab.txt").readlines()] | ||||||
|  |  | ||||||
|  | @ -75,6 +75,15 @@ html, body { | ||||||
|     align-items: center; |     align-items: center; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #footer { | ||||||
|  |     margin-top: 15px; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #questions { | ||||||
|  |     font-size: small; | ||||||
|  |     text-align: center; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| @media only screen and (max-width:480px) { | @media only screen and (max-width:480px) { | ||||||
|     #content { |     #content { | ||||||
|         min-width: 95%; |         min-width: 95%; | ||||||
|  |  | ||||||
|  | @ -16,6 +16,9 @@ | ||||||
|                     <div class="b">B) {{ question['B'] }}</div> |                     <div class="b">B) {{ question['B'] }}</div> | ||||||
|                 </div> |                 </div> | ||||||
|             {% endfor %} |             {% endfor %} | ||||||
|  |             <div id="footer"> | ||||||
|  |                 <div id="questions">Es gibt derzeit {{ num_lines }} Fragen.</div> | ||||||
|  |             </div> | ||||||
|         </div> |         </div> | ||||||
|     </body> |     </body> | ||||||
| </html> | </html> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue