Beispiel #1
0
    def get_q_num_questions() -> str:
        """Returns prompt asking how many questions to ask."""
        ms_try_saying = get_ms_try_saying()
        ms_ask_me = random.choice( free_play.data.MT_ASK_ME_QUESTIONS)
        random_num = str(random.randint(3, 10))
        ms_questions = random.choice( free_play.data.MT_QUESTIONS)

        speech_list = [
            ms_try_saying, ms_ask_me, random_num, ms_questions,
        ]
        return ' '.join(speech_list)
 def get_ms_can_retry_query_format() -> str:
     """Returns message that can re-input query tables."""
     speech_list = (
         free_play.data.MMT_WRONG,
         1.5,
         "For example,",
         get_ms_try_saying(),
         0.75,
         FPTimesTables.get_example_tables_query(),
     )
     return get_linear_nlg(speech_list)
    def get_ms_fp_table_input() -> str:
        """Returns helps message for providing freeplay table parameters."""
        speech_list = [
            helper.data.MS_FP_TIMES_TABLES,
            Pauser.get_p_level(1),
            get_ms_try_saying(),
        ]
        if random.random() < 0.25:
            speech_list.append(FPTimesTables.get_example_tables_query())
        else:
            speech_list.append(FPTimesTables.get_example_table_range())

        return ' '.join(speech_list)
    def get_ms_add_table_example() -> str:
        """Returns example of how to add tables"""
        random_nums = set()
        while len(random_nums) != 3:
            num = random.randint(0, 10)
            if num not in random_nums:
                random_nums.add(str(num))

        speech_list = (
            get_ms_try_saying(),
            get_linear_nlg(free_play.data.MMT_EXAMPLE_ADD_TIMES_TABLES),
            ' and '.join(random_nums),
        )
        return ' '.join(speech_list)
    def get_q_times_tables_input() -> str:
        """Returns prompt asking what times tables to practice.
        
        NOTE: Should add handler_input so can change example b/w prompt & reprompt,
        and depending on num logins, etc.
        """
        q_what_tables = get_linear_nlg(free_play.data.MMT_WHAT_TABLES_PRACTICE)
        if random.random() < 0.0:  ## TODO: Change chance of prompt.
            ms_example = FPTimesTables.get_example_tables_query()
        else:
            ms_example = FPTimesTables.get_example_table_range()

        speech_list = (q_what_tables,
                       Pauser.get_p_level(2), get_ms_try_saying(),
                       Pauser.get_p_level(0.75), ms_example)
        speech = ' '.join(speech_list)
        return MW_SLOW1.format(speech)
Beispiel #6
0
    def get_q_change_bounds() -> str:
        """Returns prompt that can change the upper/lower bound of the tables."""
        if random.random() > 0.5:
            ## lower bound
            bound_type = "lower",
            bound_num = random.randint(3, 7)
            ml_bound_effect = free_play.data.MT_LOWER_BOUND
        else:
            bound_type = "upper"
            bound_num = random.randint(7, 10)
            ml_bound_effect = free_play.data.MT_LOWER_BOUND
        
        ms_bound_effect = random.choice(ml_bound_effect).format(bound_num)
        ms_to_bound = free_play.data.MT_BOUND_TO.format( bound_type)

        speech_list = (
            get_ms_try_saying(),
            free_play.data.MT_CHANGE,
            bound_type,
            ms_to_bound,
            2,
            ms_bound_effect,
        )
        return get_linear_nlg( speech_list)