diff --git a/src/features/PassSurvey/model/ScoresExtractor.ts b/src/features/PassSurvey/model/ScoresExtractor.ts index d7ff2ed76..c85672009 100644 --- a/src/features/PassSurvey/model/ScoresExtractor.ts +++ b/src/features/PassSurvey/model/ScoresExtractor.ts @@ -42,6 +42,11 @@ class ScoresExtractor { const result: Array = []; for (const scoreSettings of settings) { + if (scoreSettings.type === 'score' && scoreSettings.scoringType === 'score') { + // Skip report scores that are not configured as raw scores + continue; + } + try { const score: ScoreRecord | null = this.extractInternal(items, scoreSettings); diff --git a/src/shared/api/types/activity.ts b/src/shared/api/types/activity.ts index 67d711bb8..f2963992a 100644 --- a/src/shared/api/types/activity.ts +++ b/src/shared/api/types/activity.ts @@ -57,6 +57,10 @@ export type ScoreAndReports = { export type ReportDTO = ReportScoreDTO | ReportSectionDTO; +export const ScoreReportScoringType = ['score', 'raw_score'] as const; + +export type ScoreReportScoringType = (typeof ScoreReportScoringType)[number]; + export type ReportScoreDTO = { type: 'score'; id: string; @@ -66,6 +70,11 @@ export type ReportScoreDTO = { itemsPrint: string[]; // Name of items to print itemsScore: string[]; // Name of items to calculates conditionalLogic: Array; + + /** Whether to show raw score or T scores in the report */ + scoringType: ScoreReportScoringType; + /** The name of a subscale to use for a lookup table, if `scoringType` is set to "score" */ + subscaleName?: string; }; export type ReportSectionDTO = {