@magmamath/students-features 1.3.4-rc.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +2 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js +2 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +1 -1
- package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +1 -1
- package/dist/commonjs/features/pmProgress/PmProgress.js +42 -0
- package/dist/commonjs/features/pmProgress/PmProgress.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/chart.helpers.js +24 -0
- package/dist/commonjs/features/pmProgress/components/chart/chart.helpers.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/chart.types.js +2 -0
- package/dist/commonjs/features/pmProgress/components/chart/chart.types.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/PracticeProgressPieChart.js +44 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/PracticeProgressPieChart.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/SlicesClipPaths.js +26 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/SlicesClipPaths.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/SlicesPaths.js +91 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/SlicesPaths.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceArcPattern.js +38 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceArcPattern.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.js +21 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceFillColor.js +55 -0
- package/dist/commonjs/features/pmProgress/components/chart/components/layers/SliceFillColor.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/model/ArcPatternGenerator.js +49 -0
- package/dist/commonjs/features/pmProgress/components/chart/model/ArcPatternGenerator.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/model/PieChartManager.js +23 -0
- package/dist/commonjs/features/pmProgress/components/chart/model/PieChartManager.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/chart/model/SliceShapeGenerator.js +79 -0
- package/dist/commonjs/features/pmProgress/components/chart/model/SliceShapeGenerator.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/content/PmContent.js +50 -0
- package/dist/commonjs/features/pmProgress/components/content/PmContent.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/header/NextUp.js +127 -0
- package/dist/commonjs/features/pmProgress/components/header/NextUp.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/header/PmProgressHeader.js +133 -0
- package/dist/commonjs/features/pmProgress/components/header/PmProgressHeader.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/header/StartButton.js +126 -0
- package/dist/commonjs/features/pmProgress/components/header/StartButton.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/insights/PmInsights.js +70 -0
- package/dist/commonjs/features/pmProgress/components/insights/PmInsights.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/insights/PmTimeframeStats.js +99 -0
- package/dist/commonjs/features/pmProgress/components/insights/PmTimeframeStats.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/insights/StatsCard.js +72 -0
- package/dist/commonjs/features/pmProgress/components/insights/StatsCard.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/list/Fluency.js +82 -0
- package/dist/commonjs/features/pmProgress/components/list/Fluency.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/list/ListCard.js +207 -0
- package/dist/commonjs/features/pmProgress/components/list/ListCard.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/list/ListItem.js +139 -0
- package/dist/commonjs/features/pmProgress/components/list/ListItem.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/list/PmDomainList.js +96 -0
- package/dist/commonjs/features/pmProgress/components/list/PmDomainList.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/locked/PmStatusOverlay.js +101 -0
- package/dist/commonjs/features/pmProgress/components/locked/PmStatusOverlay.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/recs/PmTeacherRecs.js +134 -0
- package/dist/commonjs/features/pmProgress/components/recs/PmTeacherRecs.js.map +1 -0
- package/dist/commonjs/features/pmProgress/components/standard/StandardTag.js +203 -0
- package/dist/commonjs/features/pmProgress/components/standard/StandardTag.js.map +1 -0
- package/dist/commonjs/features/pmProgress/context/PmProgressContext.js +18 -0
- package/dist/commonjs/features/pmProgress/context/PmProgressContext.js.map +1 -0
- package/dist/commonjs/features/pmProgress/index.js +64 -0
- package/dist/commonjs/features/pmProgress/index.js.map +1 -0
- package/dist/commonjs/features/pmProgress/model/PmHighlightModel.js +15 -0
- package/dist/commonjs/features/pmProgress/model/PmHighlightModel.js.map +1 -0
- package/dist/commonjs/features/pmProgress/model/PmInsightsModel.js +22 -0
- package/dist/commonjs/features/pmProgress/model/PmInsightsModel.js.map +1 -0
- package/dist/commonjs/features/pmProgress/model/PmProgressApi.js +18 -0
- package/dist/commonjs/features/pmProgress/model/PmProgressApi.js.map +1 -0
- package/dist/commonjs/features/pmProgress/model/PmProgressModel.js +43 -0
- package/dist/commonjs/features/pmProgress/model/PmProgressModel.js.map +1 -0
- package/dist/commonjs/features/pmProgress/model/PmRecommendationsModel.js +47 -0
- package/dist/commonjs/features/pmProgress/model/PmRecommendationsModel.js.map +1 -0
- package/dist/commonjs/features/pmProgress/model/PmSolvingFlowModel.js +104 -0
- package/dist/commonjs/features/pmProgress/model/PmSolvingFlowModel.js.map +1 -0
- package/dist/commonjs/features/pmProgress/model/PmTreeModel.js +176 -0
- package/dist/commonjs/features/pmProgress/model/PmTreeModel.js.map +1 -0
- package/dist/commonjs/features/pmProgress/shared/TreeNormalizer.js +52 -0
- package/dist/commonjs/features/pmProgress/shared/TreeNormalizer.js.map +1 -0
- package/dist/commonjs/features/pmProgress/shared/pmProgress.constants.js +65 -0
- package/dist/commonjs/features/pmProgress/shared/pmProgress.constants.js.map +1 -0
- package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js +234 -0
- package/dist/commonjs/features/pmProgress/shared/pmProgress.helpers.js.map +1 -0
- package/dist/commonjs/features/pmProgress/shared/pmProgress.types.js +12 -0
- package/dist/commonjs/features/pmProgress/shared/pmProgress.types.js.map +1 -0
- package/dist/commonjs/features/voice/constants.js +3 -15
- package/dist/commonjs/features/voice/constants.js.map +1 -1
- package/dist/commonjs/features/voice/recording/components/VoiceRecord.js +5 -19
- package/dist/commonjs/features/voice/recording/components/VoiceRecord.js.map +1 -1
- package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +26 -81
- package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -1
- package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js +2 -2
- package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js +3 -3
- package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -1
- package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +0 -5
- package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -1
- package/dist/commonjs/features/voice/types.js +0 -6
- package/dist/commonjs/features/voice/types.js.map +1 -1
- package/dist/commonjs/index.js +15 -3
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/icons/MenuIcon.js +30 -0
- package/dist/commonjs/shared/icons/MenuIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/PentagonIcon.js +29 -0
- package/dist/commonjs/shared/icons/PentagonIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/SketchArrowRight.js +33 -0
- package/dist/commonjs/shared/icons/SketchArrowRight.js.map +1 -0
- package/dist/commonjs/shared/icons/SliceDiamondIcon.js +29 -0
- package/dist/commonjs/shared/icons/SliceDiamondIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/StarIcon.js +32 -0
- package/dist/commonjs/shared/icons/StarIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/TimerIcon.js +35 -0
- package/dist/commonjs/shared/icons/TimerIcon.js.map +1 -0
- package/dist/commonjs/shared/translation/localization/ca.json +24 -0
- package/dist/commonjs/shared/translation/localization/de.json +24 -0
- package/dist/commonjs/shared/translation/localization/en.json +24 -0
- package/dist/commonjs/shared/translation/localization/gb.json +24 -0
- package/dist/commonjs/shared/translation/localization/sct.json +24 -0
- package/dist/commonjs/shared/translation/localization/sw.json +24 -0
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +2 -1
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js +2 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +2 -2
- package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +1 -1
- package/dist/module/features/pmProgress/PmProgress.js +36 -0
- package/dist/module/features/pmProgress/PmProgress.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/chart.helpers.js +17 -0
- package/dist/module/features/pmProgress/components/chart/chart.helpers.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/chart.types.js +2 -0
- package/dist/module/features/pmProgress/components/chart/chart.types.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/components/PracticeProgressPieChart.js +38 -0
- package/dist/module/features/pmProgress/components/chart/components/PracticeProgressPieChart.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/components/SlicesClipPaths.js +20 -0
- package/dist/module/features/pmProgress/components/chart/components/SlicesClipPaths.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/components/SlicesPaths.js +85 -0
- package/dist/module/features/pmProgress/components/chart/components/SlicesPaths.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/components/layers/SliceArcPattern.js +32 -0
- package/dist/module/features/pmProgress/components/chart/components/layers/SliceArcPattern.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.js +15 -0
- package/dist/module/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/components/layers/SliceFillColor.js +49 -0
- package/dist/module/features/pmProgress/components/chart/components/layers/SliceFillColor.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/model/ArcPatternGenerator.js +44 -0
- package/dist/module/features/pmProgress/components/chart/model/ArcPatternGenerator.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/model/PieChartManager.js +18 -0
- package/dist/module/features/pmProgress/components/chart/model/PieChartManager.js.map +1 -0
- package/dist/module/features/pmProgress/components/chart/model/SliceShapeGenerator.js +74 -0
- package/dist/module/features/pmProgress/components/chart/model/SliceShapeGenerator.js.map +1 -0
- package/dist/module/features/pmProgress/components/content/PmContent.js +44 -0
- package/dist/module/features/pmProgress/components/content/PmContent.js.map +1 -0
- package/dist/module/features/pmProgress/components/header/NextUp.js +121 -0
- package/dist/module/features/pmProgress/components/header/NextUp.js.map +1 -0
- package/dist/module/features/pmProgress/components/header/PmProgressHeader.js +126 -0
- package/dist/module/features/pmProgress/components/header/PmProgressHeader.js.map +1 -0
- package/dist/module/features/pmProgress/components/header/StartButton.js +119 -0
- package/dist/module/features/pmProgress/components/header/StartButton.js.map +1 -0
- package/dist/module/features/pmProgress/components/insights/PmInsights.js +63 -0
- package/dist/module/features/pmProgress/components/insights/PmInsights.js.map +1 -0
- package/dist/module/features/pmProgress/components/insights/PmTimeframeStats.js +94 -0
- package/dist/module/features/pmProgress/components/insights/PmTimeframeStats.js.map +1 -0
- package/dist/module/features/pmProgress/components/insights/StatsCard.js +66 -0
- package/dist/module/features/pmProgress/components/insights/StatsCard.js.map +1 -0
- package/dist/module/features/pmProgress/components/list/Fluency.js +76 -0
- package/dist/module/features/pmProgress/components/list/Fluency.js.map +1 -0
- package/dist/module/features/pmProgress/components/list/ListCard.js +200 -0
- package/dist/module/features/pmProgress/components/list/ListCard.js.map +1 -0
- package/dist/module/features/pmProgress/components/list/ListItem.js +132 -0
- package/dist/module/features/pmProgress/components/list/ListItem.js.map +1 -0
- package/dist/module/features/pmProgress/components/list/PmDomainList.js +90 -0
- package/dist/module/features/pmProgress/components/list/PmDomainList.js.map +1 -0
- package/dist/module/features/pmProgress/components/locked/PmStatusOverlay.js +95 -0
- package/dist/module/features/pmProgress/components/locked/PmStatusOverlay.js.map +1 -0
- package/dist/module/features/pmProgress/components/recs/PmTeacherRecs.js +128 -0
- package/dist/module/features/pmProgress/components/recs/PmTeacherRecs.js.map +1 -0
- package/dist/module/features/pmProgress/components/standard/StandardTag.js +197 -0
- package/dist/module/features/pmProgress/components/standard/StandardTag.js.map +1 -0
- package/dist/module/features/pmProgress/context/PmProgressContext.js +13 -0
- package/dist/module/features/pmProgress/context/PmProgressContext.js.map +1 -0
- package/dist/module/features/pmProgress/index.js +9 -0
- package/dist/module/features/pmProgress/index.js.map +1 -0
- package/dist/module/features/pmProgress/model/PmHighlightModel.js +10 -0
- package/dist/module/features/pmProgress/model/PmHighlightModel.js.map +1 -0
- package/dist/module/features/pmProgress/model/PmInsightsModel.js +17 -0
- package/dist/module/features/pmProgress/model/PmInsightsModel.js.map +1 -0
- package/dist/module/features/pmProgress/model/PmProgressApi.js +13 -0
- package/dist/module/features/pmProgress/model/PmProgressApi.js.map +1 -0
- package/dist/module/features/pmProgress/model/PmProgressModel.js +38 -0
- package/dist/module/features/pmProgress/model/PmProgressModel.js.map +1 -0
- package/dist/module/features/pmProgress/model/PmRecommendationsModel.js +42 -0
- package/dist/module/features/pmProgress/model/PmRecommendationsModel.js.map +1 -0
- package/dist/module/features/pmProgress/model/PmSolvingFlowModel.js +99 -0
- package/dist/module/features/pmProgress/model/PmSolvingFlowModel.js.map +1 -0
- package/dist/module/features/pmProgress/model/PmTreeModel.js +171 -0
- package/dist/module/features/pmProgress/model/PmTreeModel.js.map +1 -0
- package/dist/module/features/pmProgress/shared/TreeNormalizer.js +47 -0
- package/dist/module/features/pmProgress/shared/TreeNormalizer.js.map +1 -0
- package/dist/module/features/pmProgress/shared/pmProgress.constants.js +62 -0
- package/dist/module/features/pmProgress/shared/pmProgress.constants.js.map +1 -0
- package/dist/module/features/pmProgress/shared/pmProgress.helpers.js +214 -0
- package/dist/module/features/pmProgress/shared/pmProgress.helpers.js.map +1 -0
- package/dist/module/features/pmProgress/shared/pmProgress.types.js +8 -0
- package/dist/module/features/pmProgress/shared/pmProgress.types.js.map +1 -0
- package/dist/module/features/voice/constants.js +2 -14
- package/dist/module/features/voice/constants.js.map +1 -1
- package/dist/module/features/voice/recording/components/VoiceRecord.js +6 -20
- package/dist/module/features/voice/recording/components/VoiceRecord.js.map +1 -1
- package/dist/module/features/voice/recording/components/VoiceRecordButton.js +28 -83
- package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -1
- package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js +2 -2
- package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js +3 -3
- package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -1
- package/dist/module/features/voice/recording/model/VoiceRecord.model.js +0 -5
- package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -1
- package/dist/module/features/voice/types.js +1 -5
- package/dist/module/features/voice/types.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/icons/MenuIcon.js +22 -0
- package/dist/module/shared/icons/MenuIcon.js.map +1 -0
- package/dist/module/shared/icons/PentagonIcon.js +21 -0
- package/dist/module/shared/icons/PentagonIcon.js.map +1 -0
- package/dist/module/shared/icons/SketchArrowRight.js +25 -0
- package/dist/module/shared/icons/SketchArrowRight.js.map +1 -0
- package/dist/module/shared/icons/SliceDiamondIcon.js +21 -0
- package/dist/module/shared/icons/SliceDiamondIcon.js.map +1 -0
- package/dist/module/shared/icons/StarIcon.js +24 -0
- package/dist/module/shared/icons/StarIcon.js.map +1 -0
- package/dist/module/shared/icons/TimerIcon.js +27 -0
- package/dist/module/shared/icons/TimerIcon.js.map +1 -0
- package/dist/module/shared/translation/localization/ca.json +24 -0
- package/dist/module/shared/translation/localization/de.json +24 -0
- package/dist/module/shared/translation/localization/en.json +24 -0
- package/dist/module/shared/translation/localization/gb.json +24 -0
- package/dist/module/shared/translation/localization/sct.json +24 -0
- package/dist/module/shared/translation/localization/sw.json +24 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/pmProgress/PmProgress.d.ts +9 -0
- package/dist/typescript/commonjs/features/pmProgress/PmProgress.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.helpers.d.ts +4 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.types.d.ts +36 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/chart.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/PracticeProgressPieChart.d.ts +9 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/PracticeProgressPieChart.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/SlicesClipPaths.d.ts +10 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/SlicesClipPaths.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/SlicesPaths.d.ts +11 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/SlicesPaths.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceArcPattern.d.ts +12 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceArcPattern.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.d.ts +8 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceFillColor.d.ts +14 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/components/layers/SliceFillColor.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/model/ArcPatternGenerator.d.ts +12 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/model/ArcPatternGenerator.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/model/PieChartManager.d.ts +14 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/model/PieChartManager.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/model/SliceShapeGenerator.d.ts +17 -0
- package/dist/typescript/commonjs/features/pmProgress/components/chart/model/SliceShapeGenerator.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/content/PmContent.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/components/content/PmContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/header/NextUp.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/components/header/NextUp.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/header/PmProgressHeader.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/components/header/PmProgressHeader.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/header/StartButton.d.ts +11 -0
- package/dist/typescript/commonjs/features/pmProgress/components/header/StartButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/insights/PmInsights.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/components/insights/PmInsights.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/insights/PmTimeframeStats.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/components/insights/PmTimeframeStats.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/insights/StatsCard.d.ts +12 -0
- package/dist/typescript/commonjs/features/pmProgress/components/insights/StatsCard.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/list/Fluency.d.ts +8 -0
- package/dist/typescript/commonjs/features/pmProgress/components/list/Fluency.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/list/ListCard.d.ts +31 -0
- package/dist/typescript/commonjs/features/pmProgress/components/list/ListCard.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/list/ListItem.d.ts +12 -0
- package/dist/typescript/commonjs/features/pmProgress/components/list/ListItem.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/list/PmDomainList.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/components/list/PmDomainList.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/locked/PmStatusOverlay.d.ts +8 -0
- package/dist/typescript/commonjs/features/pmProgress/components/locked/PmStatusOverlay.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/recs/PmTeacherRecs.d.ts +3 -0
- package/dist/typescript/commonjs/features/pmProgress/components/recs/PmTeacherRecs.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/components/standard/StandardTag.d.ts +9 -0
- package/dist/typescript/commonjs/features/pmProgress/components/standard/StandardTag.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/context/PmProgressContext.d.ts +15 -0
- package/dist/typescript/commonjs/features/pmProgress/context/PmProgressContext.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/index.d.ts +7 -0
- package/dist/typescript/commonjs/features/pmProgress/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmHighlightModel.d.ts +7 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmHighlightModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmInsightsModel.d.ts +14 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmInsightsModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmProgressApi.d.ts +17 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmProgressApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmProgressModel.d.ts +23 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmProgressModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmRecommendationsModel.d.ts +102 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmRecommendationsModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmSolvingFlowModel.d.ts +22 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmSolvingFlowModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmTreeModel.d.ts +25 -0
- package/dist/typescript/commonjs/features/pmProgress/model/PmTreeModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/TreeNormalizer.d.ts +17 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/TreeNormalizer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.constants.d.ts +49 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts +73 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.types.d.ts +193 -0
- package/dist/typescript/commonjs/features/pmProgress/shared/pmProgress.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/constants.d.ts +2 -12
- package/dist/typescript/commonjs/features/voice/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts +3 -1
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +1 -2
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts +1 -3
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/types.d.ts +0 -4
- package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/MenuIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/MenuIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/PentagonIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/PentagonIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/SketchArrowRight.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/SketchArrowRight.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/SliceDiamondIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/SliceDiamondIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/StarIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/StarIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/TimerIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/TimerIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +144 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +48 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
- package/dist/typescript/module/features/pmProgress/PmProgress.d.ts +9 -0
- package/dist/typescript/module/features/pmProgress/PmProgress.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/chart.helpers.d.ts +4 -0
- package/dist/typescript/module/features/pmProgress/components/chart/chart.helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/chart.types.d.ts +36 -0
- package/dist/typescript/module/features/pmProgress/components/chart/chart.types.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/PracticeProgressPieChart.d.ts +9 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/PracticeProgressPieChart.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/SlicesClipPaths.d.ts +10 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/SlicesClipPaths.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/SlicesPaths.d.ts +11 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/SlicesPaths.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceArcPattern.d.ts +12 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceArcPattern.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.d.ts +8 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceFillColor.d.ts +14 -0
- package/dist/typescript/module/features/pmProgress/components/chart/components/layers/SliceFillColor.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/model/ArcPatternGenerator.d.ts +12 -0
- package/dist/typescript/module/features/pmProgress/components/chart/model/ArcPatternGenerator.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/model/PieChartManager.d.ts +14 -0
- package/dist/typescript/module/features/pmProgress/components/chart/model/PieChartManager.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/chart/model/SliceShapeGenerator.d.ts +17 -0
- package/dist/typescript/module/features/pmProgress/components/chart/model/SliceShapeGenerator.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/content/PmContent.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/components/content/PmContent.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/header/NextUp.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/components/header/NextUp.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/header/PmProgressHeader.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/components/header/PmProgressHeader.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/header/StartButton.d.ts +11 -0
- package/dist/typescript/module/features/pmProgress/components/header/StartButton.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/insights/PmInsights.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/components/insights/PmInsights.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/insights/PmTimeframeStats.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/components/insights/PmTimeframeStats.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/insights/StatsCard.d.ts +12 -0
- package/dist/typescript/module/features/pmProgress/components/insights/StatsCard.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/list/Fluency.d.ts +8 -0
- package/dist/typescript/module/features/pmProgress/components/list/Fluency.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/list/ListCard.d.ts +31 -0
- package/dist/typescript/module/features/pmProgress/components/list/ListCard.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/list/ListItem.d.ts +12 -0
- package/dist/typescript/module/features/pmProgress/components/list/ListItem.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/list/PmDomainList.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/components/list/PmDomainList.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/locked/PmStatusOverlay.d.ts +8 -0
- package/dist/typescript/module/features/pmProgress/components/locked/PmStatusOverlay.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/recs/PmTeacherRecs.d.ts +3 -0
- package/dist/typescript/module/features/pmProgress/components/recs/PmTeacherRecs.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/components/standard/StandardTag.d.ts +9 -0
- package/dist/typescript/module/features/pmProgress/components/standard/StandardTag.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/context/PmProgressContext.d.ts +15 -0
- package/dist/typescript/module/features/pmProgress/context/PmProgressContext.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/index.d.ts +7 -0
- package/dist/typescript/module/features/pmProgress/index.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/model/PmHighlightModel.d.ts +7 -0
- package/dist/typescript/module/features/pmProgress/model/PmHighlightModel.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/model/PmInsightsModel.d.ts +14 -0
- package/dist/typescript/module/features/pmProgress/model/PmInsightsModel.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/model/PmProgressApi.d.ts +17 -0
- package/dist/typescript/module/features/pmProgress/model/PmProgressApi.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/model/PmProgressModel.d.ts +23 -0
- package/dist/typescript/module/features/pmProgress/model/PmProgressModel.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/model/PmRecommendationsModel.d.ts +102 -0
- package/dist/typescript/module/features/pmProgress/model/PmRecommendationsModel.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/model/PmSolvingFlowModel.d.ts +22 -0
- package/dist/typescript/module/features/pmProgress/model/PmSolvingFlowModel.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/model/PmTreeModel.d.ts +25 -0
- package/dist/typescript/module/features/pmProgress/model/PmTreeModel.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/shared/TreeNormalizer.d.ts +17 -0
- package/dist/typescript/module/features/pmProgress/shared/TreeNormalizer.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/shared/pmProgress.constants.d.ts +49 -0
- package/dist/typescript/module/features/pmProgress/shared/pmProgress.constants.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.d.ts +73 -0
- package/dist/typescript/module/features/pmProgress/shared/pmProgress.helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/pmProgress/shared/pmProgress.types.d.ts +193 -0
- package/dist/typescript/module/features/pmProgress/shared/pmProgress.types.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/constants.d.ts +2 -12
- package/dist/typescript/module/features/voice/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts +3 -1
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +1 -2
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts +1 -3
- package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/types.d.ts +0 -4
- package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/MenuIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/MenuIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/PentagonIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/PentagonIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/SketchArrowRight.d.ts +4 -0
- package/dist/typescript/module/shared/icons/SketchArrowRight.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/SliceDiamondIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/SliceDiamondIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/StarIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/StarIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/TimerIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/TimerIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +144 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +48 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/package.json +21 -13
- package/src/features/chatbot/components/ChatInput/ChatInput.tsx +2 -1
- package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +2 -1
- package/src/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.tsx +2 -2
- package/src/features/pmProgress/PmProgress.tsx +30 -0
- package/src/features/pmProgress/__tests__/.keep +0 -0
- package/src/features/pmProgress/components/chart/chart.helpers.ts +16 -0
- package/src/features/pmProgress/components/chart/chart.types.ts +37 -0
- package/src/features/pmProgress/components/chart/components/PracticeProgressPieChart.tsx +32 -0
- package/src/features/pmProgress/components/chart/components/SlicesClipPaths.tsx +22 -0
- package/src/features/pmProgress/components/chart/components/SlicesPaths.tsx +90 -0
- package/src/features/pmProgress/components/chart/components/layers/SliceArcPattern.tsx +44 -0
- package/src/features/pmProgress/components/chart/components/layers/SliceBackgroundColor.tsx +11 -0
- package/src/features/pmProgress/components/chart/components/layers/SliceFillColor.tsx +60 -0
- package/src/features/pmProgress/components/chart/model/ArcPatternGenerator.ts +48 -0
- package/src/features/pmProgress/components/chart/model/PieChartManager.ts +17 -0
- package/src/features/pmProgress/components/chart/model/SliceShapeGenerator.ts +90 -0
- package/src/features/pmProgress/components/content/PmContent.tsx +44 -0
- package/src/features/pmProgress/components/header/NextUp.tsx +109 -0
- package/src/features/pmProgress/components/header/PmProgressHeader.tsx +135 -0
- package/src/features/pmProgress/components/header/StartButton.tsx +160 -0
- package/src/features/pmProgress/components/insights/PmInsights.tsx +65 -0
- package/src/features/pmProgress/components/insights/PmTimeframeStats.tsx +88 -0
- package/src/features/pmProgress/components/insights/StatsCard.tsx +54 -0
- package/src/features/pmProgress/components/list/Fluency.tsx +72 -0
- package/src/features/pmProgress/components/list/ListCard.tsx +231 -0
- package/src/features/pmProgress/components/list/ListItem.tsx +164 -0
- package/src/features/pmProgress/components/list/PmDomainList.tsx +76 -0
- package/src/features/pmProgress/components/locked/PmStatusOverlay.tsx +101 -0
- package/src/features/pmProgress/components/recs/PmTeacherRecs.tsx +127 -0
- package/src/features/pmProgress/components/standard/StandardTag.tsx +181 -0
- package/src/features/pmProgress/context/PmProgressContext.tsx +26 -0
- package/src/features/pmProgress/index.ts +6 -0
- package/src/features/pmProgress/model/PmHighlightModel.ts +11 -0
- package/src/features/pmProgress/model/PmInsightsModel.ts +23 -0
- package/src/features/pmProgress/model/PmProgressApi.ts +34 -0
- package/src/features/pmProgress/model/PmProgressModel.ts +48 -0
- package/src/features/pmProgress/model/PmRecommendationsModel.ts +47 -0
- package/src/features/pmProgress/model/PmSolvingFlowModel.ts +140 -0
- package/src/features/pmProgress/model/PmTreeModel.ts +171 -0
- package/src/features/pmProgress/shared/TreeNormalizer.ts +64 -0
- package/src/features/pmProgress/shared/pmProgress.constants.ts +100 -0
- package/src/features/pmProgress/shared/pmProgress.helpers.ts +307 -0
- package/src/features/pmProgress/shared/pmProgress.types.ts +217 -0
- package/src/features/voice/constants.ts +2 -14
- package/src/features/voice/recording/components/VoiceRecord.tsx +5 -28
- package/src/features/voice/recording/components/VoiceRecordButton.tsx +30 -114
- package/src/features/voice/recording/components/VoiceRecordDeleteButton.tsx +2 -2
- package/src/features/voice/recording/hooks/useVoiceRecorderAnimation.ts +4 -8
- package/src/features/voice/recording/model/VoiceRecord.model.ts +0 -7
- package/src/features/voice/types.ts +0 -5
- package/src/index.ts +1 -0
- package/src/shared/icons/MenuIcon.tsx +15 -0
- package/src/shared/icons/PentagonIcon.tsx +14 -0
- package/src/shared/icons/SketchArrowRight.tsx +18 -0
- package/src/shared/icons/SliceDiamondIcon.tsx +14 -0
- package/src/shared/icons/StarIcon.tsx +17 -0
- package/src/shared/icons/TimerIcon.tsx +21 -0
- package/src/shared/translation/localization/ca.json +24 -0
- package/src/shared/translation/localization/de.json +24 -0
- package/src/shared/translation/localization/en.json +24 -0
- package/src/shared/translation/localization/gb.json +24 -0
- package/src/shared/translation/localization/sct.json +24 -0
- package/src/shared/translation/localization/sw.json +24 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { attach, createEffect, createEvent, createStore, restore, sample } from 'effector'
|
|
2
|
+
import { createAction } from 'effector-action'
|
|
3
|
+
import {
|
|
4
|
+
Domain,
|
|
5
|
+
Grade,
|
|
6
|
+
PmProgressGateProps,
|
|
7
|
+
SetupInitialGradeProps,
|
|
8
|
+
StatsResponse,
|
|
9
|
+
GetTreeContextFxParams,
|
|
10
|
+
TreeContext,
|
|
11
|
+
TreeMappingResponse,
|
|
12
|
+
User,
|
|
13
|
+
} from '../shared/pmProgress.types'
|
|
14
|
+
import { PmProgressApi } from './PmProgressApi'
|
|
15
|
+
import { enhanceProgressMatrixData } from '@matteappen/skills-utils'
|
|
16
|
+
import {
|
|
17
|
+
getDomainStructure,
|
|
18
|
+
getInitialPmGrade,
|
|
19
|
+
getTreeGrades,
|
|
20
|
+
isTreeDataReady,
|
|
21
|
+
} from '../shared/pmProgress.helpers'
|
|
22
|
+
import { TreeNormalizer } from '../shared/TreeNormalizer'
|
|
23
|
+
import { persist } from 'effector-storage/session'
|
|
24
|
+
import { PmProgressStatus, SessionStorageKeys } from '../shared/pmProgress.constants'
|
|
25
|
+
import { isWeb } from '../../../shared/common.constants'
|
|
26
|
+
|
|
27
|
+
export class PmTreeModel {
|
|
28
|
+
private readonly $tree = createStore<TreeMappingResponse | null>(null)
|
|
29
|
+
private readonly $stats = createStore<StatsResponse | null>(null)
|
|
30
|
+
private readonly $user = createStore<User | null>(null)
|
|
31
|
+
|
|
32
|
+
private readonly setupInitialGrade = createEvent<SetupInitialGradeProps>()
|
|
33
|
+
private readonly setDomains = createEvent<Domain[]>()
|
|
34
|
+
public readonly setGrade = createEvent<number | null>()
|
|
35
|
+
|
|
36
|
+
public readonly $isInitialized = createStore(false)
|
|
37
|
+
public readonly $grade = restore(this.setGrade, null)
|
|
38
|
+
public readonly $domains = restore(this.setDomains, [])
|
|
39
|
+
public readonly $grades = createStore<Grade[]>([])
|
|
40
|
+
public readonly $status = createStore<PmProgressStatus | null>(null)
|
|
41
|
+
|
|
42
|
+
constructor(private readonly api: PmProgressApi) {
|
|
43
|
+
if (isWeb) {
|
|
44
|
+
persist({ key: SessionStorageKeys.GRADE, store: this.$grade })
|
|
45
|
+
persist({ key: SessionStorageKeys.DOMAINS, store: this.$domains })
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
this.setupFailedAndLockedStatus()
|
|
49
|
+
this.setupTreeInit()
|
|
50
|
+
this.setupGradeInit()
|
|
51
|
+
this.setupDomainStructure()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public readonly initTreeFx = createEffect(async ({ user }: PmProgressGateProps) => {
|
|
55
|
+
if (!user.setting.practiceModeTreeId) {
|
|
56
|
+
throw new Error('practiceModeTreeId is not set')
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const [tree, stats] = await Promise.all([
|
|
60
|
+
this.api.getTreeFx(user.setting.practiceModeTreeId),
|
|
61
|
+
this.api.getStatisticsFx({ entityIds: [user._id] }),
|
|
62
|
+
])
|
|
63
|
+
return [TreeNormalizer.normalize(tree), stats] as const
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
public readonly getTreeContextFx = attach({
|
|
67
|
+
source: { tree: this.$tree, stats: this.$stats, user: this.$user, grade: this.$grade },
|
|
68
|
+
mapParams: (_: void, source): GetTreeContextFxParams => {
|
|
69
|
+
if (!isTreeDataReady(source)) {
|
|
70
|
+
throw new Error(
|
|
71
|
+
'Cannot create treeWithUserStats in getTreeWithStatsFx - tree data is not ready.',
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
return source as GetTreeContextFxParams
|
|
75
|
+
},
|
|
76
|
+
effect: createEffect(({ tree, stats, user, grade }: GetTreeContextFxParams): TreeContext => {
|
|
77
|
+
const [treeWithStats] = enhanceProgressMatrixData(
|
|
78
|
+
Object.values(tree.treeMapping),
|
|
79
|
+
stats,
|
|
80
|
+
[{ entityId: user._id, name: user.fullName }],
|
|
81
|
+
grade,
|
|
82
|
+
)
|
|
83
|
+
return {
|
|
84
|
+
tree,
|
|
85
|
+
stats,
|
|
86
|
+
user,
|
|
87
|
+
treeWithStats,
|
|
88
|
+
}
|
|
89
|
+
}),
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
private setupFailedAndLockedStatus() {
|
|
93
|
+
sample({
|
|
94
|
+
clock: this.initTreeFx.fail,
|
|
95
|
+
fn: () => PmProgressStatus.ERROR,
|
|
96
|
+
target: this.$status,
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
sample({
|
|
100
|
+
clock: this.$grades,
|
|
101
|
+
filter: (grades) => grades.length > 0 && grades.every((g) => g.isLocked),
|
|
102
|
+
fn: () => PmProgressStatus.LOCKED,
|
|
103
|
+
target: this.$status,
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private setupTreeInit() {
|
|
108
|
+
createAction(this.initTreeFx.done, {
|
|
109
|
+
target: {
|
|
110
|
+
$tree: this.$tree,
|
|
111
|
+
$stats: this.$stats,
|
|
112
|
+
$user: this.$user,
|
|
113
|
+
$grades: this.$grades,
|
|
114
|
+
$isInitialized: this.$isInitialized,
|
|
115
|
+
setupInitialGrade: this.setupInitialGrade,
|
|
116
|
+
},
|
|
117
|
+
fn: (target, { params: { user }, result: [tree, stats] }) => {
|
|
118
|
+
target.$tree(tree)
|
|
119
|
+
target.$stats(stats)
|
|
120
|
+
target.$user(user)
|
|
121
|
+
target.$grades(getTreeGrades(tree, user))
|
|
122
|
+
target.setupInitialGrade({ tree, user })
|
|
123
|
+
target.$isInitialized(true)
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private setupGradeInit() {
|
|
129
|
+
sample({
|
|
130
|
+
clock: this.setupInitialGrade,
|
|
131
|
+
source: this.$grade,
|
|
132
|
+
fn: (grade, { tree, user }) => {
|
|
133
|
+
const userLockedGrades = user.setting.practiceModeLockedGrades
|
|
134
|
+
|
|
135
|
+
const isPersistedGradeValid = isWeb && grade !== null && !userLockedGrades.includes(grade)
|
|
136
|
+
if (isPersistedGradeValid) return grade
|
|
137
|
+
|
|
138
|
+
const treeGrades = Object.values(tree.treeMapping)
|
|
139
|
+
.filter((node) => node.type === 'grade')
|
|
140
|
+
.map((node) => node.attributes.grade)
|
|
141
|
+
|
|
142
|
+
return getInitialPmGrade({
|
|
143
|
+
userGrade: user.grade,
|
|
144
|
+
treeGrades,
|
|
145
|
+
lockedGrades: userLockedGrades,
|
|
146
|
+
enrolledGrades: user.enrolledGrades,
|
|
147
|
+
})
|
|
148
|
+
},
|
|
149
|
+
target: this.setGrade,
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private setupDomainStructure() {
|
|
154
|
+
sample({
|
|
155
|
+
clock: [this.$grade, this.initTreeFx.doneData],
|
|
156
|
+
source: { tree: this.$tree, stats: this.$stats, user: this.$user, grade: this.$grade },
|
|
157
|
+
filter: isTreeDataReady,
|
|
158
|
+
fn: ({ tree, stats, user, grade }) => {
|
|
159
|
+
const [treeWithUserStats] = enhanceProgressMatrixData(
|
|
160
|
+
Object.values(tree.treeMapping),
|
|
161
|
+
stats,
|
|
162
|
+
[{ entityId: user._id, name: user.fullName }],
|
|
163
|
+
grade as number,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
return getDomainStructure(treeWithUserStats, tree.treeMapping)
|
|
167
|
+
},
|
|
168
|
+
target: this.setDomains,
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Skill, SkillsMapping, TreeMappingResponse } from './pmProgress.types'
|
|
2
|
+
|
|
3
|
+
type TreeMapping = TreeMappingResponse['treeMapping']
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Some skills from the API lack a valid ability (missing sectionId and functionName),
|
|
7
|
+
* making them impossible to open in the solving flow. This normalizer strips those skills
|
|
8
|
+
* and cascades the cleanup - removing standards, domains, etc. that end up empty.
|
|
9
|
+
*
|
|
10
|
+
* Acts as a single place to sanitize the tree API response before it enters the app.
|
|
11
|
+
* Can be extended with additional normalizations as new edge cases arise.
|
|
12
|
+
*/
|
|
13
|
+
export class TreeNormalizer {
|
|
14
|
+
static normalize(response: TreeMappingResponse): TreeMappingResponse {
|
|
15
|
+
const skillsMapping = this.getOnlyValidSkills(response.skillsMapping)
|
|
16
|
+
const validIds = new Set(Object.keys(skillsMapping))
|
|
17
|
+
const treeMapping = this.removeEmptyNodes(response.treeMapping, validIds)
|
|
18
|
+
return { ...response, skillsMapping, treeMapping }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static isSkillValid(skill: Skill) {
|
|
22
|
+
return Boolean(skill?.ability && (skill.ability.sectionId || skill.ability.functionName))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private static getOnlyValidSkills(mapping: SkillsMapping): SkillsMapping {
|
|
26
|
+
return Object.fromEntries(
|
|
27
|
+
Object.entries(mapping).filter(([, skill]) => this.isSkillValid(skill)),
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private static removeEmptyNodes(treeMapping: TreeMapping, validIds: Set<string>): TreeMapping {
|
|
32
|
+
const emptyIds = this.getEmptyNodeIds(treeMapping, validIds)
|
|
33
|
+
|
|
34
|
+
return Object.fromEntries(
|
|
35
|
+
Object.entries(treeMapping)
|
|
36
|
+
.filter(([id]) => !emptyIds.has(id))
|
|
37
|
+
.map(([id, node]) => [
|
|
38
|
+
id,
|
|
39
|
+
{
|
|
40
|
+
...node,
|
|
41
|
+
skills: node.skills.filter((sid) => validIds.has(sid)),
|
|
42
|
+
children: node.children.filter((cid) => !emptyIds.has(cid)),
|
|
43
|
+
},
|
|
44
|
+
]),
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private static getEmptyNodeIds(treeMapping: TreeMapping, validIds: Set<string>) {
|
|
49
|
+
const empty = new Set<string>()
|
|
50
|
+
|
|
51
|
+
const leafToRoot = Object.entries(treeMapping).sort(
|
|
52
|
+
([, a], [, b]) => b.parents.length - a.parents.length,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
for (const [id, node] of leafToRoot) {
|
|
56
|
+
const isEmptyLeaf = node.skills.length > 0 && node.skills.every((s) => !validIds.has(s))
|
|
57
|
+
const isEmptyParent = node.children.length > 0 && node.children.every((c) => empty.has(c))
|
|
58
|
+
|
|
59
|
+
if (isEmptyLeaf || isEmptyParent) empty.add(id)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return empty
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
2
|
+
import { Dimensions } from 'react-native'
|
|
3
|
+
|
|
4
|
+
export const STATS_MAX_HEIGHT = 136
|
|
5
|
+
export const RECOMMENDATIONS_LIMIT_PARAM = 150
|
|
6
|
+
export const MAX_PIE_CHART_SIZE = 505
|
|
7
|
+
|
|
8
|
+
export enum CustomDomain {
|
|
9
|
+
TEACHER = 'TEACHER',
|
|
10
|
+
FLUENCY = 'FLUENCY',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export enum InsightsTimeframe {
|
|
14
|
+
ALL = 'all',
|
|
15
|
+
WEEK = 'week',
|
|
16
|
+
LAST_WEEK = 'lastWeek',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum SolvingFlow {
|
|
20
|
+
TEACHER = 'TEACHER',
|
|
21
|
+
MAGMA = 'MAGMA',
|
|
22
|
+
STANDARD = 'STANDARD',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export enum OpeningLoaderId {
|
|
26
|
+
START_BUTTON = 'START_BUTTON',
|
|
27
|
+
PRACTICE_BUTTON = 'PRACTICE_BUTTON',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum PmProgressStatus {
|
|
31
|
+
LOCKED = 'LOCKED',
|
|
32
|
+
ERROR = 'ERROR',
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export enum SessionStorageKeys {
|
|
36
|
+
SOLVING_QUEUE = 'PM_SOLVING_QUEUE',
|
|
37
|
+
GRADE = 'PM_GRADE',
|
|
38
|
+
DOMAINS = 'PM_DOMAINS',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Primary → _4 → _6 variants, cycling through 7 base colors.
|
|
43
|
+
* Supports up to 21 unique colors before repeating.
|
|
44
|
+
*/
|
|
45
|
+
export const DOMAIN_COLORS = [
|
|
46
|
+
COLORS.PRIMARY_RED,
|
|
47
|
+
COLORS.PRIMARY_MAGENTA,
|
|
48
|
+
COLORS.PRIMARY_PURPLE,
|
|
49
|
+
COLORS.PRIMARY_INDIGO,
|
|
50
|
+
COLORS.PRIMARY_TURQUOISE,
|
|
51
|
+
COLORS.PRIMARY_GREEN,
|
|
52
|
+
COLORS.RED_4,
|
|
53
|
+
COLORS.MAGENTA_4,
|
|
54
|
+
COLORS.PURPLE_4,
|
|
55
|
+
COLORS.INDIGO_4,
|
|
56
|
+
COLORS.TURQUOISE_4,
|
|
57
|
+
COLORS.GREEN_4,
|
|
58
|
+
COLORS.RED_6,
|
|
59
|
+
COLORS.MAGENTA_6,
|
|
60
|
+
COLORS.PURPLE_6,
|
|
61
|
+
COLORS.INDIGO_6,
|
|
62
|
+
COLORS.TURQUOISE_6,
|
|
63
|
+
COLORS.GREEN_6,
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
export const EMPTY_PIE_CHART_DATA = Array.from({ length: 5 }, () => ({
|
|
67
|
+
value: 1,
|
|
68
|
+
fillPercent: 0,
|
|
69
|
+
fillColor: COLORS.NEUTRAL_4,
|
|
70
|
+
borderColor: COLORS.NEUTRAL_4,
|
|
71
|
+
backgroundColor: COLORS.NEUTRAL_3,
|
|
72
|
+
}))
|
|
73
|
+
|
|
74
|
+
export const DOMAIN_BORDER_COLORS = [
|
|
75
|
+
COLORS.RED_6,
|
|
76
|
+
COLORS.MAGENTA_6,
|
|
77
|
+
COLORS.PURPLE_6,
|
|
78
|
+
COLORS.INDIGO_6,
|
|
79
|
+
COLORS.TURQUOISE_6,
|
|
80
|
+
COLORS.GREEN_6,
|
|
81
|
+
COLORS.RED_6,
|
|
82
|
+
COLORS.MAGENTA_6,
|
|
83
|
+
COLORS.PURPLE_6,
|
|
84
|
+
COLORS.INDIGO_6,
|
|
85
|
+
COLORS.TURQUOISE_6,
|
|
86
|
+
COLORS.GREEN_6,
|
|
87
|
+
COLORS.RED_6,
|
|
88
|
+
COLORS.MAGENTA_6,
|
|
89
|
+
COLORS.PURPLE_6,
|
|
90
|
+
COLORS.INDIGO_6,
|
|
91
|
+
COLORS.TURQUOISE_6,
|
|
92
|
+
COLORS.GREEN_6,
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
export const BURGER_MENU_BREAKPOINT = 1024
|
|
96
|
+
export const SMALL_SCREEN_THRESHOLD = 568
|
|
97
|
+
export const SMALL_SCREEN_MENU_MAX_HEIGHT = 300
|
|
98
|
+
export const WINDOW_HEIGHT = Dimensions.get('window').height
|
|
99
|
+
export const MENU_MAX_HEIGHT =
|
|
100
|
+
WINDOW_HEIGHT <= SMALL_SCREEN_THRESHOLD ? SMALL_SCREEN_MENU_MAX_HEIGHT : WINDOW_HEIGHT * 0.8
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
2
|
+
import type { ProgressMatrixStatsDto } from '@matteappen/skills-utils/enhanceProgressData/types'
|
|
3
|
+
import {
|
|
4
|
+
Domain,
|
|
5
|
+
DomainStandard,
|
|
6
|
+
Grade,
|
|
7
|
+
Skill,
|
|
8
|
+
SkillsMapping,
|
|
9
|
+
StatsResponse,
|
|
10
|
+
TreeMappingResponse,
|
|
11
|
+
User,
|
|
12
|
+
} from './pmProgress.types'
|
|
13
|
+
import { CustomDomain, DOMAIN_BORDER_COLORS, DOMAIN_COLORS } from './pmProgress.constants'
|
|
14
|
+
import { dynamicCornerRadius, dynamicInnerRadius } from '../components/chart/chart.helpers'
|
|
15
|
+
import type { PieChartManagerConfig } from '../components/chart/chart.types'
|
|
16
|
+
import { getText } from '../../../shared/translation/helpers'
|
|
17
|
+
import type { GradeLabelsMap } from './pmProgress.types'
|
|
18
|
+
|
|
19
|
+
const groupStandardsByDomain = (
|
|
20
|
+
standardStats: ProgressMatrixStatsDto[number]['standardStats'],
|
|
21
|
+
treeMapping: TreeMappingResponse['treeMapping'],
|
|
22
|
+
) => {
|
|
23
|
+
const grouped = new Map<string, Domain['standards']>()
|
|
24
|
+
|
|
25
|
+
for (const [standardId, stat] of Object.entries(standardStats)) {
|
|
26
|
+
const { domainId, skillIds, skillsCount, scorePercentage, skillsToPractice } = stat
|
|
27
|
+
|
|
28
|
+
if (!grouped.has(domainId)) {
|
|
29
|
+
grouped.set(domainId, [])
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const completed =
|
|
33
|
+
!skillsToPractice ||
|
|
34
|
+
(skillsToPractice.failed.length === 0 && skillsToPractice.unattempted.length === 0)
|
|
35
|
+
const left = skillsToPractice
|
|
36
|
+
? skillsToPractice.failed.length + skillsToPractice.unattempted.length
|
|
37
|
+
: 0
|
|
38
|
+
|
|
39
|
+
grouped.get(domainId)!.push({
|
|
40
|
+
standardId,
|
|
41
|
+
title:
|
|
42
|
+
treeMapping[standardId].shortDescriptionTranslations ||
|
|
43
|
+
treeMapping[standardId].nameTranslations,
|
|
44
|
+
subtitle: treeMapping[standardId].originalId,
|
|
45
|
+
skillIds,
|
|
46
|
+
skillsToPractice,
|
|
47
|
+
skillsCount,
|
|
48
|
+
isCompleted: completed,
|
|
49
|
+
skillsLeft: left,
|
|
50
|
+
scorePercentage,
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return grouped
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const averageScorePercentage = (standards: Domain['standards']): number => {
|
|
58
|
+
if (standards.length === 0) return 0
|
|
59
|
+
const sum = standards.reduce((acc, s) => acc + s.scorePercentage, 0)
|
|
60
|
+
return Math.round((sum / standards.length) * 10) / 10
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const resolveDomainColors = (nonFluencyIndex: number) => {
|
|
64
|
+
if (nonFluencyIndex < 0) {
|
|
65
|
+
return { color: COLORS.PRIMARY_ORANGE, borderColor: COLORS.ORANGE_6 }
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
color: DOMAIN_COLORS[nonFluencyIndex] ?? DOMAIN_COLORS[DOMAIN_COLORS.length - 1],
|
|
69
|
+
borderColor:
|
|
70
|
+
DOMAIN_BORDER_COLORS[nonFluencyIndex] ??
|
|
71
|
+
DOMAIN_BORDER_COLORS[DOMAIN_BORDER_COLORS.length - 1],
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const getDomainStructure = (
|
|
76
|
+
data: ProgressMatrixStatsDto[number],
|
|
77
|
+
treeMapping: TreeMappingResponse['treeMapping'],
|
|
78
|
+
): Domain[] => {
|
|
79
|
+
const grouped = groupStandardsByDomain(data.standardStats, treeMapping)
|
|
80
|
+
|
|
81
|
+
const entries = Array.from(grouped.entries())
|
|
82
|
+
const nonFluencyDomainIds = entries
|
|
83
|
+
.map(([id]) => id)
|
|
84
|
+
.filter((id) => !isFluencyDomain(treeMapping[id].nameTranslations))
|
|
85
|
+
|
|
86
|
+
return entries.map(([domainId, standards]) => {
|
|
87
|
+
const title = treeMapping[domainId].nameTranslations
|
|
88
|
+
const nonFluencyIndex = nonFluencyDomainIds.indexOf(domainId)
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
domainId,
|
|
92
|
+
title,
|
|
93
|
+
...resolveDomainColors(nonFluencyIndex),
|
|
94
|
+
backgroundColor: COLORS.NEUTRAL_4,
|
|
95
|
+
standards,
|
|
96
|
+
scorePercentage: averageScorePercentage(standards),
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
type GetInitialPmGradeParams = {
|
|
102
|
+
treeGrades: number[]
|
|
103
|
+
lockedGrades: number[]
|
|
104
|
+
enrolledGrades: number[]
|
|
105
|
+
userGrade: number | null | undefined
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Resolves which grade a student should practice on.
|
|
110
|
+
*
|
|
111
|
+
* When userGrade is -1, null, or undefined (i.e. not explicitly set), we fall back
|
|
112
|
+
* to the student's enrolled grades and pick the lowest one that isn't locked.
|
|
113
|
+
* If userGrade is set but locked, we find the closest unlocked grade.
|
|
114
|
+
* All candidates are filtered against lockedGrades, so only unlocked grades are ever returned.
|
|
115
|
+
*
|
|
116
|
+
* Examples:
|
|
117
|
+
* locked=[1,2], enrolled=[2,5], grade=4 → 4 (unlocked, use as-is)
|
|
118
|
+
* locked=[1,2], enrolled=[2,5], grade=-1 → 5 (lowest unlocked enrolled)
|
|
119
|
+
* locked=[0,1,2,5], enrolled=[2,5], grade=-1 → 3 (no enrolled available, first unlocked)
|
|
120
|
+
* locked=[0,1], enrolled=[2,5], grade=-1 → 2 (lowest unlocked enrolled)
|
|
121
|
+
* locked=[0,1,2,3], enrolled=[3,9], grade=-1 → 9 (lowest unlocked enrolled)
|
|
122
|
+
* locked=[1,2,3], enrolled=[2,5], grade=2 → 4 (grade locked, closest below=none, above=4)
|
|
123
|
+
*/
|
|
124
|
+
export const getInitialPmGrade = ({
|
|
125
|
+
treeGrades,
|
|
126
|
+
lockedGrades,
|
|
127
|
+
enrolledGrades,
|
|
128
|
+
userGrade,
|
|
129
|
+
}: GetInitialPmGradeParams): number | null => {
|
|
130
|
+
const locked = new Set(lockedGrades)
|
|
131
|
+
const unlocked = treeGrades.filter((g) => !locked.has(g)).sort((a, b) => a - b)
|
|
132
|
+
|
|
133
|
+
if (unlocked.length === 0) {
|
|
134
|
+
return null
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const isUserGradeMissing = userGrade === null || userGrade === -1 || userGrade === undefined
|
|
138
|
+
if (isUserGradeMissing) {
|
|
139
|
+
const unlockedEnrolled = enrolledGrades.filter((g) => unlocked.includes(g))
|
|
140
|
+
return unlockedEnrolled.length > 0 ? Math.min(...unlockedEnrolled) : unlocked[0]
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (unlocked.includes(userGrade)) return userGrade
|
|
144
|
+
|
|
145
|
+
const nearestBelow = [...unlocked].reverse().find((grade) => grade < userGrade)
|
|
146
|
+
const nearestAbove = unlocked.find((grade) => grade > userGrade)
|
|
147
|
+
return nearestBelow ?? nearestAbove ?? unlocked[0] ?? 0
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const formatTime = (ms: number): string => {
|
|
151
|
+
const totalMinutes = Math.floor(ms / 60_000)
|
|
152
|
+
if (totalMinutes < 60) return `${totalMinutes}m`
|
|
153
|
+
const hours = Math.round(totalMinutes / 60)
|
|
154
|
+
return `${hours}h`
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
type TreeDataSource = {
|
|
158
|
+
tree: TreeMappingResponse | null
|
|
159
|
+
stats: StatsResponse | null
|
|
160
|
+
user: User | null
|
|
161
|
+
grade: number | null
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
type TreeDataReady = {
|
|
165
|
+
tree: TreeMappingResponse
|
|
166
|
+
stats: StatsResponse
|
|
167
|
+
user: User
|
|
168
|
+
grade: number
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export const isTreeDataReady = (source: TreeDataSource): source is TreeDataReady =>
|
|
172
|
+
source.tree !== null && source.stats !== null && source.user !== null && source.grade !== null
|
|
173
|
+
|
|
174
|
+
export const createChartConfig = (size: number): PieChartManagerConfig => {
|
|
175
|
+
const OUTER_MARGIN = 5
|
|
176
|
+
return {
|
|
177
|
+
size,
|
|
178
|
+
outerRadius: size / 2 - OUTER_MARGIN,
|
|
179
|
+
innerRadius: dynamicInnerRadius,
|
|
180
|
+
cornerRadius: dynamicCornerRadius,
|
|
181
|
+
gapBetweenSlices: 8,
|
|
182
|
+
pressOffset: 4,
|
|
183
|
+
borderWidth: 4,
|
|
184
|
+
colors: {
|
|
185
|
+
background: COLORS.NEUTRAL_1,
|
|
186
|
+
highlightedBackground: COLORS.NEUTRAL_6,
|
|
187
|
+
},
|
|
188
|
+
outerArc: {
|
|
189
|
+
color: '#FFFFFF40',
|
|
190
|
+
strokeWidth: 11.75,
|
|
191
|
+
dashWidth: 22,
|
|
192
|
+
},
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Returns all skills from a standard, sorted by difficulty.
|
|
198
|
+
* Used when the standard is fully completed to allow revisiting.
|
|
199
|
+
*/
|
|
200
|
+
export const getAllSkillsFromStandard = (
|
|
201
|
+
standard: DomainStandard,
|
|
202
|
+
skillsMapping: SkillsMapping,
|
|
203
|
+
): Skill[] =>
|
|
204
|
+
standard.skillIds
|
|
205
|
+
.map((id) => skillsMapping[id])
|
|
206
|
+
.filter(Boolean)
|
|
207
|
+
.sort((a, b) => skillsMapping[a._id]?.difficulty - skillsMapping[b._id]?.difficulty)
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Returns uncompleted skills from a single standard.
|
|
211
|
+
* Failed skills come first, then unattempted.
|
|
212
|
+
*/
|
|
213
|
+
export const getUncompletedSkillsFromStandard = (
|
|
214
|
+
standard: DomainStandard,
|
|
215
|
+
skillsMapping: SkillsMapping,
|
|
216
|
+
): Skill[] => {
|
|
217
|
+
if (!standard.skillsToPractice) return []
|
|
218
|
+
|
|
219
|
+
return [...standard.skillsToPractice.failed, ...standard.skillsToPractice.unattempted]
|
|
220
|
+
.map(({ skillId }) => skillsMapping[skillId])
|
|
221
|
+
.filter(Boolean)
|
|
222
|
+
.sort((a, b) => skillsMapping[a._id]?.difficulty - skillsMapping[b._id]?.difficulty)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Returns uncompleted skills from a domain, scanning standards from the beginning.
|
|
227
|
+
* Optionally excludes a standard (used when student selected a specific one).
|
|
228
|
+
*/
|
|
229
|
+
export const getUncompletedSkillsFromDomain = (
|
|
230
|
+
domain: Domain,
|
|
231
|
+
skillsMapping: SkillsMapping,
|
|
232
|
+
excludeStandardId?: string,
|
|
233
|
+
): Skill[] =>
|
|
234
|
+
domain.standards
|
|
235
|
+
.filter((s) => !s.isCompleted && s.standardId !== excludeStandardId)
|
|
236
|
+
.flatMap((s) => getUncompletedSkillsFromStandard(s, skillsMapping))
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Returns all uncompleted skills across all domains in list order.
|
|
240
|
+
* Used as a fallback when recommendation arrays are empty.
|
|
241
|
+
*/
|
|
242
|
+
export const getAllUncompletedSkills = (domains: Domain[], skillsMapping: SkillsMapping): Skill[] =>
|
|
243
|
+
domains
|
|
244
|
+
.filter((d) => d.standards.some((s) => !s.isCompleted))
|
|
245
|
+
.flatMap((d) => getUncompletedSkillsFromDomain(d, skillsMapping))
|
|
246
|
+
|
|
247
|
+
/** Moves item with the given id to the front: [0,1,2,3,4] with id of 3rd → [3,0,1,2,4] */
|
|
248
|
+
export const shiftToBeginningOfArray = (id: string, items: Skill[]): Skill[] => {
|
|
249
|
+
const index = items.findIndex((item) => item._id === id)
|
|
250
|
+
if (index <= 0) return items
|
|
251
|
+
return [items[index], ...items.slice(0, index), ...items.slice(index + 1)]
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export const withoutDuplicates = (skills: (Skill | undefined)[]): Skill[] => {
|
|
255
|
+
const seen = new Set<string>()
|
|
256
|
+
return skills.filter((skill): skill is Skill => {
|
|
257
|
+
if (!skill) return false
|
|
258
|
+
if (seen.has(skill._id)) return false
|
|
259
|
+
seen.add(skill._id)
|
|
260
|
+
return true
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Reorders grades starting from the given grade, wrapping around. [1,2,3] with start=2 → [2,3,1]
|
|
265
|
+
export const startGradesFrom = (grades: Grade[], startGrade: number): Grade[] => {
|
|
266
|
+
const index = grades.findIndex(({ value }) => value === startGrade)
|
|
267
|
+
if (index <= 0) return grades
|
|
268
|
+
return [...grades.slice(index), ...grades.slice(0, index)]
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export const isFluencyDomain = (title: string) => {
|
|
272
|
+
return title.toLowerCase() === CustomDomain.FLUENCY.toLowerCase()
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export const formatGradeName = (grade: number): string => {
|
|
276
|
+
if (grade === -1) return getText('pmProgress.gradeOther')
|
|
277
|
+
if (grade === 0) return `${getText('pmProgress.grade')} ${getText('pmProgress.gradeK')}`
|
|
278
|
+
return `${getText('pmProgress.grade')} ${grade}`
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export const formatGradeLabel = (grade: number, customLabelsMap?: GradeLabelsMap): string => {
|
|
282
|
+
if (!customLabelsMap) return formatGradeName(grade)
|
|
283
|
+
|
|
284
|
+
const label = customLabelsMap[String(grade)]
|
|
285
|
+
|
|
286
|
+
if (!label) return formatGradeName(grade)
|
|
287
|
+
if (label.noPrefix) return label.name
|
|
288
|
+
return `${getText('pmProgress.grade')} ${label.name}`
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export const getTreeGrades = (tree: TreeMappingResponse, user: User): Grade[] => {
|
|
292
|
+
const lockedGrades = new Set(user.setting.practiceModeLockedGrades)
|
|
293
|
+
|
|
294
|
+
const gradeNodes = Object.values(tree.treeMapping).filter(
|
|
295
|
+
(node) => node?.type === 'grade' && node.attributes.grade !== null,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
const uniqueSortedGrades = [...new Set(gradeNodes.map((node) => node.attributes.grade))].sort(
|
|
299
|
+
(a, b) => a - b,
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
return uniqueSortedGrades.map((grade) => ({
|
|
303
|
+
name: formatGradeName(grade),
|
|
304
|
+
value: grade,
|
|
305
|
+
isLocked: lockedGrades.has(grade),
|
|
306
|
+
}))
|
|
307
|
+
}
|