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

feat: Omit Report Scores with Scoring Type "Score" from the Report Summary Screen (M2-8097) #540

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/features/PassSurvey/model/ScoresExtractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class ScoresExtractor {
const result: Array<ScoreRecord> = [];

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);

Expand Down
9 changes: 9 additions & 0 deletions src/shared/api/types/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -66,6 +70,11 @@ export type ReportScoreDTO = {
itemsPrint: string[]; // Name of items to print
itemsScore: string[]; // Name of items to calculates
conditionalLogic: Array<ScoreConditionalLogic>;

/** 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 = {
Expand Down
Loading