-
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.
content: add some explanations to 737 questions (#96)
- Loading branch information
Showing
21 changed files
with
288 additions
and
170 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
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
26 changes: 26 additions & 0 deletions
26
libs/core/app/src/tests/get-number-of-available-questions.ts
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { LearningObjectiveId } from "@chair-flight/base/types"; | ||
|
||
export const getNumberOfAvailableQuestions = ( | ||
subject: { | ||
learningObjectives: Array<{ | ||
id: LearningObjectiveId; | ||
numberOfQuestions: number; | ||
learningObjectives: Array<{ | ||
id: LearningObjectiveId; | ||
numberOfQuestions: number; | ||
}>; | ||
}>; | ||
}, | ||
selectedLearningObjectives: LearningObjectiveId[], | ||
) => { | ||
return subject.learningObjectives.reduce((sum, lo) => { | ||
if (selectedLearningObjectives.includes(lo.id)) { | ||
return sum + lo.numberOfQuestions; | ||
} | ||
lo.learningObjectives.forEach((lo2) => { | ||
if (!selectedLearningObjectives.includes(lo2.id)) return; | ||
sum += lo2.numberOfQuestions; | ||
}); | ||
return sum; | ||
}, 0); | ||
}; |
Oops, something went wrong.
b23ecb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chair-flight – ./
chair-flight-git-main-chair-flight-team.vercel.app
chair-flight.vercel.app
chair-flight-chair-flight-team.vercel.app
chair-flight.com
www.chair-flight.com