Comments (4)
The only way I could think of to implement that would be to have a "testing default value" option for each field, so that in the testing mode, a default value is plugged in. Whether the interview actually gets to the question you want to test will depend on the values that have been input until that point.
One way around the problem you describe is to develop your interview in the playground and click "Save and Run" once so that you have an interview in another tab. Then navigate through the interview to the screen you want to edit. Then you make changes to the relevant question block in the interview YAML and click "Save." Then, go to the tab with the interview running in it and refresh the page with Ctrl-R. You will see the effect of the changes you made to the question, and you won't have to start at the beginning. There are some instances where this might not work, such as when you change mandatory code blocks that have already been executed in the test interview.
Another thing that might work is to install the iMacros browser extension and "record" yourself using the interview, starting with navigating to the URL of the interview with &reset=1
. Then you can save that macro and double-click it in the iMacros sidebar every time you want to get to a certain place in an interview.
from docassemble.
See https://docassemble.org/docs/development.html#testing for a discussion of interview testing. The testing mechanism described, which uses lettuce
and selenium
, can be used to fast-forward to a particular place in an interview scenario.
Another suggestion for testing individual questions is to insert a mandatory: True
code
block at the start of the interview that runs force_ask('some_variable')
, where some_variable
is the name of a variable that is defined by the question you want to inspect. This will ask the minimum necessary questions to present the question to the user. It might not work in certain circumstances, such as questions from a middle of a list gathering process. See https://docassemble.org/docs/functions.html#force_ask
from docassemble.
These are great ideas for testing an interview for correctness. I do think that a lot of us would find it helpful to have a "test" button that just runs the code or asks the question in the current section of the YAML file, without requiring a mandatory instruction, while we are just debugging or learning the syntax of a question. What I have settled on doing now is copying the question, adding mandatory: true and the objects declaration from the beginning of the interview into a new yaml file. It's a fine workaround but it might be a really nice addition to the system to have that quick test/preview option.
Maybe the test button could simulate having the force_ask('some_variable') block at the beginning of the interview? Perhaps it's really two distinct options: a preview that just displays the question without asking the predecessor questions (using just the variable name for variables used in the question), and a test button that asks the minimum number of predecessor questions?
This isn't a high priority issue, but it would definitely speed up learning Docassemble and I think be a helpful addition to the Playground.
from docassemble.
I am going through old issues to close them. There are a variety of ways to fast-forward. At the end of the day, a docassemble interview interview is a computer program that raises an exception and then gets re-run with different input; there is no universal way to fast-forward through that.
from docassemble.
Related Issues (20)
- oauth2client in DAOAuth is deprecated HOT 3
- API resume_url with secret HOT 3
- Packages menu doesn't work as expected when browsing a user's playground HOT 1
- numbers and currency formating decimals HOT 1
- Migration to linux/arm64 (rpi4 / Raspberry Pi 4) HOT 2
- Playground fails to load HOT 5
- On the recipe screen, I think you should add something to the description of idle.js implementation
- 2424 HOT 1
- Update redis-py package requirement to 5.0.2 HOT 1
- Setting new language doesn´t work HOT 4
- Interview datatype date is returning 'Bad date' in the downloded document HOT 5
- Error when configured for Azure Authentication HOT 6
- Error: AttributeError: 'str' object has no attribute 'signature' HOT 3
- Feature Request: seperate out services from Dockerfile HOT 3
- External Database HOT 2
- Get Session ID HOT 2
- Remove underlined space from back button HOT 1
- Review screen on dark mode not changing
- Date and time format problem HOT 1
- Navigation bar html not working when using hide corner interface HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docassemble.