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

[JN-1078] trigger survey assign #889

Merged
merged 4 commits into from
May 20, 2024
Merged

Conversation

devonbush
Copy link
Collaborator

@devonbush devonbush commented May 15, 2024

DESCRIPTION (include screenshots, and mobile screenshots for participant UX)

Previously, we would only assign survey tasks on enrollee creation or on publication of a survey. This makes it so survey completion events can trigger follow-up surveys.

NOTE: in testing this I discovered that we're not storing answerType for any answers. I've added a temporary workaround here, and created a ticket for the full fix

TO TEST: (simple manual steps for confirming core behavior -- used for pre-release checks)

  1. Confirm the unit test makes sense
  2. redeploy apiParticipantApp
  3. repopulate demo
  4. log in to https://sandbox.demo.localhost:3001/ as jsalk@test.com
  5. note that he does NOT have a "Lost interest survey" assigned
  6. go to the mental health survey, and change the answer to the first question to "Nearly every day", then complete the survey (you don't have to answer any other questions)
  7. on the dashboard, you should now see the "Lost interest" survey

Copy link

sonarcloud bot commented May 15, 2024

Copy link
Collaborator

@connorlbark connorlbark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, but I do wonder if this should only be on survey completion. I found it confusing as a user experience because I signed in as Jsalk, who had already completed the survey, and I changed the answer and it didn't give me the new one.

I could see the argument that, if I select that answer but don't complete the survey, I shouldn't get the new survey. But I do think if you change an answer on a completed survey it should assign you the new survey, I wouldn't expect to have to re-complete it. Otherwise it worked great!

As an aside, I also noticed that the eligibility rule was in the DB, but it didn't show up in the lost interests UI. A cursory look didn't make the bug seem obvious but I'll take a peek and see if I can figure out why it's doing that. I have a pr up to fix this.

Copy link
Collaborator

@connorlbark connorlbark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i'll go ahead and approve, up to you if you wanna fix the edge case, I don't know how common it would be)

@devonbush
Copy link
Collaborator Author

Connor and I chatted some more -- we'll leave as-is for now, and then open this up for discussion at next demo

Copy link
Member

@MatthewBemis MatthewBemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@devonbush devonbush added this pull request to the merge queue May 20, 2024
Merged via the queue into development with commit c2d0ce9 May 20, 2024
13 of 14 checks passed
@devonbush devonbush deleted the db-trigger-survey-assign branch May 20, 2024 14:59
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

Successfully merging this pull request may close these issues.

None yet

3 participants