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

Participant creation issue on the lime survey #227

Open
alireza-dhp opened this issue Feb 23, 2024 · 8 comments
Open

Participant creation issue on the lime survey #227

alireza-dhp opened this issue Feb 23, 2024 · 8 comments
Labels
bug Something isn't working high priority

Comments

@alireza-dhp
Copy link
Member

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

@alireza-dhp alireza-dhp added bug Something isn't working high priority labels Feb 23, 2024
@andresgruber
Copy link
Contributor

andresgruber commented Mar 4, 2024

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
Copy link
Member Author

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
Copy link
Contributor

tkurz commented Mar 7, 2024

@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
Copy link
Member Author

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
Copy link
Contributor

tkurz commented Mar 8, 2024

@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
Copy link
Member Author

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
Copy link
Contributor

tkurz commented Mar 15, 2024

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

  • store studyId and ObservationId in addition to participant Id in the lime survey database (currently only participantId is stored
  • check on activation if a user already exists for participantId, observationId and studyId
  • if necessary: create lime participant, otherwise get lime participant
  • store token in more-app
    Downwards compatibility:
    If no user exists with pId, oId, sId it checks if there is a user with just pId, that fits. If yes, it assumes that this user is the one requesting.
    I think that should do the trick

@andresgruber
Copy link
Contributor

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:

  • You must not change a lime-survey id after you have started the study.
  • We therefore prohibit such a change after study start and during pausing an study, which have already been running (active).
  • If one needs to change change the referenced lime-survey - you can still do it.
  • If one needs to reference a new lime survey, you have to create a new observation for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

No branches or pull requests

3 participants