File size: 1,189 Bytes
03fc001
fe81191
 
03fc001
c1fade2
 
 
 
 
 
03fc001
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1fade2
03fc001
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from .utils import convert_sequence_to_string


def generate_question_data(start, step, question_num=1):
    """returns question by provided number with filled parameters
    
    parameters
    ----------
    :start: current number
    :step: interval between current and next numbers
    :question_num: question number"""
    seq = convert_sequence_to_string(start, step)
    start_from_num = start + 2 * step
    questions = [
        f"Let's practice counting   {convert_sequence_to_string(start, step, sep='... ')}   After {start_from_num}, what is the next number you will count?\n{seq}",
        f"What number comes {step} number after {start_from_num}?\n{seq}",
        f"We're counting by {step}s.  What number is 1 after {start_from_num}?\n{seq}",
        f"What is {step} number up from {start_from_num}?\n{seq}",
        f"If we count up {step} from {start_from_num}, what number is next?\n{seq}",
    ]
    questions_data = []
    for quest in questions:
        questions_data.append({
            "question": quest,
            "answer": start_from_num + step,
            "start": start_from_num,
            "step": step
        })
    return questions_data[question_num]