Exemplo n.º 1
0
def get_current_species_data():
    q_num = g._game.question_num
    curr_question = g._game.questions[q_num-1]

    is_last = g._game.total_questions == q_num
    is_answered = curr_question.correct is not None

    if is_last and is_answered:
        species_list = []
        for q in g._game.questions:
            for s in q.species:
                species_list.append(s)
    else:
        species_list = curr_question.species

    app.logger.debug("Species list: {}".format(species_list))
    species_data = Planigale.load_species_from_redis(g._redis, species_list)

    return species_data
Exemplo n.º 2
0
def get_random_species_data(num_species):
    species_list = Planigale.get_sid_list_from_redis(g._redis, num_species)
    species_data = Planigale.load_species_from_redis(g._redis, species_list)

    return species_data