Code block

To send your answers, include the following code in its own block at the end of the interview:

---
reconsider: True
code: |
  import dt_send_answers
  answers_response = dt_send_answers.send_answers()
---

This code will collect all of the questions and user responses and send them to your Docassemble Toolkit account.

To ensure this code runs, you'll need to include ${ answers_response } anywhere in the text of the question of your last question block, or in every question block that is a possible exit point for your interview. For example:

---
question: |
  Thanks for playing! ${ answers_response }
mandatory: True
---

It's important to include ${ answers_response } inside of the indented text in the 'question' key of the block and not at the top level of indentation.

WRONG:

---
question: |
  Thanks for playing!
mandatory: True
${ answers_response }
---

This will render invisibly and trigger the code block that sends your answers to the Answers repository.

results matching ""

    No results matching ""