MORE-Platform / more-app-multiplatform

The mobile application for the MORE platform.
https://more-health.at
Other
6 stars 1 forks source link

Participant creation issue on the lime survey #227

Open alireza-dhp opened 7 months ago

alireza-dhp commented 7 months ago

Some Lime surveys can't be opened, and it looks like there's a problem with creating all participants for lime surveys when resuming a study!

download

andresgruber commented 7 months ago

Dear @alireza-dhp : We tried to reproduce the issue with the App version 3.0.7 (Android 13, emulated) as we guessed, in your screenshot that this is an Android screen.

We could not reproduce it:

  1. Created a new study with participants and a lime survey.
  2. With one participant, we answered the lime survey.
  3. Paused the study, added additional participants, resumed the study.
  4. Logged in with a newly created participant and completed the lime survey.

Please make sure, that you work with a properly configured lime survey (could be a source of the failure) and test again. We are not considering this a a bug of the platform backend nor the app. If the behavior stays as is, please provide us with the version and a configuration of the lime survey questionnaire.

alireza-dhp commented 7 months ago

Hello @andresgruber,

I have reproduced this issue by follwoing these steps:

  1. Created a new study with participants and a lime survey.
  2. Start the study.
  3. Pause the study and modify the Lime Survey Id with either a newly created one or an existing Lime Survey, and then resumed the study.
  4. The "Survey participants" table for the recently used Lime Survey does not update corresponding to the study participants.

There could be alternative steps leading to the same outcome, as noted by the master student who observed this issue.

tkurz commented 7 months ago

@alireza-dhp Mhh, okay. Yes I check this, seems to be a backend issue as IMHO it is out of scope that lime survey id changes. What should happen if you do so if the study is already running? That would corrupt your data somehow. Nevertheless, what do you mean with "The "Survey participants" table for the recently used Lime Survey does not update corresponding to the study participants." Can you describe what would be an expected behaviour, so we can implement it. Please specifiy in detail what should happen.

alireza-dhp commented 7 months ago

Dear @tkurz,

Thanks for looking into the issue. I agree that changing the lime survey Id during a running study is not a common scenario. However, it seems to be a valid user action that should be supported!

To clarify the statement: I guess, the issue occurs because user tokens are missing from the "Survey Participants" table! This table is accessible on limesurvey service at: Limesurvey name -> Settings -> Survey Menu -> Survey Participants -> Display Participants The expected behavior, in my opinion, would be to update or synchronize "Survey participants" table with the current set of study participants associated with the modified LimeSurvey Id.

In detail, when the study is resumed with a new or modified lime survey Id, the "Survey Participants" table should be updated to include all the participants from the study, with each participant having a corresponding token. This ensures that every participant can access the lime survey from the MORE app without encountering issues related to missing tokens.

I hope this clarifies the expected behavior.

tkurz commented 7 months ago

@alireza-dhp I see. In the current implementation the a participant (identified by its id within the study) is only created once on activation, so if a surveyId is changed from a to b and the participant is already "created" on survey a but is missing on b. https://github.com/MORE-Platform/more-studymanager-backend/blob/main/studymanager-observation/src/main/java/io/redlink/more/studymanager/component/observation/lime/LimeSurveyObservation.java#L35 I will fix this.

alireza-dhp commented 6 months ago

Hello @tkurz,

May I kindly ask you for a rough estimation of fixing this issue? It is essential that the researcher carry out her study, and this error prevents her from doing so.

tkurz commented 6 months ago

Hi @alireza-dhp ! Think about 4-6h including testing. The solution would be:

andresgruber commented 6 months ago

Hi @alireza-dhp : The solution proposed by @tkurz has shortcomings, b/c you then can't differentiate for one "observation" id, which questionnaire has been answered. To solve this entirely, it would need way more changes and enhancements. Therefore, I suggest to implement a real bugfix, which will work as following: