Skip to content

YAL Assessment Reminders

megh-k edited this page Mar 9, 2023 · 1 revision

Assessment Reminder

Design

When the user is sent a assessment message template, the assessment reminder will be set. The following contact fields are relevant to this feature and will be present on any contact that requires an assessment reminder,

  • ASSESSMENT REMINDER NAME, this is the name of the assessment that the user was sent
  • ASSESSMENT REMINDER, the date and time the user last interacted with the assessment.
  • ASSESSMENT REMINDER TYPE, this specifies whether the user abandoned the assessment or asked for the assessment to be deferred.
  • ASSESSMENT REMINDER SENT, this is set once the assessment has been sent to the user.

Each time the user responds to a message in the assessment, the ASSESSMENT REMINDER will be updated.

The reminders are split into 4 cases,

For the sake of re-usability of code, some flows might not match the miroboard 100%. Some of the assessments restart with no instructions. The copy from the original assessments were added to the assessment message to be sent when the user enters the locus_of_control, gender_attitude, body_image and self_perceived_healthcare assessments. These messages are sent without buttons and are just informational for the user.

RapidPro

In the RapidPro, the assessment reminders are sent out on RapidPro via a combination of a flow, a smart group and a campaign. There are 3 smart groups and 3 campaigns and 3 flows, they are as follows:

30 min:

1 hour:

  • A flow YAL Assessment reminder 1h
  • A smart group based on the rule assessment_reminder_type = "later 1hour" OR assessment_reminder_type = "reengagement 1hour"
  • A campaign that triggers 1 hour after the ASSESSMENT REMINDER contact field.

23 hours:

  • A flow YAL Assessment reminder 23h
  • A smart group based on the rule assessment_reminder_type = "later 23hours" OR assessment_reminder_type = "reengagement 23hours" OR assessment_reminder_type = "later_2 23hours"
  • A campaign that triggers 23 hours after the ASSESSMENT REMINDER contact field.

Python Bot

User responds later

When the user is sent the assessment template, they are given the option to delay the assessment by 1h or 23h, this will depend on which assessment they are taking and at which point they are in the assessment. This is handled in the yal/assessments.py in state_reschedule_assessment_reminder.

User abandons midway though assessment

Once the user has been sent the assessment template, the assessment reminder time is set, for each message the user receives, the timestamp is updated. If the user finishes the assessment, the reminder will be cleared but if the user does not complete the assessment, they will be reminded in 30min. This is handled in yal/assessments.py in state_reschedule_assessment_reminder.

Reminder Sent to the User

Once the reminder message has been sent, the users response is processed in yal/main.py. The bot will determine if the keyword is in ASSESSMENT_REENGAGEMENT_KEYWORDS, the user is then taken to yal/assessments.py to the state state_handle_assessment_reminder_response, which is also set as the REMINDER_STATE for the assessments section of the application.

If the user wants to continue with the assessment now, the assessment_reminder_sent is reset and the user is sent to the assessment, and will start the assessment from scratch. In the case of the locus_of_control, gender_attitude, body_image and self_perceived_healthcare, an additional message will be retrieved from yal/assessment_data/reengagement.py. This instructional message will be sent to the user before the questions are sent, for a smoother transition into the questions. If it is decided in future that any other assessment requires an informational message, it can be added in this file.

If the user then abandons the assessment, the reengagement reminder will then be set again. If the user requests that the assessment be deferred again, the reminder will be set based on their requests, if the option is available.

If the user requests to skip the assessment entirely. The user is made aware that the personalisation will not be possible, and if they then confirm that they do not want to complete the assessment (state_stop_assessment_reminders_confirm), they will be set as high_risk for the current assessment, and the assessment reminders will be cleared (state_stop_assessment_reminders).