-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: per-subject activity progress/submission
Made widespread change to incorporate `targetSubjectId` into activity progres tracking, when assignments feature is enabled. Anytime `eventId` is used, now `targetSubjectid` also needs to be passed to identify which activity assignment is the active assessment. This value is also passed to the `answers` POST endpoint to ensure the submission is also properly associated with the `targetSubjectId`. For self-reports, and when assignments feature is disabled, `targetSubjectId` is set to `null`, effectively inheriting existing functionality. For `PublicSurvey` and `PublicAutoCompletion`, `targetSubjectId` stays `null` since public assessments do not support activity assignments.
- Loading branch information
1 parent
d4e2b54
commit 2c818e6
Showing
50 changed files
with
456 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
export const getProgressId = (entityId: string, eventId: string): string => { | ||
return `${entityId}/${eventId}`; | ||
import { GroupProgressId } from './types'; | ||
|
||
export const getProgressId = ( | ||
entityId: string, | ||
eventId: string, | ||
targetSubjectId?: string | null, | ||
): GroupProgressId => { | ||
return targetSubjectId ? `${entityId}/${eventId}/${targetSubjectId}` : `${entityId}/${eventId}`; | ||
}; | ||
|
||
export const getDataFromProgressId = ( | ||
progressId: string, | ||
): { entityId: string; eventId: string } => { | ||
const [entityId, eventId] = progressId.split('/'); | ||
progressId: GroupProgressId, | ||
): { entityId: string; eventId: string; targetSubjectId: string | null } => { | ||
const [entityId, eventId, targetSubjectId = null] = progressId.split('/'); | ||
|
||
return { entityId, eventId }; | ||
return { entityId, eventId, targetSubjectId }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.