overview
E69 - Show Only In-Progress Questionnaires in Response List
๐น Main Requirement
Only In-Progress questionnaires (i.e., not submitted and still valid) should be shown in the response list.
๐ฐ๏ธ Previous Behavior (Old Process)
In the earlier implementation, the default behavior was to show All questionnaires in the response list.
๐ฝ "All" Option Logic:
- No filtering based on
validToDate
. - Both submitted and not submitted questionnaires were shown.
- All available records were displayed by default when the dropdown was not used or left on the "All" option.
This has now changed with the E69 update, where "InProgress" is the default view.
๐ฝ Dropdown Options
- All โ Show all questionnaires.
- Completed โ Show only submitted questionnaires.
- InProgress โ Show only unsubmitted and still valid questionnaires (Default Selected).
โ Conditions for "InProgress"
validToDate > currentTime
(questionnaire is still valid).- Questionnaire has not been submitted.
โ๏ธ Logic Flow
getQAList()
1. Get Valid Question Sets
Call the getDocuments
API with the following filter:
Extract the questionSetId
s from the API response.
๐ญ Note on Empty Results
If the response is empty, it means the user has either:
- Submitted all valid questionnaires, or
- There are no valid (non-expired) questionnaires available.
โก๏ธ In this case, the response list will display no data to display (empty state).
2. Check Submitted Answers
- After submitting the Questionnarie for that particular questionSetId - AnswerSetId will be created.
Call the
getDocument
API using:
Identify the questionSetId
s that have already been submitted.
3. Find In-Progress Questionnaires
Subtract submitted IDs from the valid question IDs:
These are the In-Progress questionnaires to be displayed in the list.
๐งช Example
Step 1 โ Question Sets from DB
Step 2 โ Submitted Answer Sets
Step 3 โ Result
These will be loaded in the response list under "InProgress".