feat: fill entries page by page #11
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The current fill entries flow is filling all entries that the form has, and it will create an invalid answer for the form if that form has some conditions, like if
Ais selected in questionQthen the next page isPor in case next page ofPisP'that notP + 1, so in these cases we expect some pages are skipped and entries belong to these pages must not be filled.Solution
First, we need to find:
[5]field of each entry to determine the next page ID.[2]field of each entry's option to determine the next page.Then, I modified the
fill_form_entriesfunction a bit to use a loop that starts filling all the entries from the current page, beginning from page 0, and continues until the end page is reached.Note:
next_page_id = -1.pageHistoryentry is moved tofill_form_entriesfor processing and will always have a value ranging from0tolen(pages) - 1.emailAddresswill be handled specially by appending it to the end ofpage_entriesas a separate page, andfill_form_entrieswill check and handle it separately.