Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile app: After answering the questionnaire, performing a Pull To Refresh sends the answers again #602

Open
dpalou opened this issue Sep 4, 2024 · 0 comments

Comments

@dpalou
Copy link
Contributor

dpalou commented Sep 4, 2024

This is because the answers are sent to tool_mobile_get_content (the WebService used to retrieve the template). Performing a Pull To Request calls the WebService again with the same parameters, so the answers are saved again.

The current workflow is:

  1. When the user opens the activity, main_index_page template is displayed.
  2. When the user clicks to answer the questionnaire, a new page is opened with the view_activity_page template.
  3. When user sends the answers, the current page is refreshed and now uses the main_index_page template, sending the answers to this template.

IMO the ideal workflow would be:

  1. When the user opens the activity, main_index_page template is displayed (this currently happens).
  2. When the user clicks to answer the questionnaire, a new page is opened with the view_activity_page template.
  3. When user sends the answers, the plugin should use a new WebService to submit the answers. This can be done with the "call-ws" directives.
  4. When the WS finishes successfully, go back to previous page (the index page) and refresh it to display the latest data.

These changes aren't trivial because it requires creating a new WebService. An easier workaround is to disable "Pull To Refresh" in the subpages of the plugin, that way the user cannot re-send the data and this problem doesn't happen. This is just a workaround, the User Experience of this solution isn't good, but it's better than having the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant