Пример #1
1
def answer(flow_id, question_id, answer_id):
    flow = graph.flow(flow_id)
    question = graph.question(flow_id, question_id)

    answer = first([answer for answer in question.answers if answer["id"] == answer_id])

    rewards = [rel.end for rel in answer.relationships.outgoing(["Reward"])]

    next_question = first([rel.end for rel in answer.relationships.outgoing(["Next"])])

    return render_template(
        "answer.html", flow=flow, question=question, answer=answer, rewards=rewards, next_question=next_question
    )
Пример #2
0
def question(flow_id, question_id):
    flow = graph.flow(flow_id)
    question = graph.question(flow_id, question_id)

    return render_template("question.html", flow=flow, question=question)