BryceStevenWilley / docassemble

A free, open-source expert system for guided interviews and document assembly, based on Python, YAML, and Markdown.
https://docassemble.org
MIT License
0 stars 0 forks source link

Save answers on back button #3

Open BryceStevenWilley opened 9 months ago

BryceStevenWilley commented 9 months ago

"Back" shouldn't be "Undo", straight up. The chunk that is un-done by a click of the back button should be stored elsewhere in the interview (one item per variable, you might still lose generic or repeated answers), and if the interview progresses again, it should be used as default.

IMO critical to simple usability

Somewhat related to #2, in that we'd need a mechanism to store answers in an interview that aren't "answered" perse.

BryceStevenWilley commented 8 months ago

Relevant code: https://github.com/jhpyle/docassemble/blob/d6cd734215ea48c8a29eb5dfc8382b669fa7908a/docassemble_webapp/docassemble/webapp/server.py#L6987-L6999 happens when you click "Back". Notably:

Need to figure out what happens with old_user_dict in the rest of index(). But I still think it's possible to get all of the key-values in old_user_dict and not in user_dict, store them somewhere, and if a page with that variable shows up as an input (i.e. not continue button or anything), then it can use that value as default.

For SMS, this happens in line 25504 of server.py. Not sure how to handle that though.