After a user has gone through the survey we give them an option to go back to the first page and select more questions to answer. If the user goes back and selects new questions to answer we don't want them to have to navigate back through the pages that they have already visited.
I have tried implementing this a few ways using survey.onCurrentPageChanging but this isn't working and ends up in a recursive loop. I feel like I am probably missing an obvious way to do this. I've considered visibleIf and isVisible but this creates issues with other logic we have implemented.
For example:
JavaScriptsurvey.onCurrentPageChanging.add((sender, options) => {
if (options.newCurrentPage.hasShown) sender.nextPage()
})
Here is an example plunkr https://plnkr.co/edit/nhjFkYQysTGU0UE4
Steps to reproduce:
1.) Select "general pain"
2.) Answer questions
3.) On the last screen click the "Add symptoms" button.
4.) Select "abdominal pain"
5.) User is taken to the "general pain" questions which have already been answered
The desired outcome is that any pages or questions previously answered are not show to the user again.
Thank you. Appreciate your time.