SuffolkLITLab / docassemble-ALWeaver

A tool to help quickly generate draft interviews from an existing document (pdf or DOCX) for the docassemble platform.
https://apps-test.suffolklitlab.org/start/ALWeaver/assembly_line/#/1
MIT License
19 stars 5 forks source link

Use a new method to set progress - setting in the interview order block breaks stuff #926

Open nonprofittechy opened 4 months ago

nonprofittechy commented 4 months ago

Do it in a different way. Maybe:

Create a DADict, like this:

---
# interview order
question: |
  ...
  set_progress_to[40] # Will run the set_progress_to block one time, for each unique index value. it won't reset it to that value
---
objects:
  set_progress_to: DADict
---
code: |
  set_progress(float(i))
  set_progress_to[i] = True
ekressmiller commented 4 months ago

Link to issue in Slack and Jonathan's response.

ekressmiller commented 4 months ago

I like your method @nonprofittechy! It does solve the issue with automated progress stopping once you use set_progress.

But a couple downsides I think. I think several related features assume progress will be set on a question, so it's not smart enough to use this alongside:

So I do end up with the progress jumping backward.

ekressmiller commented 4 months ago

(Actually I'm not sure the "stepped" method is working full stop--at least I can't seem to figure it out. So that part might be moot. But the fact that backward progress is not blocked does seem like a disadvantage.)

nonprofittechy commented 4 months ago

Hmm. Well, we could add our own logic in to prevent the progress from going backwards within each block. But it seems it should be controlled higher up in the Docassemble application itself