@cuemath/leap 3.5.69 → 3.5.70
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/features/math-fit/math-fit-overview/math-fit-overview-types.js +4 -4
- package/dist/features/math-fit/math-fit-overview/math-fit-overview-types.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js +43 -31
- package/dist/features/math-fit/math-fit-report/comps/report-header/report-header.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge-helpers.js +9 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge-helpers.js.map +1 -0
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge.js +23 -21
- package/dist/features/math-fit/math-fit-report/comps/score-badge/score-badge.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js +58 -54
- package/dist/features/math-fit/math-fit-report/comps/score-section/score-section.js.map +1 -1
- package/dist/features/math-fit/math-fit-report/math-fit-report.js +45 -31
- package/dist/features/math-fit/math-fit-report/math-fit-report.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/mathfit/mathfit.js +28 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/mathfit/mathfit.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-types.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js +52 -49
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var T = /* @__PURE__ */ ((E) => (E.COMPLETED = "COMPLETED", E.ACTIVE = "ACTIVE", E.LOCKED = "LOCKED", E))(T || {}), C = /* @__PURE__ */ ((E) => (E.CORRECT = "CORRECT", E.INCORRECT = "INCORRECT", E.SKIPPED = "SKIPPED", E.UNATTEMPTED = "UNATTEMPTED", E))(C || {}), R = /* @__PURE__ */ ((E) => (E.IN_PROGRESS = "IN_PROGRESS", E.COMPLETED = "COMPLETED", E.NOT_STARTED = "NOT_STARTED", E.EXPIRED = "EXPIRED", E))(R || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
R as EMathFitTestState,
|
|
4
|
+
C as EQuestionState,
|
|
5
|
+
T as ESectionStatus
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=math-fit-overview-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math-fit-overview-types.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview-types.ts"],"sourcesContent":["import type { INodeDataProps } from '../../chapters-v2/comps/node-card/node-card-types';\nimport { type TUserTypes } from '../../ui/types';\n\nexport enum ESectionStatus {\n COMPLETED = 'COMPLETED',\n ACTIVE = 'ACTIVE',\n LOCKED = 'LOCKED',\n}\n\nexport enum EQuestionState {\n CORRECT = 'CORRECT',\n INCORRECT = 'INCORRECT',\n SKIPPED = 'SKIPPED',\n}\n\nexport enum EMathFitTestState {\n IN_PROGRESS = 'IN_PROGRESS',\n COMPLETED = 'COMPLETED',\n NOT_STARTED = 'NOT_STARTED',\n EXPIRED = 'EXPIRED',\n}\n\nexport interface ISectionData {\n id: string;\n title: string;\n status: ESectionStatus;\n questionsCount: number;\n timeInMinutes: number;\n sheetData: INodeDataProps;\n}\n\nexport interface IQuestionDetail {\n item_reference: string;\n state: EQuestionState;\n order: number;\n}\n\nexport interface IMiniGoalDetail {\n order: number;\n description: string;\n items: IQuestionDetail[];\n}\n\nexport interface IMathFitSection {\n id: string;\n section_number: number;\n score: number;\n previous_score: number;\n user_node_id: string;\n created_on: string;\n created_on_ts: number;\n updated_on: string;\n updated_on_ts: number;\n sheet: INodeDataProps;\n summary: {\n [goalId: string]: IMiniGoalDetail;\n };\n}\n\nexport interface IMathFitAssessmentResponse {\n id: string;\n user_id: string;\n state: EMathFitTestState;\n score: number;\n previous_score: number;\n created_on: string;\n created_on_ts: number;\n updated_on: string;\n updated_on_ts: number;\n sections: IMathFitSection[];\n}\n\nexport interface IMathFitOverviewProps {\n data: IMathFitAssessmentResponse;\n onResume: (sheetData: INodeDataProps, sectionId: string) => void;\n onDoLater: () => void;\n}\n\nexport interface IMathFitProps {\n mathfitTestId: string;\n userId: string;\n onResume: (sheetData: INodeDataProps, sectionId: string) => void;\n onReview: (sheetData: INodeDataProps, sectionId: string) => void;\n onDoLater: () => void;\n studentName: string;\n userType: TUserTypes;\n onAPIComplete?: (success: boolean) => void;\n}\n\nexport type TTimeUnit = 'minutes' | 'hours' | 'days';\n\nexport interface ITimeLeft {\n value: number;\n unit: TTimeUnit;\n}\n"],"names":["ESectionStatus","EQuestionState","EMathFitTestState"],"mappings":"AAGY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,SAAS,UACTA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,YAAY,aACZA,EAAA,UAAU,
|
|
1
|
+
{"version":3,"file":"math-fit-overview-types.js","sources":["../../../../src/features/math-fit/math-fit-overview/math-fit-overview-types.ts"],"sourcesContent":["import type { INodeDataProps } from '../../chapters-v2/comps/node-card/node-card-types';\nimport { type TUserTypes } from '../../ui/types';\n\nexport enum ESectionStatus {\n COMPLETED = 'COMPLETED',\n ACTIVE = 'ACTIVE',\n LOCKED = 'LOCKED',\n}\n\nexport enum EQuestionState {\n CORRECT = 'CORRECT',\n INCORRECT = 'INCORRECT',\n SKIPPED = 'SKIPPED',\n UNATTEMPTED = 'UNATTEMPTED',\n}\n\nexport enum EMathFitTestState {\n IN_PROGRESS = 'IN_PROGRESS',\n COMPLETED = 'COMPLETED',\n NOT_STARTED = 'NOT_STARTED',\n EXPIRED = 'EXPIRED',\n}\n\nexport interface ISectionData {\n id: string;\n title: string;\n status: ESectionStatus;\n questionsCount: number;\n timeInMinutes: number;\n sheetData: INodeDataProps;\n}\n\nexport interface IQuestionDetail {\n item_reference: string;\n state: EQuestionState;\n order: number;\n}\n\nexport interface IMiniGoalDetail {\n order: number;\n description: string;\n items: IQuestionDetail[];\n}\n\nexport interface IMathFitSection {\n id: string;\n section_number: number;\n score: number;\n previous_score: number;\n user_node_id: string;\n created_on: string;\n created_on_ts: number;\n updated_on: string;\n updated_on_ts: number;\n sheet: INodeDataProps;\n summary: {\n [goalId: string]: IMiniGoalDetail;\n };\n}\n\nexport interface IMathFitAssessmentResponse {\n id: string;\n user_id: string;\n state: EMathFitTestState;\n score: number;\n previous_score: number;\n created_on: string;\n created_on_ts: number;\n updated_on: string;\n updated_on_ts: number;\n sections: IMathFitSection[];\n}\n\nexport interface IMathFitOverviewProps {\n data: IMathFitAssessmentResponse;\n onResume: (sheetData: INodeDataProps, sectionId: string) => void;\n onDoLater: () => void;\n}\n\nexport interface IMathFitProps {\n mathfitTestId: string;\n userId: string;\n onResume: (sheetData: INodeDataProps, sectionId: string) => void;\n onReview: (sheetData: INodeDataProps, sectionId: string) => void;\n onDoLater: () => void;\n studentName: string;\n userType: TUserTypes;\n onAPIComplete?: (success: boolean) => void;\n}\n\nexport type TTimeUnit = 'minutes' | 'hours' | 'days';\n\nexport interface ITimeLeft {\n value: number;\n unit: TTimeUnit;\n}\n"],"names":["ESectionStatus","EQuestionState","EMathFitTestState"],"mappings":"AAGY,IAAAA,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,SAAS,UACTA,EAAA,SAAS,UAHCA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,YAAY,aACZA,EAAA,UAAU,WACVA,EAAA,cAAc,eAJJA,IAAAA,KAAA,CAAA,CAAA,GAOAC,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,YAAY,aACZA,EAAA,cAAc,eACdA,EAAA,UAAU,WAJAA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,58 +1,70 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as p } from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { formatTestDate as B } from "../../math-fit-report-helpers.js";
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as p, useMemo as h } from "react";
|
|
3
|
+
import n from "../../../../ui/text/text.js";
|
|
4
|
+
import g from "../score-badge/score-badge.js";
|
|
5
|
+
import { IS_APP_RUNNING_IN_RN as o } from "../../../../../constants/app-config.js";
|
|
6
|
+
import B from "../../../../ui/separator/separator.js";
|
|
7
|
+
import { formatTestDate as $ } from "../../math-fit-report-helpers.js";
|
|
9
8
|
import _ from "../../../../../assets/line-icons/icons/back2.js";
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
import x from "../../../../ui/buttons/icon-button/icon-button.js";
|
|
10
|
+
import { HeaderContainer as A, BackButtonContainer as C, BackButtonWrapper as I } from "./report-header-styled.js";
|
|
11
|
+
const P = p(function({
|
|
12
|
+
createdOnTs: a,
|
|
13
|
+
maxScore: i,
|
|
14
|
+
score: d,
|
|
15
|
+
scoreChange: s,
|
|
16
|
+
studentName: c,
|
|
17
|
+
userType: l,
|
|
18
|
+
onBack: m,
|
|
19
|
+
compactView: e = !1,
|
|
20
|
+
showGreeting: f = !0
|
|
19
21
|
}) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
const u = h(() => e ? 5 : o ? 9.6 : 11.75, [e]);
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
A,
|
|
22
25
|
{
|
|
23
26
|
$background: "BLUE_4",
|
|
24
|
-
$heightX:
|
|
27
|
+
$heightX: u,
|
|
25
28
|
$gapX: 1.5,
|
|
26
29
|
$gutterX: 1.5,
|
|
27
|
-
$justifyContent: "flex-end",
|
|
30
|
+
$justifyContent: e ? "center" : "flex-end",
|
|
28
31
|
$position: "relative",
|
|
29
32
|
children: [
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
l === "TEACHER" && /* @__PURE__ */ r(C, { $height: "100%", children: /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(
|
|
34
|
+
x,
|
|
32
35
|
{
|
|
33
36
|
Icon: _,
|
|
34
37
|
renderAs: "secondary-gray",
|
|
35
38
|
analyticsLabel: "chapter_page_exit",
|
|
36
39
|
size: "xsmall",
|
|
37
|
-
onClick:
|
|
40
|
+
onClick: m
|
|
38
41
|
}
|
|
39
42
|
) }) }),
|
|
40
|
-
/* @__PURE__ */
|
|
43
|
+
f && /* @__PURE__ */ t(n, { $renderAs: "ab1-bold", $color: "BLACK_1", children: [
|
|
41
44
|
"Well done, ",
|
|
42
|
-
|
|
45
|
+
c || "",
|
|
43
46
|
"!"
|
|
44
47
|
] }),
|
|
45
|
-
/* @__PURE__ */ r(
|
|
46
|
-
/* @__PURE__ */ r(
|
|
47
|
-
|
|
48
|
+
/* @__PURE__ */ r(B, { heightX: 0.5 }),
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
|
+
g,
|
|
51
|
+
{
|
|
52
|
+
score: d,
|
|
53
|
+
maxScore: i,
|
|
54
|
+
scoreChange: s,
|
|
55
|
+
renderInHeader: !0,
|
|
56
|
+
renderInMobile: !!(o || e)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ t(n, { $renderAs: o || e ? "ac5" : "ac4", $color: "BLACK_T_60", children: [
|
|
48
60
|
"TEST Score • ",
|
|
49
|
-
|
|
61
|
+
$(a)
|
|
50
62
|
] })
|
|
51
63
|
]
|
|
52
64
|
}
|
|
53
65
|
);
|
|
54
66
|
});
|
|
55
67
|
export {
|
|
56
|
-
|
|
68
|
+
P as default
|
|
57
69
|
};
|
|
58
70
|
//# sourceMappingURL=report-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-header.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/report-header/report-header.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IReportHeaderProps } from './report-header-types';\nimport
|
|
1
|
+
{"version":3,"file":"report-header.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/report-header/report-header.tsx"],"sourcesContent":["import { memo, useMemo, type FC } from 'react';\n\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IReportHeaderProps } from './report-header-types';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../../constants/app-config';\nimport Separator from '../../../../ui/separator/separator';\nimport { formatTestDate } from '../../math-fit-report-helpers';\nimport Back2Icon from '../../../../../assets/line-icons/icons/back2';\nimport IconButton from '../../../../ui/buttons/icon-button/icon-button';\nimport * as Styled from './report-header-styled';\n\nconst ReportHeader: FC<IReportHeaderProps> = memo(function ReportHeader({\n createdOnTs,\n maxScore,\n score,\n scoreChange,\n studentName,\n userType,\n onBack,\n compactView = false,\n showGreeting = true,\n}) {\n const headerHeight = useMemo(() => {\n if (compactView) {\n return 5;\n }\n\n if (IS_APP_RUNNING_IN_RN) {\n return 9.6;\n }\n\n return 11.75;\n }, [compactView]);\n\n const justifyContent = compactView ? 'center' : 'flex-end';\n const dateTextVariant = IS_APP_RUNNING_IN_RN || compactView ? 'ac5' : 'ac4';\n const renderScoreBadgeAsMobile = !!(IS_APP_RUNNING_IN_RN || compactView);\n\n return (\n <Styled.HeaderContainer\n $background=\"BLUE_4\"\n $heightX={headerHeight}\n $gapX={1.5}\n $gutterX={1.5}\n $justifyContent={justifyContent}\n $position=\"relative\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onBack}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n {showGreeting && (\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Well done, {studentName || ''}!\n </Text>\n )}\n <Separator heightX={0.5} />\n <ScoreBadge\n score={score}\n maxScore={maxScore}\n scoreChange={scoreChange}\n renderInHeader\n renderInMobile={renderScoreBadgeAsMobile}\n />\n <Text $renderAs={dateTextVariant} $color=\"BLACK_T_60\">\n TEST Score • {formatTestDate(createdOnTs)}\n </Text>\n </Styled.HeaderContainer>\n );\n});\n\nexport default ReportHeader;\n"],"names":["ReportHeader","memo","createdOnTs","maxScore","score","scoreChange","studentName","userType","onBack","compactView","showGreeting","headerHeight","useMemo","IS_APP_RUNNING_IN_RN","jsxs","Styled.HeaderContainer","jsx","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Text","Separator","ScoreBadge","formatTestDate"],"mappings":";;;;;;;;;;AAYM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,cAAAC,IAAe;AACjB,GAAG;AACK,QAAAC,IAAeC,EAAQ,MACvBH,IACK,IAGLI,IACK,MAGF,OACN,CAACJ,CAAW,CAAC;AAOd,SAAA,gBAAAK;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAY;AAAA,MACZ,UAAUJ;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,iBAVmBF,IAAc,WAAW;AAAA,MAW5C,WAAU;AAAA,MAET,UAAA;AAAA,QAAaF,MAAA,aACX,gBAAAS,EAAAC,GAAA,EAA2B,SAAQ,QAClC,UAAA,gBAAAD,EAACE,GAAA,EACC,UAAA,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,MAAMC;AAAA,YACN,UAAS;AAAA,YACT,gBAAe;AAAA,YACf,MAAK;AAAA,YACL,SAASZ;AAAA,UAAA;AAAA,WAEb,EACF,CAAA;AAAA,QAEDE,KACE,gBAAAI,EAAAO,GAAA,EAAK,WAAU,YAAW,QAAO,WAAU,UAAA;AAAA,UAAA;AAAA,UAC9Bf,KAAe;AAAA,UAAG;AAAA,QAAA,GAChC;AAAA,QAEF,gBAAAU,EAACM,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,QACzB,gBAAAN;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,OAAAnB;AAAA,YACA,UAAAD;AAAA,YACA,aAAAE;AAAA,YACA,gBAAc;AAAA,YACd,gBAnC2B,CAAC,EAAEQ,KAAwBJ;AAAA,UAmCtC;AAAA,QAClB;AAAA,QACC,gBAAAK,EAAAO,GAAA,EAAK,WAtCcR,KAAwBJ,IAAc,QAAQ,OAsChC,QAAO,cAAa,UAAA;AAAA,UAAA;AAAA,UACtCe,EAAetB,CAAW;AAAA,QAAA,GAC1C;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const e = (r, t) => r ? t ? "ah3-bold" : "ah2-bold" : "ac2", o = (r, t) => r ? t ? "ab1-bold" : "ah4-bold" : "ac4", n = (r, t) => r && !t ? 5 : 2, a = (r, t) => r ? t ? 3 : -7 : 9, c = (r, t) => r ? t ? 7 : 10 : 2;
|
|
2
|
+
export {
|
|
3
|
+
a as getArrowMarginBottom,
|
|
4
|
+
n as getMaxScoreMarginBottom,
|
|
5
|
+
o as getMaxScoreTextSize,
|
|
6
|
+
c as getScoreChangeMarginBottom,
|
|
7
|
+
e as getScoreTextSize
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=score-badge-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score-badge-helpers.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-badge/score-badge-helpers.ts"],"sourcesContent":["import type { TTextVariants } from '../../../../ui/types';\n\nexport const getScoreTextSize = (\n renderInHeader: boolean,\n renderInMobile: boolean,\n): TTextVariants => {\n if (renderInHeader) {\n return renderInMobile ? 'ah3-bold' : 'ah2-bold';\n }\n\n return 'ac2';\n};\n\nexport const getMaxScoreTextSize = (\n renderInHeader: boolean,\n renderInMobile: boolean,\n): TTextVariants => {\n if (renderInHeader) {\n return renderInMobile ? 'ab1-bold' : 'ah4-bold';\n }\n\n return 'ac4';\n};\n\nexport const getMaxScoreMarginBottom = (\n renderInHeader: boolean,\n renderInMobile: boolean,\n): number => {\n if (renderInHeader && !renderInMobile) {\n return 5;\n }\n\n return 2;\n};\n\nexport const getArrowMarginBottom = (renderInHeader: boolean, renderInMobile: boolean): number => {\n if (!renderInHeader) {\n return 9;\n }\n\n return renderInMobile ? 3 : -7;\n};\n\nexport const getScoreChangeMarginBottom = (\n renderInHeader: boolean,\n renderInMobile: boolean,\n): number => {\n if (!renderInHeader) {\n return 2;\n }\n\n return renderInMobile ? 7 : 10;\n};\n"],"names":["getScoreTextSize","renderInHeader","renderInMobile","getMaxScoreTextSize","getMaxScoreMarginBottom","getArrowMarginBottom","getScoreChangeMarginBottom"],"mappings":"AAEa,MAAAA,IAAmB,CAC9BC,GACAC,MAEID,IACKC,IAAiB,aAAa,aAGhC,OAGIC,IAAsB,CACjCF,GACAC,MAEID,IACKC,IAAiB,aAAa,aAGhC,OAGIE,IAA0B,CACrCH,GACAC,MAEID,KAAkB,CAACC,IACd,IAGF,GAGIG,IAAuB,CAACJ,GAAyBC,MACvDD,IAIEC,IAAiB,IAAI,KAHnB,GAMEI,IAA6B,CACxCL,GACAC,MAEKD,IAIEC,IAAiB,IAAI,KAHnB;"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as e, jsx as o, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import { memo as h } from "react";
|
|
3
|
+
import m from "../../../../ui/layout/flex-view.js";
|
|
4
|
+
import p from "../../../../ui/separator/separator.js";
|
|
5
|
+
import a from "../../../../ui/text/text.js";
|
|
6
|
+
import { getScoreTextSize as d, getMaxScoreMarginBottom as A, getMaxScoreTextSize as w, getArrowMarginBottom as M, getScoreChangeMarginBottom as T } from "./score-badge-helpers.js";
|
|
7
|
+
import { ArrowIcon as z } from "./score-badge-styled.js";
|
|
8
|
+
const K = h(function({
|
|
9
|
+
score: c,
|
|
10
|
+
maxScore: g = 10,
|
|
11
|
+
scoreChange: r,
|
|
12
|
+
renderInHeader: t = !1,
|
|
13
|
+
renderInMobile: i = !1
|
|
12
14
|
}) {
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */ m
|
|
15
|
-
/* @__PURE__ */ o(
|
|
16
|
-
!!
|
|
15
|
+
const n = r !== void 0 && r !== 0, s = n && r > 0, x = d(t, i), l = A(t, i), f = w(t, i), S = M(t, i), $ = T(t, i);
|
|
16
|
+
return /* @__PURE__ */ e(m, { $flexDirection: "row", $alignItems: "flex-end", children: [
|
|
17
|
+
/* @__PURE__ */ o(a, { $renderAs: x, $color: "BLACK_1", children: c ? c.toFixed(1) : "-" }),
|
|
18
|
+
!!c && /* @__PURE__ */ o(m, { $marginBottom: l, children: /* @__PURE__ */ e(a, { $renderAs: f, $color: "BLACK_1", children: [
|
|
17
19
|
"/",
|
|
18
|
-
|
|
20
|
+
g
|
|
19
21
|
] }) }),
|
|
20
|
-
/* @__PURE__ */ o(
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */ o(
|
|
23
|
-
/* @__PURE__ */ o(
|
|
22
|
+
/* @__PURE__ */ o(p, { width: 8 }),
|
|
23
|
+
n && /* @__PURE__ */ e(B, { children: [
|
|
24
|
+
/* @__PURE__ */ o(m, { $marginBottom: S, $alignSelf: "center", children: /* @__PURE__ */ o(z, { $isPositive: s, $renderInHeader: t }) }),
|
|
25
|
+
/* @__PURE__ */ o(m, { $marginBottom: $, children: /* @__PURE__ */ o(a, { $renderAs: "ac4", $color: s ? "GREEN_6" : "RED", children: Math.abs(r).toFixed(1) }) })
|
|
24
26
|
] })
|
|
25
27
|
] });
|
|
26
28
|
});
|
|
27
29
|
export {
|
|
28
|
-
|
|
30
|
+
K as default
|
|
29
31
|
};
|
|
30
32
|
//# sourceMappingURL=score-badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score-badge.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-badge/score-badge.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport
|
|
1
|
+
{"version":3,"file":"score-badge.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-badge/score-badge.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport type { IScoreBadgeProps } from './score-badge-types';\nimport Text from '../../../../ui/text/text';\nimport {\n getArrowMarginBottom,\n getMaxScoreMarginBottom,\n getMaxScoreTextSize,\n getScoreChangeMarginBottom,\n getScoreTextSize,\n} from './score-badge-helpers';\nimport * as Styled from './score-badge-styled';\n\nconst ScoreBadge: FC<IScoreBadgeProps> = memo(function ScoreBadge({\n score,\n maxScore = 10,\n scoreChange,\n renderInHeader = false,\n renderInMobile = false,\n}) {\n const hasChange = scoreChange !== undefined && scoreChange !== 0;\n const isPositive = hasChange && scoreChange > 0;\n const scoreTextSize = getScoreTextSize(renderInHeader, renderInMobile);\n const maxScoreMarginBottom = getMaxScoreMarginBottom(renderInHeader, renderInMobile);\n const maxScoreTextSize = getMaxScoreTextSize(renderInHeader, renderInMobile);\n const arrowMarginBottom = getArrowMarginBottom(renderInHeader, renderInMobile);\n const scoreChangeMarginBottom = getScoreChangeMarginBottom(renderInHeader, renderInMobile);\n\n return (\n <FlexView $flexDirection=\"row\" $alignItems=\"flex-end\">\n <Text $renderAs={scoreTextSize} $color=\"BLACK_1\">\n {score ? score.toFixed(1) : '-'}\n </Text>\n {!!score && (\n <FlexView $marginBottom={maxScoreMarginBottom}>\n <Text $renderAs={maxScoreTextSize} $color=\"BLACK_1\">\n /{maxScore}\n </Text>\n </FlexView>\n )}\n <Separator width={8} />\n {hasChange && (\n <>\n <FlexView $marginBottom={arrowMarginBottom} $alignSelf=\"center\">\n <Styled.ArrowIcon $isPositive={isPositive} $renderInHeader={renderInHeader} />\n </FlexView>\n <FlexView $marginBottom={scoreChangeMarginBottom}>\n <Text $renderAs=\"ac4\" $color={isPositive ? 'GREEN_6' : 'RED'}>\n {Math.abs(scoreChange).toFixed(1)}\n </Text>\n </FlexView>\n </>\n )}\n </FlexView>\n );\n});\n\nexport default ScoreBadge;\n"],"names":["ScoreBadge","memo","score","maxScore","scoreChange","renderInHeader","renderInMobile","hasChange","isPositive","scoreTextSize","getScoreTextSize","maxScoreMarginBottom","getMaxScoreMarginBottom","maxScoreTextSize","getMaxScoreTextSize","arrowMarginBottom","getArrowMarginBottom","scoreChangeMarginBottom","getScoreChangeMarginBottom","jsxs","FlexView","jsx","Text","Separator","Fragment","Styled.ArrowIcon"],"mappings":";;;;;;;AAeM,MAAAA,IAAmCC,EAAK,SAAoB;AAAA,EAChE,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,aAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,gBAAAC,IAAiB;AACnB,GAAG;AACK,QAAAC,IAAYH,MAAgB,UAAaA,MAAgB,GACzDI,IAAaD,KAAaH,IAAc,GACxCK,IAAgBC,EAAiBL,GAAgBC,CAAc,GAC/DK,IAAuBC,EAAwBP,GAAgBC,CAAc,GAC7EO,IAAmBC,EAAoBT,GAAgBC,CAAc,GACrES,IAAoBC,EAAqBX,GAAgBC,CAAc,GACvEW,IAA0BC,EAA2Bb,GAAgBC,CAAc;AAEzF,SACG,gBAAAa,EAAAC,GAAA,EAAS,gBAAe,OAAM,aAAY,YACzC,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAK,WAAWb,GAAe,QAAO,WACpC,cAAQP,EAAM,QAAQ,CAAC,IAAI,IAC9B,CAAA;AAAA,IACC,CAAC,CAACA,KACD,gBAAAmB,EAACD,GAAS,EAAA,eAAeT,GACvB,UAAA,gBAAAQ,EAACG,GAAK,EAAA,WAAWT,GAAkB,QAAO,WAAU,UAAA;AAAA,MAAA;AAAA,MAChDV;AAAA,IAAA,EAAA,CACJ,EACF,CAAA;AAAA,IAEF,gBAAAkB,EAACE,GAAU,EAAA,OAAO,EAAG,CAAA;AAAA,IACpBhB,KAEG,gBAAAY,EAAAK,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAH,EAACD,GAAS,EAAA,eAAeL,GAAmB,YAAW,UACrD,UAAA,gBAAAM,EAACI,GAAA,EAAiB,aAAajB,GAAY,iBAAiBH,EAAgB,CAAA,GAC9E;AAAA,wBACCe,GAAS,EAAA,eAAeH,GACvB,UAAC,gBAAAI,EAAAC,GAAA,EAAK,WAAU,OAAM,QAAQd,IAAa,YAAY,OACpD,eAAK,IAAIJ,CAAW,EAAE,QAAQ,CAAC,EAClC,CAAA,GACF;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,66 +1,70 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as X, useCallback as _, Fragment as L } from "react";
|
|
3
3
|
import { useTheme as w } from "styled-components";
|
|
4
|
-
import
|
|
4
|
+
import y from "../../../../ui/buttons/button/button.js";
|
|
5
5
|
import r from "../../../../ui/layout/flex-view.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Divider as
|
|
9
|
-
import
|
|
10
|
-
import { getQuestionStatusBgColor as
|
|
11
|
-
import { EQuestionState as
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
section:
|
|
16
|
-
sheet:
|
|
17
|
-
|
|
6
|
+
import l from "../../../../ui/text/text.js";
|
|
7
|
+
import G from "../score-badge/score-badge.js";
|
|
8
|
+
import { Divider as K } from "./score-section-styled.js";
|
|
9
|
+
import g from "../../../../ui/separator/separator.js";
|
|
10
|
+
import { getQuestionStatusBgColor as k } from "../../math-fit-report-helpers.js";
|
|
11
|
+
import { EQuestionState as u } from "../../../math-fit-overview/math-fit-overview-types.js";
|
|
12
|
+
import { EDeviceType as j } from "../../../../ui/theme/constants.js";
|
|
13
|
+
const Y = X(function({
|
|
14
|
+
onReviewSection: c,
|
|
15
|
+
section: s,
|
|
16
|
+
sheet: $,
|
|
17
|
+
compactView: a = !1,
|
|
18
|
+
showReviewButton: b = !0
|
|
18
19
|
}) {
|
|
19
20
|
const {
|
|
20
|
-
title:
|
|
21
|
-
score:
|
|
22
|
-
scoreChange:
|
|
23
|
-
sessionId:
|
|
24
|
-
isIncomplete:
|
|
25
|
-
sectionNumber:
|
|
26
|
-
topics:
|
|
27
|
-
} =
|
|
28
|
-
!
|
|
29
|
-
}, [
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
21
|
+
title: x,
|
|
22
|
+
score: f,
|
|
23
|
+
scoreChange: C,
|
|
24
|
+
sessionId: p,
|
|
25
|
+
isIncomplete: t = !1,
|
|
26
|
+
sectionNumber: T,
|
|
27
|
+
topics: A
|
|
28
|
+
} = s, { device: I } = w(), m = I <= j.MOBILE, h = [...A ?? []].sort((i, d) => i.miniGoal.order - d.miniGoal.order), E = m || a ? "column" : "row", B = m || a ? "" : "center", S = m || a ? 0.5 : 0, D = _(() => {
|
|
29
|
+
!t && s.sheet && c && c($, p);
|
|
30
|
+
}, [t, c, s.sheet, $, p]);
|
|
31
|
+
return /* @__PURE__ */ o(r, { children: [
|
|
32
|
+
/* @__PURE__ */ o(r, { $flexDirection: "row", $alignItems: "center", children: [
|
|
33
|
+
/* @__PURE__ */ o(l, { $renderAs: "ab2-bold", $color: "BLACK_1", children: [
|
|
34
|
+
x,
|
|
34
35
|
":"
|
|
35
36
|
] }),
|
|
36
|
-
/* @__PURE__ */ e(
|
|
37
|
-
|
|
37
|
+
/* @__PURE__ */ e(g, { width: 4 }),
|
|
38
|
+
t ? /* @__PURE__ */ e(r, { $gutter: 3, $gap: 2.5, $background: "BLACK_5", children: /* @__PURE__ */ e(l, { $renderAs: "ab4-bold", $color: "WHITE", children: "INCOMPLETE" }) }) : f && /* @__PURE__ */ e(G, { score: f, maxScore: 10, scoreChange: C })
|
|
38
39
|
] }),
|
|
39
|
-
/* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children:
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ e(r, { $flexRowGapX: 0.5, $gapX: 0.75, children: h.map((i, d) => /* @__PURE__ */ o(L, { children: [
|
|
41
|
+
/* @__PURE__ */ o(
|
|
41
42
|
r,
|
|
42
43
|
{
|
|
43
|
-
$flexDirection:
|
|
44
|
+
$flexDirection: E,
|
|
44
45
|
$justifyContent: "space-between",
|
|
45
|
-
$alignItems:
|
|
46
|
-
$flexRowGapX:
|
|
46
|
+
$alignItems: B,
|
|
47
|
+
$flexRowGapX: S,
|
|
47
48
|
children: [
|
|
48
|
-
/* @__PURE__ */ e(
|
|
49
|
-
/* @__PURE__ */ e(r, { $flexGapX: 0.5, $flexDirection: "row", children: i.miniGoal.items.map((n) => /* @__PURE__ */ e(
|
|
49
|
+
/* @__PURE__ */ e(l, { $renderAs: "ub2", $color: t ? "BLACK_T_38" : "BLACK_1", children: i.name }),
|
|
50
|
+
/* @__PURE__ */ e(r, { $flexGapX: 0.5, $flexDirection: "row", $flexWrap: !0, children: i.miniGoal.items.map((n) => /* @__PURE__ */ e(
|
|
50
51
|
r,
|
|
51
52
|
{
|
|
52
|
-
$widthX: 1.25,
|
|
53
53
|
$heightX: 1.25,
|
|
54
|
+
$gutterX: 0.5,
|
|
54
55
|
$alignItems: "center",
|
|
55
56
|
$justifyContent: "center",
|
|
56
|
-
$borderRadiusX:
|
|
57
|
-
$background:
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
|
|
57
|
+
$borderRadiusX: 1,
|
|
58
|
+
$background: k(n.state),
|
|
59
|
+
children: /* @__PURE__ */ o(
|
|
60
|
+
l,
|
|
60
61
|
{
|
|
61
62
|
$renderAs: "ub3",
|
|
62
|
-
$color: n.state ===
|
|
63
|
-
children:
|
|
63
|
+
$color: n.state === u.SKIPPED || n.state === u.UNATTEMPTED ? "BLACK_T_38" : "WHITE",
|
|
64
|
+
children: [
|
|
65
|
+
"Q",
|
|
66
|
+
n.order
|
|
67
|
+
]
|
|
64
68
|
}
|
|
65
69
|
)
|
|
66
70
|
},
|
|
@@ -69,24 +73,24 @@ const z = _(function({
|
|
|
69
73
|
]
|
|
70
74
|
}
|
|
71
75
|
),
|
|
72
|
-
|
|
76
|
+
d !== h.length - 1 && /* @__PURE__ */ e(K, {})
|
|
73
77
|
] }, i.name)) }),
|
|
74
|
-
|
|
75
|
-
/* @__PURE__ */ e(
|
|
78
|
+
b && /* @__PURE__ */ o(r, { $alignItems: "center", children: [
|
|
79
|
+
/* @__PURE__ */ e(g, { heightX: 0.75 }),
|
|
76
80
|
/* @__PURE__ */ e(
|
|
77
|
-
|
|
81
|
+
y,
|
|
78
82
|
{
|
|
79
|
-
label: `Review Section ${
|
|
80
|
-
renderAs:
|
|
83
|
+
label: `Review Section ${T}`,
|
|
84
|
+
renderAs: t ? "secondary" : "primary",
|
|
81
85
|
size: "small",
|
|
82
|
-
onClick:
|
|
83
|
-
disabled:
|
|
86
|
+
onClick: D,
|
|
87
|
+
disabled: t
|
|
84
88
|
}
|
|
85
89
|
)
|
|
86
90
|
] })
|
|
87
91
|
] });
|
|
88
92
|
});
|
|
89
93
|
export {
|
|
90
|
-
|
|
94
|
+
Y as default
|
|
91
95
|
};
|
|
92
96
|
//# sourceMappingURL=score-section.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\nimport { EQuestionState } from '../../../math-fit-overview/math-fit-overview-types';\nimport {
|
|
1
|
+
{"version":3,"file":"score-section.js","sources":["../../../../../../src/features/math-fit/math-fit-report/comps/score-section/score-section.tsx"],"sourcesContent":["import { Fragment, memo, useCallback, type FC } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Button from '../../../../ui/buttons/button/button';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport ScoreBadge from '../score-badge/score-badge';\nimport type { IScoreSectionProps } from './score-section-types';\nimport * as Styled from './score-section-styled';\nimport Separator from '../../../../ui/separator/separator';\nimport { getQuestionStatusBgColor } from '../../math-fit-report-helpers';\nimport { EQuestionState } from '../../../math-fit-overview/math-fit-overview-types';\nimport { EDeviceType } from '../../../../ui/theme/constants';\n\nconst ScoreSection: FC<IScoreSectionProps> = memo(function ScoreSection({\n onReviewSection,\n section,\n sheet,\n compactView = false,\n showReviewButton = true,\n}) {\n const {\n title,\n score,\n scoreChange,\n sessionId,\n isIncomplete = false,\n sectionNumber,\n topics,\n } = section;\n\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const sortedTopics = [...(topics ?? [])].sort((a, b) => a.miniGoal.order - b.miniGoal.order);\n const layoutDirection = isMobile || compactView ? 'column' : 'row';\n const alignment = isMobile || compactView ? '' : 'center';\n const gap = isMobile || compactView ? 0.5 : 0;\n\n const onClickReview = useCallback(() => {\n if (!isIncomplete && section.sheet && onReviewSection) {\n onReviewSection(sheet, sessionId);\n }\n }, [isIncomplete, onReviewSection, section.sheet, sheet, sessionId]);\n\n return (\n <FlexView>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\">\n <Text $renderAs=\"ab2-bold\" $color=\"BLACK_1\">\n {title}:\n </Text>\n <Separator width={4} />\n {isIncomplete ? (\n <FlexView $gutter={3} $gap={2.5} $background=\"BLACK_5\">\n <Text $renderAs=\"ab4-bold\" $color=\"WHITE\">\n INCOMPLETE\n </Text>\n </FlexView>\n ) : (\n score && <ScoreBadge score={score} maxScore={10} scoreChange={scoreChange} />\n )}\n </FlexView>\n <FlexView $flexRowGapX={0.5} $gapX={0.75}>\n {sortedTopics.map((topic, index) => (\n <Fragment key={topic.name}>\n <FlexView\n $flexDirection={layoutDirection}\n $justifyContent=\"space-between\"\n $alignItems={alignment}\n $flexRowGapX={gap}\n >\n <Text $renderAs=\"ub2\" $color={isIncomplete ? 'BLACK_T_38' : 'BLACK_1'}>\n {topic.name}\n </Text>\n <FlexView $flexGapX={0.5} $flexDirection=\"row\" $flexWrap>\n {topic.miniGoal.items.map(question => (\n <FlexView\n key={question.item_reference}\n $heightX={1.25}\n $gutterX={0.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={1}\n $background={getQuestionStatusBgColor(question.state)}\n >\n <Text\n $renderAs=\"ub3\"\n $color={\n question.state === EQuestionState.SKIPPED ||\n question.state === EQuestionState.UNATTEMPTED\n ? 'BLACK_T_38'\n : 'WHITE'\n }\n >\n Q{question.order}\n </Text>\n </FlexView>\n ))}\n </FlexView>\n </FlexView>\n {index !== sortedTopics.length - 1 && <Styled.Divider />}\n </Fragment>\n ))}\n </FlexView>\n {showReviewButton && (\n <FlexView $alignItems=\"center\">\n <Separator heightX={0.75} />\n <Button\n label={`Review Section ${sectionNumber}`}\n renderAs={isIncomplete ? 'secondary' : 'primary'}\n size=\"small\"\n onClick={onClickReview}\n disabled={isIncomplete}\n />\n </FlexView>\n )}\n </FlexView>\n );\n});\n\nexport default ScoreSection;\n"],"names":["ScoreSection","memo","onReviewSection","section","sheet","compactView","showReviewButton","title","score","scoreChange","sessionId","isIncomplete","sectionNumber","topics","device","useTheme","isMobile","EDeviceType","sortedTopics","a","b","layoutDirection","alignment","gap","onClickReview","useCallback","FlexView","jsxs","Text","jsx","Separator","ScoreBadge","topic","index","Fragment","question","getQuestionStatusBgColor","EQuestionState","Styled.Divider","Button"],"mappings":";;;;;;;;;;;;AAcM,MAAAA,IAAuCC,EAAK,SAAsB;AAAA,EACtE,iBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,kBAAAC,IAAmB;AACrB,GAAG;AACK,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,eAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAV,GAEE,EAAE,QAAAW,MAAWC,KACbC,IAAWF,KAAUG,EAAY,QAEjCC,IAAe,CAAC,GAAIL,KAAU,CAAA,CAAG,EAAE,KAAK,CAACM,GAAGC,MAAMD,EAAE,SAAS,QAAQC,EAAE,SAAS,KAAK,GACrFC,IAAkBL,KAAYX,IAAc,WAAW,OACvDiB,IAAYN,KAAYX,IAAc,KAAK,UAC3CkB,IAAMP,KAAYX,IAAc,MAAM,GAEtCmB,IAAgBC,EAAY,MAAM;AACtC,IAAI,CAACd,KAAgBR,EAAQ,SAASD,KACpCA,EAAgBE,GAAOM,CAAS;AAAA,EAClC,GACC,CAACC,GAAcT,GAAiBC,EAAQ,OAAOC,GAAOM,CAAS,CAAC;AAEnE,2BACGgB,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACD,GAAS,EAAA,gBAAe,OAAM,aAAY,UACzC,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAC/B,UAAA;AAAA,QAAArB;AAAA,QAAM;AAAA,MAAA,GACT;AAAA,MACA,gBAAAsB,EAACC,GAAU,EAAA,OAAO,EAAG,CAAA;AAAA,MACpBnB,IACE,gBAAAkB,EAAAH,GAAA,EAAS,SAAS,GAAG,MAAM,KAAK,aAAY,WAC3C,UAAA,gBAAAG,EAACD,GAAK,EAAA,WAAU,YAAW,QAAO,SAAQ,UAE1C,aAAA,CAAA,EACF,CAAA,IAEApB,uBAAUuB,GAAW,EAAA,OAAAvB,GAAc,UAAU,IAAI,aAAAC,EAA0B,CAAA;AAAA,IAAA,GAE/E;AAAA,IACC,gBAAAoB,EAAAH,GAAA,EAAS,cAAc,KAAK,OAAO,MACjC,UAAaR,EAAA,IAAI,CAACc,GAAOC,MACxB,gBAAAN,EAACO,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAP;AAAA,QAACD;AAAA,QAAA;AAAA,UACC,gBAAgBL;AAAA,UAChB,iBAAgB;AAAA,UAChB,aAAaC;AAAA,UACb,cAAcC;AAAA,UAEd,UAAA;AAAA,YAAC,gBAAAM,EAAAD,GAAA,EAAK,WAAU,OAAM,QAAQjB,IAAe,eAAe,WACzD,YAAM,KACT,CAAA;AAAA,YACC,gBAAAkB,EAAAH,GAAA,EAAS,WAAW,KAAK,gBAAe,OAAM,WAAS,IACrD,UAAMM,EAAA,SAAS,MAAM,IAAI,CACxBG,MAAA,gBAAAN;AAAA,cAACH;AAAA,cAAA;AAAA,gBAEC,UAAU;AAAA,gBACV,UAAU;AAAA,gBACV,aAAY;AAAA,gBACZ,iBAAgB;AAAA,gBAChB,gBAAgB;AAAA,gBAChB,aAAaU,EAAyBD,EAAS,KAAK;AAAA,gBAEpD,UAAA,gBAAAR;AAAA,kBAACC;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,QACEO,EAAS,UAAUE,EAAe,WAClCF,EAAS,UAAUE,EAAe,cAC9B,eACA;AAAA,oBAEP,UAAA;AAAA,sBAAA;AAAA,sBACGF,EAAS;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACb;AAAA,cAAA;AAAA,cAlBKA,EAAS;AAAA,YAoBjB,CAAA,GACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,MACCF,MAAUf,EAAa,SAAS,KAAM,gBAAAW,EAAAS,GAAA,EAAe;AAAA,IApCzC,EAAA,GAAAN,EAAM,IAqCrB,CACD,GACH;AAAA,IACC1B,KACC,gBAAAqB,EAACD,GAAS,EAAA,aAAY,UACpB,UAAA;AAAA,MAAC,gBAAAG,EAAAC,GAAA,EAAU,SAAS,KAAM,CAAA;AAAA,MAC1B,gBAAAD;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,OAAO,kBAAkB3B,CAAa;AAAA,UACtC,UAAUD,IAAe,cAAc;AAAA,UACvC,MAAK;AAAA,UACL,SAASa;AAAA,UACT,UAAUb;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,50 +1,64 @@
|
|
|
1
1
|
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
2
|
+
import { memo as T, useMemo as m, useEffect as I } from "react";
|
|
3
|
+
import { IS_APP_RUNNING_IN_RN as u } from "../../../constants/app-config.js";
|
|
3
4
|
import o from "../../ui/layout/flex-view.js";
|
|
4
5
|
import c from "../../ui/text/text.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { transformSectionsToReportData as
|
|
8
|
-
import { useUIContext as
|
|
9
|
-
import { MATHFIT_ANALYTICS_EVENTS as
|
|
10
|
-
|
|
11
|
-
const C = f(function({
|
|
6
|
+
import R from "./comps/report-header/report-header.js";
|
|
7
|
+
import A from "./comps/score-section/score-section.js";
|
|
8
|
+
import { transformSectionsToReportData as C, LEGEND_ITEMS as E, getQuestionStatusBgColor as b } from "./math-fit-report-helpers.js";
|
|
9
|
+
import { useUIContext as S } from "../../ui/context/context.js";
|
|
10
|
+
import { MATHFIT_ANALYTICS_EVENTS as X } from "../mathfit-events.js";
|
|
11
|
+
const v = T(function({
|
|
12
12
|
data: e,
|
|
13
|
-
onReview:
|
|
14
|
-
studentName:
|
|
15
|
-
userType:
|
|
16
|
-
onBack:
|
|
13
|
+
onReview: h,
|
|
14
|
+
studentName: f,
|
|
15
|
+
userType: s,
|
|
16
|
+
onBack: _,
|
|
17
|
+
compactView: i = !1,
|
|
18
|
+
showBorder: p = !1,
|
|
19
|
+
showEncouragement: g = !0
|
|
17
20
|
}) {
|
|
18
|
-
const
|
|
21
|
+
const d = p ? "WHITE_5" : void 0, l = m(() => C(e.sections), [e.sections]), { onEvent: $ } = S(), a = m(() => {
|
|
19
22
|
if (e.previous_score && e.score)
|
|
20
23
|
return e.score - e.previous_score;
|
|
21
24
|
}, [e.score, e.previous_score]);
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
userType:
|
|
25
|
+
return I(() => {
|
|
26
|
+
$(X.MATHFIT_REPORT_VIEWED, {
|
|
27
|
+
userType: u ? "PARENT" : s,
|
|
25
28
|
student_id: e.user_id,
|
|
26
29
|
mathfit_id: e.id,
|
|
27
30
|
test_score: e.score
|
|
28
31
|
});
|
|
29
|
-
}, [e,
|
|
32
|
+
}, [e, $, s]), /* @__PURE__ */ n(o, { $flex: 1, $background: "BLACK_T_04", $borderColor: d, children: [
|
|
30
33
|
/* @__PURE__ */ r(
|
|
31
|
-
|
|
34
|
+
R,
|
|
32
35
|
{
|
|
33
36
|
score: e.score ?? 0,
|
|
34
37
|
maxScore: 10,
|
|
35
|
-
scoreChange:
|
|
38
|
+
scoreChange: a,
|
|
36
39
|
createdOnTs: e.created_on_ts,
|
|
37
|
-
studentName:
|
|
38
|
-
userType:
|
|
39
|
-
onBack:
|
|
40
|
+
studentName: f,
|
|
41
|
+
userType: s,
|
|
42
|
+
onBack: _,
|
|
43
|
+
compactView: i,
|
|
44
|
+
showGreeting: !i
|
|
40
45
|
}
|
|
41
46
|
),
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ r(o, { $gapX: 1.5, $gutterX: 1.25, children: /* @__PURE__ */ r(
|
|
44
|
-
|
|
47
|
+
l.map((t, x) => /* @__PURE__ */ n(o, { $background: "WHITE", children: [
|
|
48
|
+
/* @__PURE__ */ r(o, { $gapX: 1.5, $gutterX: 1.25, children: /* @__PURE__ */ r(
|
|
49
|
+
A,
|
|
50
|
+
{
|
|
51
|
+
onReviewSection: h,
|
|
52
|
+
section: t,
|
|
53
|
+
sheet: t.sheet,
|
|
54
|
+
compactView: i,
|
|
55
|
+
showReviewButton: !i && !u
|
|
56
|
+
}
|
|
57
|
+
) }),
|
|
58
|
+
x !== l.length - 1 && /* @__PURE__ */ r(o, { $height: 1, $background: "BLACK_T_08" })
|
|
45
59
|
] }, t.title)),
|
|
46
60
|
/* @__PURE__ */ n(o, { $gutterX: 1, $flexColumnGapX: 1, $gapX: 1, $flexRowGapX: 2, $alignItems: "center", children: [
|
|
47
|
-
/* @__PURE__ */ r(o, { $flexDirection: "row", $flexColumnGapX: 1, $alignItems: "center", children:
|
|
61
|
+
/* @__PURE__ */ r(o, { $flexDirection: "row", $flexColumnGapX: 1, $alignItems: "center", children: E.map((t) => /* @__PURE__ */ n(
|
|
48
62
|
o,
|
|
49
63
|
{
|
|
50
64
|
$flexDirection: "row",
|
|
@@ -58,21 +72,21 @@ const C = f(function({
|
|
|
58
72
|
$width: 10,
|
|
59
73
|
$height: 10,
|
|
60
74
|
$borderRadiusX: 1,
|
|
61
|
-
$background:
|
|
75
|
+
$background: b(t.state)
|
|
62
76
|
}
|
|
63
77
|
)
|
|
64
78
|
]
|
|
65
79
|
},
|
|
66
80
|
t.label
|
|
67
81
|
)) }),
|
|
68
|
-
/* @__PURE__ */ n(o, { $flexRowGapX: 0.25, $marginBottomX: 0.5, $alignItems: "center", children: [
|
|
82
|
+
g && /* @__PURE__ */ n(o, { $flexRowGapX: 0.25, $marginBottomX: 0.5, $alignItems: "center", children: [
|
|
69
83
|
/* @__PURE__ */ r(c, { $renderAs: "ub3-bold", $color: "BLACK_1", $align: "center", children: "Keep Up the Great Work! 🚀" }),
|
|
70
|
-
/* @__PURE__ */ r(c, { $renderAs: "ub3", $color: "BLACK_1", $align: "center", children: "You
|
|
84
|
+
/* @__PURE__ */ r(c, { $renderAs: "ub3", $color: "BLACK_1", $align: "center", children: "You're getting stronger at MathFit each day. See you next month!" })
|
|
71
85
|
] })
|
|
72
86
|
] })
|
|
73
87
|
] });
|
|
74
|
-
}),
|
|
88
|
+
}), P = v;
|
|
75
89
|
export {
|
|
76
|
-
|
|
90
|
+
P as default
|
|
77
91
|
};
|
|
78
92
|
//# sourceMappingURL=math-fit-report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math-fit-report.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report.tsx"],"sourcesContent":["import { memo, useEffect, useMemo, type FC } from 'react';\n\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport ReportHeader from './comps/report-header/report-header';\nimport ScoreSection from './comps/score-section/score-section';\nimport {\n getQuestionStatusBgColor,\n LEGEND_ITEMS,\n transformSectionsToReportData,\n} from './math-fit-report-helpers';\nimport type { IMathFitReportProps } from './math-fit-report-types';\nimport { useUIContext } from '../../ui/context/context';\nimport { MATHFIT_ANALYTICS_EVENTS } from '../mathfit-events';\
|
|
1
|
+
{"version":3,"file":"math-fit-report.js","sources":["../../../../src/features/math-fit/math-fit-report/math-fit-report.tsx"],"sourcesContent":["import { memo, useEffect, useMemo, type FC } from 'react';\n\nimport { IS_APP_RUNNING_IN_RN } from '../../../constants/app-config';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport ReportHeader from './comps/report-header/report-header';\nimport ScoreSection from './comps/score-section/score-section';\nimport {\n getQuestionStatusBgColor,\n LEGEND_ITEMS,\n transformSectionsToReportData,\n} from './math-fit-report-helpers';\nimport type { IMathFitReportProps } from './math-fit-report-types';\nimport { useUIContext } from '../../ui/context/context';\nimport { MATHFIT_ANALYTICS_EVENTS } from '../mathfit-events';\n\nconst MathFitReport: FC<IMathFitReportProps> = memo(function MathFitReport({\n data,\n onReview,\n studentName,\n userType,\n onBack,\n compactView = false,\n showBorder = false,\n showEncouragement = true,\n}) {\n const borderColor = showBorder ? 'WHITE_5' : undefined;\n const sectionData = useMemo(() => transformSectionsToReportData(data.sections), [data.sections]);\n const { onEvent: trackEvent } = useUIContext();\n\n const scoreChange = useMemo(() => {\n if (data.previous_score && data.score) {\n return data.score - data.previous_score;\n }\n\n return undefined;\n }, [data.score, data.previous_score]);\n\n useEffect(() => {\n trackEvent(MATHFIT_ANALYTICS_EVENTS.MATHFIT_REPORT_VIEWED, {\n userType: IS_APP_RUNNING_IN_RN ? 'PARENT' : userType,\n student_id: data.user_id,\n mathfit_id: data.id,\n test_score: data.score,\n });\n }, [data, trackEvent, userType]);\n\n return (\n <FlexView $flex={1} $background=\"BLACK_T_04\" $borderColor={borderColor}>\n <ReportHeader\n score={data.score ?? 0}\n maxScore={10}\n scoreChange={scoreChange}\n createdOnTs={data.created_on_ts}\n studentName={studentName}\n userType={userType}\n onBack={onBack}\n compactView={compactView}\n showGreeting={!compactView}\n />\n\n {sectionData.map((section, index) => (\n <FlexView key={section.title} $background=\"WHITE\">\n <FlexView $gapX={1.5} $gutterX={1.25}>\n <ScoreSection\n onReviewSection={onReview}\n section={section}\n sheet={section.sheet}\n compactView={compactView}\n showReviewButton={!compactView && !IS_APP_RUNNING_IN_RN}\n />\n </FlexView>\n {index !== sectionData.length - 1 && <FlexView $height={1} $background=\"BLACK_T_08\" />}\n </FlexView>\n ))}\n\n <FlexView $gutterX={1} $flexColumnGapX={1} $gapX={1} $flexRowGapX={2} $alignItems=\"center\">\n <FlexView $flexDirection=\"row\" $flexColumnGapX={1} $alignItems=\"center\">\n {LEGEND_ITEMS.map(item => (\n <FlexView\n key={item.label}\n $flexDirection=\"row\"\n $flexColumnGapX={0.25}\n $alignItems=\"center\"\n >\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {item.label}\n </Text>\n <FlexView\n $width={10}\n $height={10}\n $borderRadiusX={1}\n $background={getQuestionStatusBgColor(item.state)}\n />\n </FlexView>\n ))}\n </FlexView>\n {showEncouragement && (\n <FlexView $flexRowGapX={0.25} $marginBottomX={0.5} $alignItems=\"center\">\n <Text $renderAs=\"ub3-bold\" $color=\"BLACK_1\" $align=\"center\">\n Keep Up the Great Work! 🚀\n </Text>\n <Text $renderAs=\"ub3\" $color=\"BLACK_1\" $align=\"center\">\n You're getting stronger at MathFit each day. See you next month!\n </Text>\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n});\n\nexport default MathFitReport;\n"],"names":["MathFitReport","memo","data","onReview","studentName","userType","onBack","compactView","showBorder","showEncouragement","borderColor","sectionData","useMemo","transformSectionsToReportData","trackEvent","useUIContext","scoreChange","useEffect","MATHFIT_ANALYTICS_EVENTS","IS_APP_RUNNING_IN_RN","FlexView","jsx","ReportHeader","section","index","jsxs","ScoreSection","LEGEND_ITEMS","item","Text","getQuestionStatusBgColor","MathFitReport$1"],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as a } from "react";
|
|
3
|
+
import p from "../../../../../math-fit/math-fit-report/math-fit-report.js";
|
|
4
|
+
import t from "../../../../../ui/layout/flex-view.js";
|
|
5
|
+
import n from "../../../../../ui/separator/separator.js";
|
|
6
|
+
import l from "../../../../../ui/text/text.js";
|
|
7
|
+
const w = a(function({ mathfitTests: o, studentName: i }) {
|
|
8
|
+
return !o || o.length === 0 ? null : /* @__PURE__ */ m(t, { children: [
|
|
9
|
+
/* @__PURE__ */ r(l, { $renderAs: "ab1-bold", $color: "BLACK_1", children: "MathFit Test Report" }),
|
|
10
|
+
/* @__PURE__ */ r(n, { heightX: 1 }),
|
|
11
|
+
/* @__PURE__ */ r(t, { $flexGapX: 1.5, children: o.map((e) => /* @__PURE__ */ r(
|
|
12
|
+
p,
|
|
13
|
+
{
|
|
14
|
+
data: e,
|
|
15
|
+
studentName: i,
|
|
16
|
+
userType: "STUDENT",
|
|
17
|
+
compactView: !0,
|
|
18
|
+
showBorder: !0,
|
|
19
|
+
showEncouragement: !1
|
|
20
|
+
},
|
|
21
|
+
e.id
|
|
22
|
+
)) })
|
|
23
|
+
] });
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
w as default
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=mathfit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mathfit.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/mathfit/mathfit.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport MathFitReport from '../../../../../math-fit/math-fit-report/math-fit-report';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport Separator from '../../../../../ui/separator/separator';\nimport Text from '../../../../../ui/text/text';\nimport { type IMathfitProps } from './mathfit-types';\n\nconst Mathfit: FC<IMathfitProps> = memo(function Mathfit({ mathfitTests, studentName }) {\n if (!mathfitTests || mathfitTests.length === 0) {\n return null;\n }\n\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n MathFit Test Report\n </Text>\n <Separator heightX={1} />\n <FlexView $flexGapX={1.5}>\n {mathfitTests.map(test => (\n <MathFitReport\n key={test.id}\n data={test}\n studentName={studentName}\n userType=\"STUDENT\"\n compactView={true}\n showBorder={true}\n showEncouragement={false}\n />\n ))}\n </FlexView>\n </FlexView>\n );\n});\n\nexport default Mathfit;\n"],"names":["Mathfit","memo","mathfitTests","studentName","FlexView","jsx","Text","Separator","test","MathFitReport"],"mappings":";;;;;;AAQA,MAAMA,IAA6BC,EAAK,SAAiB,EAAE,cAAAC,GAAc,aAAAC,KAAe;AACtF,SAAI,CAACD,KAAgBA,EAAa,WAAW,IACpC,yBAINE,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,uBAAA;AAAA,IACA,gBAAAD,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,sBACtBH,GAAS,EAAA,WAAW,KAClB,UAAAF,EAAa,IAAI,CAChBM,MAAA,gBAAAH;AAAA,MAACI;AAAA,MAAA;AAAA,QAEC,MAAMD;AAAA,QACN,aAAAL;AAAA,QACA,UAAS;AAAA,QACT,aAAa;AAAA,QACb,YAAY;AAAA,QACZ,mBAAmB;AAAA,MAAA;AAAA,MANdK,EAAK;AAAA,IAQb,CAAA,GACH;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-report-types.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report-types.ts"],"sourcesContent":["import { type NODE_TYPES } from '../../../../types/models/worksheet';\nimport { type TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport { type THueNames } from '../../../ui/types';\nimport { type NODE_STATE } from '../../daily-timeline/daily-timeline-types';\nimport { type IUserMilestone } from '../monthly-timeline-types';\n\nexport enum CARD_TYPE {\n 'general' = 'general',\n 'legacy' = 'legacy',\n 'diagnostic' = 'diagnostic',\n 'remedial' = 'remedial',\n 'recap' = 'recap',\n 'learn' = 'learn',\n 'extra_practice' = 'extra_practice',\n 'practice' = 'practice',\n 'test' = 'test',\n 'revision' = 'revision',\n 'advanced' = 'advanced',\n 'challenge' = 'challenge',\n 'video' = 'video',\n 'simulation' = 'simulation',\n 'note' = 'note',\n 'subjective' = 'subjective',\n 'deck' = 'deck',\n 'puzzle' = 'puzzle',\n 'test_series' = 'test_series',\n 'activity' = 'activity',\n 'project' = 'project',\n 'certificate' = 'certificate',\n 'ppt_viva' = 'ppt_viva',\n 'ppt_content' = 'ppt_content',\n 'wb_activity' = 'wb_activity',\n 'smart_practice' = 'smart_practice',\n 'exit_ticket' = 'exit_ticket',\n 'monthly_mastery_test' = 'monthly_mastery_test',\n 'supplementary_mastery_test' = 'supplementary_mastery_test',\n 'trial_diagnostic' = 'trial_diagnostic',\n 'trial' = 'trial',\n 'trial_basic' = 'trial_basic',\n 'trial_intermediate' = 'trial_intermediate',\n 'trial_advanced' = 'trial_advanced',\n 'sat_mock_test' = 'sat_mock_test',\n 'pdf' = 'pdf',\n}\n\nexport type ActivitiesByCardType = Partial<{\n [K in CARD_TYPE]: IMonthlyActivity[];\n}>;\n\nexport type TFeedback = 'positive' | 'negative';\n\nexport interface IMonthlyReportResponse {\n course_stream: TCourseStream;\n id: string;\n created_on_ts: number;\n is_deleted: boolean;\n report_date: string;\n report_date_ts: number;\n report_month: number;\n report_year: number;\n student_course_ids: string[];\n user_id: string;\n updated_on_ts: number;\n calendar_data: TCalendarData | null;\n progress_data: {\n user_milestones: IUserMilestone[];\n activities: ActivitiesByCardType;\n user_achievements: IAchievementAsset[];\n };\n feedback: TFeedback | null;\n}\n\nexport interface IProgressStat {\n completed: number;\n total: number;\n}\n\nexport interface IMonthlyActivity {\n id: string;\n node_type: NODE_TYPES;\n card_type: CARD_TYPE;\n card_header: CARD_TYPE | null;\n feedback_comments: string | null;\n state: NODE_STATE;\n title?: string;\n accuracy?: number | null;\n subtext?: string | null;\n is_timed?: boolean;\n image_hue?: THueNames;\n image_url?: string;\n sat_max_score?: number | null;\n sat_total_score?: number | null;\n item_ref?: string | null;\n thumbnail_url?: string;\n user_attempt_id?: string | null;\n tip: string | null;\n user_block_id: string | null;\n user_chapter_id: string | null;\n user_node_id: string | null;\n}\n\nexport interface IAchievementAsset {\n asset_id: string;\n url: string;\n}\n\nexport interface IMonthlyReportProps {\n reportId: string;\n studentName: string;\n onPuzzleClick?: (params: {\n item_ref: IMonthlyActivity['item_ref'];\n feedback_comments: IMonthlyActivity['feedback_comments'];\n image_hue: IMonthlyActivity['image_hue'];\n title: IMonthlyActivity['title'];\n tip: IMonthlyActivity['tip'];\n }) => void;\n showSnackbar?: (params: { type: 'error' | 'info'; message: string; bgColor: string }) => void;\n onFeedback?: (feedback: TFeedback, studentCourseId: string) => void;\n onAPIComplete?: (success: boolean) => void;\n}\n\nexport type TClassType = 'REGULAR' | 'EXTRA';\nexport interface IClassEvent {\n class_type: TClassType;\n is_paused: boolean;\n is_present: boolean;\n status: string;\n tag: string | null;\n theme: string;\n time: number;\n}\n\nexport type TCalendarData = Record<string, IClassEvent[]>;\n"],"names":["CARD_TYPE"],"mappings":"
|
|
1
|
+
{"version":3,"file":"monthly-report-types.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report-types.ts"],"sourcesContent":["import { type NODE_TYPES } from '../../../../types/models/worksheet';\nimport { type IMathFitAssessmentResponse } from '../../../math-fit/math-fit-overview/math-fit-overview-types';\nimport { type TCourseStream } from '../../../milestone/create/milestone-create-types';\nimport { type THueNames } from '../../../ui/types';\nimport { type NODE_STATE } from '../../daily-timeline/daily-timeline-types';\nimport { type IUserMilestone } from '../monthly-timeline-types';\n\nexport enum CARD_TYPE {\n 'general' = 'general',\n 'legacy' = 'legacy',\n 'diagnostic' = 'diagnostic',\n 'remedial' = 'remedial',\n 'recap' = 'recap',\n 'learn' = 'learn',\n 'extra_practice' = 'extra_practice',\n 'practice' = 'practice',\n 'test' = 'test',\n 'revision' = 'revision',\n 'advanced' = 'advanced',\n 'challenge' = 'challenge',\n 'video' = 'video',\n 'simulation' = 'simulation',\n 'note' = 'note',\n 'subjective' = 'subjective',\n 'deck' = 'deck',\n 'puzzle' = 'puzzle',\n 'test_series' = 'test_series',\n 'activity' = 'activity',\n 'project' = 'project',\n 'certificate' = 'certificate',\n 'ppt_viva' = 'ppt_viva',\n 'ppt_content' = 'ppt_content',\n 'wb_activity' = 'wb_activity',\n 'smart_practice' = 'smart_practice',\n 'exit_ticket' = 'exit_ticket',\n 'monthly_mastery_test' = 'monthly_mastery_test',\n 'supplementary_mastery_test' = 'supplementary_mastery_test',\n 'trial_diagnostic' = 'trial_diagnostic',\n 'trial' = 'trial',\n 'trial_basic' = 'trial_basic',\n 'trial_intermediate' = 'trial_intermediate',\n 'trial_advanced' = 'trial_advanced',\n 'sat_mock_test' = 'sat_mock_test',\n 'pdf' = 'pdf',\n}\n\nexport type ActivitiesByCardType = Partial<{\n [K in CARD_TYPE]: IMonthlyActivity[];\n}>;\n\nexport type TFeedback = 'positive' | 'negative';\n\nexport interface IMonthlyReportResponse {\n course_stream: TCourseStream;\n id: string;\n created_on_ts: number;\n is_deleted: boolean;\n report_date: string;\n report_date_ts: number;\n report_month: number;\n report_year: number;\n student_course_ids: string[];\n user_id: string;\n updated_on_ts: number;\n calendar_data: TCalendarData | null;\n progress_data: {\n mathfit_tests: IMathFitAssessmentResponse[];\n user_milestones: IUserMilestone[];\n activities: ActivitiesByCardType;\n user_achievements: IAchievementAsset[];\n };\n feedback: TFeedback | null;\n}\n\nexport interface IProgressStat {\n completed: number;\n total: number;\n}\n\nexport interface IMonthlyActivity {\n id: string;\n node_type: NODE_TYPES;\n card_type: CARD_TYPE;\n card_header: CARD_TYPE | null;\n feedback_comments: string | null;\n state: NODE_STATE;\n title?: string;\n accuracy?: number | null;\n subtext?: string | null;\n is_timed?: boolean;\n image_hue?: THueNames;\n image_url?: string;\n sat_max_score?: number | null;\n sat_total_score?: number | null;\n item_ref?: string | null;\n thumbnail_url?: string;\n user_attempt_id?: string | null;\n tip: string | null;\n user_block_id: string | null;\n user_chapter_id: string | null;\n user_node_id: string | null;\n}\n\nexport interface IAchievementAsset {\n asset_id: string;\n url: string;\n}\n\nexport interface IMonthlyReportProps {\n reportId: string;\n studentName: string;\n onPuzzleClick?: (params: {\n item_ref: IMonthlyActivity['item_ref'];\n feedback_comments: IMonthlyActivity['feedback_comments'];\n image_hue: IMonthlyActivity['image_hue'];\n title: IMonthlyActivity['title'];\n tip: IMonthlyActivity['tip'];\n }) => void;\n showSnackbar?: (params: { type: 'error' | 'info'; message: string; bgColor: string }) => void;\n onFeedback?: (feedback: TFeedback, studentCourseId: string) => void;\n onAPIComplete?: (success: boolean) => void;\n}\n\nexport type TClassType = 'REGULAR' | 'EXTRA';\nexport interface IClassEvent {\n class_type: TClassType;\n is_paused: boolean;\n is_present: boolean;\n status: string;\n tag: string | null;\n theme: string;\n time: number;\n}\n\nexport type TCalendarData = Record<string, IClassEvent[]>;\n"],"names":["CARD_TYPE"],"mappings":"AAOY,IAAAA,sBAAAA,OACVA,EAAA,UAAY,WACZA,EAAA,SAAW,UACXA,EAAA,aAAe,cACfA,EAAA,WAAa,YACbA,EAAA,QAAU,SACVA,EAAA,QAAU,SACVA,EAAA,iBAAmB,kBACnBA,EAAA,WAAa,YACbA,EAAA,OAAS,QACTA,EAAA,WAAa,YACbA,EAAA,WAAa,YACbA,EAAA,YAAc,aACdA,EAAA,QAAU,SACVA,EAAA,aAAe,cACfA,EAAA,OAAS,QACTA,EAAA,aAAe,cACfA,EAAA,OAAS,QACTA,EAAA,SAAW,UACXA,EAAA,cAAgB,eAChBA,EAAA,WAAa,YACbA,EAAA,UAAY,WACZA,EAAA,cAAgB,eAChBA,EAAA,WAAa,YACbA,EAAA,cAAgB,eAChBA,EAAA,cAAgB,eAChBA,EAAA,iBAAmB,kBACnBA,EAAA,cAAgB,eAChBA,EAAA,uBAAyB,wBACzBA,EAAA,6BAA+B,8BAC/BA,EAAA,mBAAqB,oBACrBA,EAAA,QAAU,SACVA,EAAA,cAAgB,eAChBA,EAAA,qBAAuB,sBACvBA,EAAA,iBAAmB,kBACnBA,EAAA,gBAAkB,iBAClBA,EAAA,MAAQ,OApCEA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,82 +1,85 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { monthlyReportGet as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { MonthlyReportContainer as
|
|
7
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { memo as Y, useCallback as E, useEffect as l } from "react";
|
|
3
|
+
import { monthlyReportGet as G } from "./api/use-monthly-report-api.js";
|
|
4
|
+
import N from "../../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import w from "../../../ui/error/error.js";
|
|
6
|
+
import { MonthlyReportContainer as A } from "./monthly-report-styled.js";
|
|
7
|
+
import T from "./comps/goals/goals.js";
|
|
8
8
|
import C from "./comps/activities/activities.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { IS_APP_RUNNING_IN_RN as
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import U from "./comps/attendance/attendance.js";
|
|
10
|
+
import X from "./comps/feedback/feedback.js";
|
|
11
|
+
import q from "./comps/achievements/achievements.js";
|
|
12
|
+
import { IS_APP_RUNNING_IN_RN as z } from "../../../../constants/app-config.js";
|
|
13
|
+
import B from "../../../ui/separator/separator.js";
|
|
14
|
+
import H from "./comps/mathfit/mathfit.js";
|
|
15
|
+
const J = ({
|
|
16
|
+
studentName: a,
|
|
16
17
|
reportId: r,
|
|
17
|
-
onPuzzleClick:
|
|
18
|
+
onPuzzleClick: k,
|
|
18
19
|
showSnackbar: u,
|
|
19
|
-
onFeedback:
|
|
20
|
+
onFeedback: L,
|
|
20
21
|
onAPIComplete: o
|
|
21
22
|
}) => {
|
|
22
23
|
const {
|
|
23
24
|
get: g,
|
|
24
25
|
data: _,
|
|
25
|
-
isProcessing:
|
|
26
|
+
isProcessing: i,
|
|
26
27
|
isProcessingFailed: s,
|
|
27
28
|
isStale: M,
|
|
28
29
|
isProcessed: n
|
|
29
|
-
} =
|
|
30
|
-
progress_data:
|
|
30
|
+
} = G(r), {
|
|
31
|
+
progress_data: S,
|
|
31
32
|
calendar_data: D,
|
|
32
|
-
report_month:
|
|
33
|
-
report_year:
|
|
34
|
-
feedback:
|
|
35
|
-
student_course_ids:
|
|
33
|
+
report_month: c,
|
|
34
|
+
report_year: h,
|
|
35
|
+
feedback: b,
|
|
36
|
+
student_course_ids: m
|
|
36
37
|
} = _ || {}, {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
mathfit_tests: v,
|
|
39
|
+
user_milestones: y,
|
|
40
|
+
activities: R,
|
|
41
|
+
user_achievements: F
|
|
42
|
+
} = S || {}, e = E(() => {
|
|
41
43
|
g(r);
|
|
42
44
|
}, [g, r]);
|
|
43
45
|
if (l(() => {
|
|
44
46
|
e();
|
|
45
47
|
}, [e]), l(() => {
|
|
46
|
-
M && !
|
|
47
|
-
}, [M,
|
|
48
|
+
M && !i && e();
|
|
49
|
+
}, [M, i, e]), l(() => {
|
|
48
50
|
(n || s) && (o == null || o(n && !s));
|
|
49
|
-
}, [n, s, o]),
|
|
50
|
-
return /* @__PURE__ */ t(
|
|
51
|
+
}, [n, s, o]), i && !_)
|
|
52
|
+
return /* @__PURE__ */ t(N, { height: "100dvh" });
|
|
51
53
|
if (s)
|
|
52
|
-
return /* @__PURE__ */ t(
|
|
53
|
-
const
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
v && /* @__PURE__ */ t(
|
|
56
|
-
y && /* @__PURE__ */ t(
|
|
57
|
-
R && /* @__PURE__ */ t(
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
return /* @__PURE__ */ t(w, { height: "100dvh", onTryAgain: e });
|
|
55
|
+
const f = m == null ? void 0 : m[0], d = /* @__PURE__ */ new Date(), p = d.getMonth(), j = p === 0 ? d.getFullYear() - 1 : d.getFullYear();
|
|
56
|
+
return /* @__PURE__ */ x(A, { children: [
|
|
57
|
+
v && /* @__PURE__ */ t(H, { mathfitTests: v, studentName: a }),
|
|
58
|
+
y && /* @__PURE__ */ t(T, { milestones: y, isExpended: !0 }),
|
|
59
|
+
R && /* @__PURE__ */ t(C, { activities: R, onPuzzleClick: k }),
|
|
60
|
+
F && /* @__PURE__ */ t(q, { achievements: F, studentName: a }),
|
|
61
|
+
D && c && h && /* @__PURE__ */ t(
|
|
62
|
+
U,
|
|
60
63
|
{
|
|
61
64
|
calendarData: D,
|
|
62
|
-
reportMonth:
|
|
63
|
-
reportYear:
|
|
65
|
+
reportMonth: c,
|
|
66
|
+
reportYear: h,
|
|
64
67
|
onDateClick: u
|
|
65
68
|
}
|
|
66
69
|
),
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
z && !b && f && (c === (p === 0 ? 12 : p) && h === j) && f ? /* @__PURE__ */ t(
|
|
71
|
+
X,
|
|
69
72
|
{
|
|
70
73
|
reportId: r,
|
|
71
|
-
studentName:
|
|
72
|
-
onFeedback:
|
|
73
|
-
studentCourseId:
|
|
74
|
+
studentName: a,
|
|
75
|
+
onFeedback: L,
|
|
76
|
+
studentCourseId: f,
|
|
74
77
|
showSnackbar: u
|
|
75
78
|
}
|
|
76
|
-
) : /* @__PURE__ */ t(
|
|
79
|
+
) : /* @__PURE__ */ t(B, { heightX: 1 })
|
|
77
80
|
] });
|
|
78
|
-
},
|
|
81
|
+
}, ht = Y(J);
|
|
79
82
|
export {
|
|
80
|
-
|
|
83
|
+
ht as default
|
|
81
84
|
};
|
|
82
85
|
//# sourceMappingURL=monthly-report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { monthlyReportGet } from './api/use-monthly-report-api';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Error from '../../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport Attendance from './comps/attendance/attendance';\nimport Feedback from './comps/feedback/feedback';\nimport Achievements from './comps/achievements/achievements';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../constants/app-config';\nimport Separator from '../../../ui/separator/separator';\n\nconst MonthlyReport: FC<IMonthlyReportProps> = ({\n studentName,\n reportId,\n onPuzzleClick,\n showSnackbar,\n onFeedback,\n onAPIComplete,\n}) => {\n const {\n get: getReport,\n data: reportData,\n isProcessing,\n isProcessingFailed,\n isStale,\n isProcessed,\n } = monthlyReportGet(reportId);\n\n const {\n progress_data: progressData,\n calendar_data: calendarData,\n report_month: month,\n report_year: year,\n feedback,\n student_course_ids: studentCourseIds,\n } = reportData || {};\n\n const {\n user_milestones: userMilestones,\n activities,\n user_achievements: userAchievements,\n } = progressData || {};\n\n const fetchData = useCallback(() => {\n getReport(reportId);\n }, [getReport, reportId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale && !isProcessing) {\n fetchData();\n }\n }, [isStale, isProcessing, fetchData]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing && !reportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error height=\"100dvh\" onTryAgain={fetchData} />;\n }\n\n const firstStudentCourseId = studentCourseIds?.[0];\n\n // Check if the report is for the last month (previous month)\n const currentDate = new Date();\n const lastMonth = currentDate.getMonth(); // Current month - 1 (getMonth() returns 0-11)\n const lastMonthYear = lastMonth === 0 ? currentDate.getFullYear() - 1 : currentDate.getFullYear();\n const adjustedLastMonth = lastMonth === 0 ? 12 : lastMonth; // Handle January edge case\n const isLastMonth = month === adjustedLastMonth && year === lastMonthYear;\n\n const shouldShowFeedback =\n IS_APP_RUNNING_IN_RN && !feedback && firstStudentCourseId && isLastMonth;\n const hasCalendarData = calendarData && month && year;\n\n return (\n <Styled.MonthlyReportContainer>\n {userMilestones && <Goals milestones={userMilestones} isExpended={true} />}\n\n {activities && <Activities activities={activities} onPuzzleClick={onPuzzleClick} />}\n\n {userAchievements && (\n <Achievements achievements={userAchievements} studentName={studentName} />\n )}\n\n {hasCalendarData && (\n <Attendance\n calendarData={calendarData}\n reportMonth={month}\n reportYear={year}\n onDateClick={showSnackbar}\n />\n )}\n\n {shouldShowFeedback && firstStudentCourseId ? (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={firstStudentCourseId}\n showSnackbar={showSnackbar}\n />\n ) : (\n <Separator heightX={1} />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","onAPIComplete","getReport","reportData","isProcessing","isProcessingFailed","isStale","isProcessed","monthlyReportGet","progressData","calendarData","month","year","feedback","studentCourseIds","userMilestones","activities","userAchievements","fetchData","useCallback","useEffect","jsx","AppLoader","Error","firstStudentCourseId","currentDate","lastMonth","lastMonthYear","jsxs","Styled.MonthlyReportContainer","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","Separator","monthlyReport","memo"],"mappings":"
|
|
1
|
+
{"version":3,"file":"monthly-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { monthlyReportGet } from './api/use-monthly-report-api';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Error from '../../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport Attendance from './comps/attendance/attendance';\nimport Feedback from './comps/feedback/feedback';\nimport Achievements from './comps/achievements/achievements';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../constants/app-config';\nimport Separator from '../../../ui/separator/separator';\nimport Mathfit from './comps/mathfit/mathfit';\n\nconst MonthlyReport: FC<IMonthlyReportProps> = ({\n studentName,\n reportId,\n onPuzzleClick,\n showSnackbar,\n onFeedback,\n onAPIComplete,\n}) => {\n const {\n get: getReport,\n data: reportData,\n isProcessing,\n isProcessingFailed,\n isStale,\n isProcessed,\n } = monthlyReportGet(reportId);\n\n const {\n progress_data: progressData,\n calendar_data: calendarData,\n report_month: month,\n report_year: year,\n feedback,\n student_course_ids: studentCourseIds,\n } = reportData || {};\n\n const {\n mathfit_tests: mathfitTests,\n user_milestones: userMilestones,\n activities,\n user_achievements: userAchievements,\n } = progressData || {};\n\n const fetchData = useCallback(() => {\n getReport(reportId);\n }, [getReport, reportId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale && !isProcessing) {\n fetchData();\n }\n }, [isStale, isProcessing, fetchData]);\n\n useEffect(() => {\n if (isProcessed || isProcessingFailed) {\n onAPIComplete?.(isProcessed && !isProcessingFailed);\n }\n }, [isProcessed, isProcessingFailed, onAPIComplete]);\n\n if (isProcessing && !reportData) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return <Error height=\"100dvh\" onTryAgain={fetchData} />;\n }\n\n const firstStudentCourseId = studentCourseIds?.[0];\n\n // Check if the report is for the last month (previous month)\n const currentDate = new Date();\n const lastMonth = currentDate.getMonth(); // Current month - 1 (getMonth() returns 0-11)\n const lastMonthYear = lastMonth === 0 ? currentDate.getFullYear() - 1 : currentDate.getFullYear();\n const adjustedLastMonth = lastMonth === 0 ? 12 : lastMonth; // Handle January edge case\n const isLastMonth = month === adjustedLastMonth && year === lastMonthYear;\n\n const shouldShowFeedback =\n IS_APP_RUNNING_IN_RN && !feedback && firstStudentCourseId && isLastMonth;\n const hasCalendarData = calendarData && month && year;\n\n return (\n <Styled.MonthlyReportContainer>\n {mathfitTests && <Mathfit mathfitTests={mathfitTests} studentName={studentName} />}\n\n {userMilestones && <Goals milestones={userMilestones} isExpended={true} />}\n\n {activities && <Activities activities={activities} onPuzzleClick={onPuzzleClick} />}\n\n {userAchievements && (\n <Achievements achievements={userAchievements} studentName={studentName} />\n )}\n\n {hasCalendarData && (\n <Attendance\n calendarData={calendarData}\n reportMonth={month}\n reportYear={year}\n onDateClick={showSnackbar}\n />\n )}\n\n {shouldShowFeedback && firstStudentCourseId ? (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={firstStudentCourseId}\n showSnackbar={showSnackbar}\n />\n ) : (\n <Separator heightX={1} />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","onAPIComplete","getReport","reportData","isProcessing","isProcessingFailed","isStale","isProcessed","monthlyReportGet","progressData","calendarData","month","year","feedback","studentCourseIds","mathfitTests","userMilestones","activities","userAchievements","fetchData","useCallback","useEffect","jsx","AppLoader","Error","firstStudentCourseId","currentDate","lastMonth","lastMonthYear","jsxs","Styled.MonthlyReportContainer","Mathfit","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","Separator","monthlyReport","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAAyC,CAAC;AAAA,EAC9C,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AACF,MAAM;AACE,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEC,EAAiBX,CAAQ,GAEvB;AAAA,IACJ,eAAeY;AAAA,IACf,eAAeC;AAAA,IACf,cAAcC;AAAA,IACd,aAAaC;AAAA,IACb,UAAAC;AAAA,IACA,oBAAoBC;AAAA,EAAA,IAClBX,KAAc,CAAA,GAEZ;AAAA,IACJ,eAAeY;AAAA,IACf,iBAAiBC;AAAA,IACjB,YAAAC;AAAA,IACA,mBAAmBC;AAAA,EAAA,IACjBT,KAAgB,CAAA,GAEdU,IAAYC,EAAY,MAAM;AAClC,IAAAlB,EAAUL,CAAQ;AAAA,EAAA,GACjB,CAACK,GAAWL,CAAQ,CAAC;AAkBpB,MAhBJwB,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEdE,EAAU,MAAM;AACV,IAAAf,KAAW,CAACF,KACJe;EAEX,GAAA,CAACb,GAASF,GAAce,CAAS,CAAC,GAErCE,EAAU,MAAM;AACd,KAAId,KAAeF,OACDJ,KAAA,QAAAA,EAAAM,KAAe,CAACF;AAAA,EAEjC,GAAA,CAACE,GAAaF,GAAoBJ,CAAa,CAAC,GAE/CG,KAAgB,CAACD;AACZ,WAAA,gBAAAmB,EAACC,GAAU,EAAA,QAAO,SAAS,CAAA;AAGpC,MAAIlB;AACF,WAAQ,gBAAAiB,EAAAE,GAAA,EAAM,QAAO,UAAS,YAAYL,EAAW,CAAA;AAGjD,QAAAM,IAAuBX,KAAA,gBAAAA,EAAmB,IAG1CY,wBAAkB,QAClBC,IAAYD,EAAY,YACxBE,IAAgBD,MAAc,IAAID,EAAY,gBAAgB,IAAIA,EAAY;AASlF,SAAA,gBAAAG,EAACC,GAAA,EACE,UAAA;AAAA,IAAgBf,KAAA,gBAAAO,EAACS,GAAQ,EAAA,cAAAhB,GAA4B,aAAAnB,EAA0B,CAAA;AAAA,IAE/EoB,KAAmB,gBAAAM,EAAAU,GAAA,EAAM,YAAYhB,GAAgB,YAAY,IAAM;AAAA,IAEvEC,KAAc,gBAAAK,EAACW,GAAW,EAAA,YAAAhB,GAAwB,eAAAnB,EAA8B,CAAA;AAAA,IAEhFoB,KACC,gBAAAI,EAACY,GAAa,EAAA,cAAchB,GAAkB,aAAAtB,GAA0B;AAAA,IAXtDc,KAAgBC,KAASC,KAe3C,gBAAAU;AAAA,MAACa;AAAA,MAAA;AAAA,QACC,cAAAzB;AAAA,QACA,aAAaC;AAAA,QACb,YAAYC;AAAA,QACZ,aAAab;AAAA,MAAA;AAAA,IACf;AAAA,IArBJqC,KAAwB,CAACvB,KAAYY,MAHnBd,OADMgB,MAAc,IAAI,KAAKA,MACEf,MAASgB,MA2BjCH,IACrB,gBAAAH;AAAA,MAACe;AAAA,MAAA;AAAA,QACC,UAAAxC;AAAA,QACA,aAAAD;AAAA,QACA,YAAAI;AAAA,QACA,iBAAiByB;AAAA,QACjB,cAAA1B;AAAA,MAAA;AAAA,IAGF,IAAA,gBAAAuB,EAACgB,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,EAE3B,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAK7C,CAAa;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -646,7 +646,8 @@ export declare const EPResourceAssign: FC<IEPResourceAssign>;
|
|
|
646
646
|
declare enum EQuestionState {
|
|
647
647
|
CORRECT = "CORRECT",
|
|
648
648
|
INCORRECT = "INCORRECT",
|
|
649
|
-
SKIPPED = "SKIPPED"
|
|
649
|
+
SKIPPED = "SKIPPED",
|
|
650
|
+
UNATTEMPTED = "UNATTEMPTED"
|
|
650
651
|
}
|
|
651
652
|
|
|
652
653
|
export declare const EraserIcon: FC<SVGProps<SVGSVGElement>>;
|
|
@@ -2805,10 +2806,13 @@ declare interface IMathFitProps {
|
|
|
2805
2806
|
|
|
2806
2807
|
declare interface IMathFitReportProps {
|
|
2807
2808
|
data: IMathFitAssessmentResponse;
|
|
2808
|
-
onReview
|
|
2809
|
+
onReview?: (sheetData: INodeDataProps, sectionId: string) => void;
|
|
2809
2810
|
studentName: string;
|
|
2810
2811
|
userType: TUserTypes;
|
|
2811
|
-
onBack
|
|
2812
|
+
onBack?: () => void;
|
|
2813
|
+
compactView?: boolean;
|
|
2814
|
+
showBorder?: boolean;
|
|
2815
|
+
showEncouragement?: boolean;
|
|
2812
2816
|
}
|
|
2813
2817
|
|
|
2814
2818
|
declare interface IMathFitSection {
|