Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	File size: 680 Bytes
			
			13381fa e267c97 13381fa 790a22c 13381fa f6fd98e 13381fa 790a22c 13381fa 790a22c e267c97 790a22c 13381fa 790a22c e267c97  | 
								1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  | 
								import random
from .questions import generate_question_data
from .utils import get_next_difficulty, generate_start_step
def start_interactive_math(difficulty=0.01, do_increase: True | False = True):
    next_difficulty = get_next_difficulty(difficulty, do_increase)
    start, step = generate_start_step(difficulty)
    question_data = generate_question_data(start, step, question_num=random.randint(0, 4))
    question = question_data['question']
    start = question_data['start']
    step = question_data['step']
    output = {
        "text": question,
        "difficulty": next_difficulty,
        "question_numbers": [start, step, start + step]
    }
    return output
 |