@magmamath/students-features 0.9.0 → 0.9.1-rc.1
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/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +44 -0
- package/dist/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +10 -3
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js +2 -4
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +5 -3
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +2 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +9 -2
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/helpers.js +10 -3
- package/dist/commonjs/features/endOfAssignment/helpers.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/model/model.js +7 -0
- package/dist/commonjs/features/endOfAssignment/model/model.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +2 -2
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js +38 -0
- package/dist/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +10 -3
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/EOAModal.js +2 -4
- package/dist/module/features/endOfAssignment/components/EOAModal.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +6 -4
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +3 -2
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +9 -2
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/helpers.js +8 -2
- package/dist/module/features/endOfAssignment/helpers.js.map +1 -1
- package/dist/module/features/endOfAssignment/model/model.js +7 -0
- package/dist/module/features/endOfAssignment/model/model.js.map +1 -1
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +2 -2
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts +10 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts +1 -3
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts +3 -1
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts +2 -2
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +3 -2
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts +10 -0
- package/dist/typescript/module/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts +1 -3
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts +3 -1
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts +1 -0
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/types.d.ts +2 -2
- package/dist/typescript/module/features/endOfAssignment/types.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +3 -2
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/endOfAssignment/components/AssessmentScoreCard/AssessmentScoreCard.tsx +43 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +29 -11
- package/src/features/endOfAssignment/components/EOAModal.tsx +2 -9
- package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +6 -6
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +2 -2
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +17 -6
- package/src/features/endOfAssignment/helpers.ts +10 -3
- package/src/features/endOfAssignment/model/model.ts +5 -1
- package/src/features/endOfAssignment/types.ts +2 -1
- package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +4 -3
package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EOAModalContentProps } from '../../types';
|
|
3
|
-
export declare const ExamPaused: ({ textContent, model
|
|
3
|
+
export declare const ExamPaused: ({ textContent, model }: EOAModalContentProps) => React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=ExamPaused.d.ts.map
|
package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExamPaused.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ExamPaused.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMlD,eAAO,MAAM,UAAU,2BAA4B,oBAAoB,sBAgCtE,CAAA"}
|
package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExamSubmit.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ExamSubmit.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAezB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMlD,eAAO,MAAM,UAAU,4CAA6C,oBAAoB,sBAqDvF,CAAA"}
|
package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"NoAnswer.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAOlD,eAAO,MAAM,QAAQ,4CAA6C,oBAAoB,sBAgGrF,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EOAModalVariant } from './types';
|
|
1
|
+
import { EOAModalData, EOAModalVariant } from './types';
|
|
2
|
+
import { ButtonColor } from '@magmamath/react-native-ui';
|
|
2
3
|
export declare const getModalContainerSize: (modalVariant: EOAModalVariant) => {
|
|
3
4
|
container: {
|
|
4
5
|
width: number;
|
|
@@ -6,4 +7,5 @@ export declare const getModalContainerSize: (modalVariant: EOAModalVariant) => {
|
|
|
6
7
|
};
|
|
7
8
|
};
|
|
8
9
|
export declare const shouldDisplayModalBackground: (modalVariant: EOAModalVariant | null) => boolean;
|
|
10
|
+
export declare const getEoaButtonColor: (popupData: EOAModalData | null) => ButtonColor;
|
|
9
11
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/endOfAssignment/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/endOfAssignment/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,eAAO,MAAM,qBAAqB,iBAAkB,eAAe;;;;;CAkBlE,CAAA;AAED,eAAO,MAAM,4BAA4B,iBAAkB,eAAe,GAAG,IAAI,YAIhF,CAAA;AAED,eAAO,MAAM,iBAAiB,cAAe,YAAY,GAAG,IAAI,KAAG,WAIlE,CAAA"}
|
|
@@ -6,6 +6,7 @@ export declare class EOAModel {
|
|
|
6
6
|
readonly leavePressed: import("effector").EventCallable<void>;
|
|
7
7
|
readonly goToFirstProblemPressed: import("effector").EventCallable<void>;
|
|
8
8
|
readonly recommendationsUpdated: import("effector").EventCallable<boolean>;
|
|
9
|
+
readonly popUpStatsUpdated: import("effector").EventCallable<any>;
|
|
9
10
|
readonly popUpTriggered: import("effector").EventCallable<EOAEventType>;
|
|
10
11
|
readonly $popUpData: import("effector").StoreWritable<EOAModalData | null>;
|
|
11
12
|
readonly $modalVariant: import("effector").StoreWritable<EOAModalVariant | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/model/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEtE,qBAAa,QAAQ;IACnB,SAAgB,SAAS,iDAA8B;IACvD,SAAgB,SAAS,yCAAgB;IAEzC,SAAgB,eAAe,yCAAgB;IAC/C,SAAgB,YAAY,yCAAgB;IAC5C,SAAgB,uBAAuB,yCAAgB;IACvD,SAAgB,sBAAsB,4CAAyB;IAC/D,SAAgB,cAAc,iDAA8B;IAE5D,SAAgB,UAAU,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/model/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEtE,qBAAa,QAAQ;IACnB,SAAgB,SAAS,iDAA8B;IACvD,SAAgB,SAAS,yCAAgB;IAEzC,SAAgB,eAAe,yCAAgB;IAC/C,SAAgB,YAAY,yCAAgB;IAC5C,SAAgB,uBAAuB,yCAAgB;IACvD,SAAgB,sBAAsB,4CAAyB;IAC/D,SAAgB,iBAAiB,wCAAqB;IACtD,SAAgB,cAAc,iDAA8B;IAE5D,SAAgB,UAAU,wDAQF;IAExB,SAAgB,aAAa,2DAgCL;IAExB,SAAgB,iBAAiB,aAGhC;CACF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EOAModel } from './model/model';
|
|
2
|
-
import { ButtonColor } from '@magmamath/react-native-ui';
|
|
3
2
|
export declare enum EOAEventType {
|
|
4
3
|
SUBMIT = "SUBMIT",
|
|
5
4
|
EXAM_LEAVE = "EXAM_LEAVE",
|
|
@@ -27,10 +26,10 @@ export type EOAModalContentProps = {
|
|
|
27
26
|
textContent: EOAModalText;
|
|
28
27
|
model: EOAModel;
|
|
29
28
|
onPracticePress?: () => void;
|
|
30
|
-
buttonColor?: ButtonColor;
|
|
31
29
|
};
|
|
32
30
|
export type EOAModalData = {
|
|
33
31
|
isExam: boolean;
|
|
32
|
+
isAssessment: boolean;
|
|
34
33
|
newerAssignmentAvailable?: boolean;
|
|
35
34
|
examFinished?: boolean;
|
|
36
35
|
cheatDetection?: boolean;
|
|
@@ -58,6 +57,7 @@ export type EOAModalText = {
|
|
|
58
57
|
correctAnswersPlural?: string;
|
|
59
58
|
goodCalculations?: string;
|
|
60
59
|
goodCalculationsPlural?: string;
|
|
60
|
+
score?: string;
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/endOfAssignment/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/endOfAssignment/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;CAClC;AAED,oBAAY,eAAe;IACzB,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IAErC,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAE3B,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,6BAA6B,kCAAkC;IAE/D,iCAAiC,sCAAsC;IACvE,gCAAgC,qCAAqC;CACtE;AAED,oBAAY,mBAAmB;IAC7B,YAAY,gBAAgB;IAC5B,cAAc,mBAAmB;CAClC;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,YAAY,CAAA;IACzB,KAAK,EAAE,QAAQ,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,OAAO,CAAA;IACf,YAAY,EAAE,OAAO,CAAA;IACrB,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAA;QACpB,iBAAiB,EAAE,MAAM,CAAA;QACzB,cAAc,EAAE,MAAM,CAAA;KACvB,CAAA;IACD,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,IAAI,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,OAAO,CAAC;QAAC,qBAAqB,EAAE,OAAO,CAAA;KAAE,CAAA;CACnF,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,KAAK,CAAC,EAAE;QACN,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,oBAAoB,CAAC,EAAE,MAAM,CAAA;QAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAA;QACzB,sBAAsB,CAAC,EAAE,MAAM,CAAA;QAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACF,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ButtonColor } from '@magmamath/react-native-ui';
|
|
2
3
|
type PracticeButtonGroupProps = {
|
|
3
4
|
textContent: {
|
|
4
5
|
leftButtonText?: string;
|
|
@@ -7,8 +8,8 @@ type PracticeButtonGroupProps = {
|
|
|
7
8
|
isPracticeButtonVisible: boolean;
|
|
8
9
|
onLeftButtonPress: () => void;
|
|
9
10
|
onRightButtonPress: () => void;
|
|
10
|
-
|
|
11
|
+
buttonColor: ButtonColor;
|
|
11
12
|
};
|
|
12
|
-
export declare const PracticeButtonGroup: ({ textContent, isPracticeButtonVisible, onLeftButtonPress, onRightButtonPress,
|
|
13
|
+
export declare const PracticeButtonGroup: ({ textContent, isPracticeButtonVisible, onLeftButtonPress, onRightButtonPress, buttonColor, }: PracticeButtonGroupProps) => React.JSX.Element;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=PracticeButtonGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PracticeButtonGroup.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/ui/PracticeButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"PracticeButtonGroup.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/ui/PracticeButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAUxC,OAAO,EAA8C,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAKpG,KAAK,wBAAwB,GAAG;IAC9B,WAAW,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAClE,uBAAuB,EAAE,OAAO,CAAA;IAChC,iBAAiB,EAAE,MAAM,IAAI,CAAA;IAC7B,kBAAkB,EAAE,MAAM,IAAI,CAAA;IAC9B,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,mBAAmB,kGAM7B,wBAAwB,sBAiC1B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1-rc.1",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"react-native-svg": "^15.10.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@magmamath/react-native-ui": "0.4.
|
|
32
|
+
"@magmamath/react-native-ui": "0.4.42-rc.12",
|
|
33
33
|
"@react-native/eslint-config": "^0.73.1",
|
|
34
34
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
35
35
|
"@types/jest": "^29.5.5",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native'
|
|
3
|
+
import { BORDER_RADIUS, COLORS, SHADOWS, SPACING } from '@magmamath/react-native-ui'
|
|
4
|
+
import { EOAModalText } from '@magmamath/students-features'
|
|
5
|
+
|
|
6
|
+
type AssessmentScoreCardProps = {
|
|
7
|
+
textContent: EOAModalText
|
|
8
|
+
solvedAmount?: number
|
|
9
|
+
problemsAmount?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const AssessmentScoreCard = ({
|
|
13
|
+
textContent,
|
|
14
|
+
solvedAmount = 0,
|
|
15
|
+
problemsAmount = 0,
|
|
16
|
+
}: AssessmentScoreCardProps) => {
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.container}>
|
|
19
|
+
<Text style={styles.text}>
|
|
20
|
+
{solvedAmount} / {problemsAmount} {textContent.stats?.score ?? 'pt'}
|
|
21
|
+
</Text>
|
|
22
|
+
</View>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
container: {
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
minHeight: 130,
|
|
31
|
+
minWidth: 410,
|
|
32
|
+
padding: SPACING['400'],
|
|
33
|
+
borderRadius: BORDER_RADIUS['400'],
|
|
34
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
35
|
+
...SHADOWS['1'],
|
|
36
|
+
},
|
|
37
|
+
text: {
|
|
38
|
+
fontSize: 96,
|
|
39
|
+
fontWeight: '700',
|
|
40
|
+
color: COLORS.NEUTRAL_9,
|
|
41
|
+
fontFamily: 'Buenos Aires',
|
|
42
|
+
},
|
|
43
|
+
})
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react'
|
|
2
|
-
import { View, StyleSheet } from 'react-native'
|
|
2
|
+
import { View, StyleSheet, Text } from 'react-native'
|
|
3
3
|
|
|
4
4
|
import { useUnit } from 'effector-react'
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
SPACING,
|
|
7
|
+
Typography,
|
|
8
|
+
COLORS,
|
|
9
|
+
FONT_FAMILY,
|
|
10
|
+
BORDER_RADIUS,
|
|
11
|
+
SHADOWS,
|
|
12
|
+
} from '@magmamath/react-native-ui'
|
|
6
13
|
|
|
7
14
|
import { AnimatedCard } from './AnimatedCard'
|
|
8
15
|
|
|
@@ -11,6 +18,8 @@ import { GOOD_DRAWING_CARD_APPEARENCE_DELAY } from '../../constants'
|
|
|
11
18
|
import { AnimatedCardVariant, EOAModalContentProps, EOAModalVariant } from '../../types'
|
|
12
19
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
13
20
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
21
|
+
import { getEoaButtonColor } from '../../helpers'
|
|
22
|
+
import { AssessmentScoreCard } from '../AssessmentScoreCard/AssessmentScoreCard'
|
|
14
23
|
|
|
15
24
|
export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
|
|
16
25
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -22,6 +31,7 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
22
31
|
stats,
|
|
23
32
|
hasRecommendations,
|
|
24
33
|
isExam = false,
|
|
34
|
+
isAssessment = false,
|
|
25
35
|
newerAssignmentAvailable,
|
|
26
36
|
} = popUpData ?? {}
|
|
27
37
|
|
|
@@ -72,14 +82,22 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
72
82
|
</View>
|
|
73
83
|
|
|
74
84
|
<View style={styles.animationContainer}>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
{isAssessment ? (
|
|
86
|
+
<AssessmentScoreCard
|
|
87
|
+
textContent={textContent}
|
|
88
|
+
solvedAmount={stats?.solvedAmount}
|
|
89
|
+
problemsAmount={stats?.problemsAmount}
|
|
90
|
+
/>
|
|
91
|
+
) : (
|
|
92
|
+
<AnimatedCard
|
|
93
|
+
variant={AnimatedCardVariant.CORRECT_ANSWER}
|
|
94
|
+
textContent={textContent}
|
|
95
|
+
solvedAmount={stats?.solvedAmount}
|
|
96
|
+
problemsAmount={stats?.problemsAmount}
|
|
97
|
+
shouldTriggerSparkles={cardsAnimationCompleted}
|
|
98
|
+
onAnimationEnd={onCorrectAnswerAnimationEnd}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
83
101
|
|
|
84
102
|
{modalVariant === EOAModalVariant.HAS_GOOD_DRAWING && (
|
|
85
103
|
<AnimatedCard
|
|
@@ -96,9 +114,9 @@ export const CorrectAnswer = ({ textContent, model, onPracticePress }: EOAModalC
|
|
|
96
114
|
<PracticeButtonGroup
|
|
97
115
|
textContent={textContent}
|
|
98
116
|
isPracticeButtonVisible={isPracticeButtonVisible}
|
|
99
|
-
isExam={isExam}
|
|
100
117
|
onLeftButtonPress={model.hidePopUpAndLeave}
|
|
101
118
|
onRightButtonPress={handlePracticeButtonPress}
|
|
119
|
+
buttonColor={getEoaButtonColor(popUpData)}
|
|
102
120
|
/>
|
|
103
121
|
</View>
|
|
104
122
|
)
|
|
@@ -14,7 +14,6 @@ import { ExamPaused } from './ExamPaused/ExamPaused'
|
|
|
14
14
|
import { ExamSubmit } from './ExamSubmit/ExamSubmit'
|
|
15
15
|
|
|
16
16
|
import { getModalContainerSize, shouldDisplayModalBackground } from '../helpers'
|
|
17
|
-
import { ButtonColor } from '@magmamath/react-native-ui'
|
|
18
17
|
|
|
19
18
|
const MODAL_CONTENT_VARIANTS_MAP = new Map([
|
|
20
19
|
[EOAModalVariant.NO_CORRECT_ANSWERS, NoAnswer],
|
|
@@ -33,7 +32,6 @@ type EOAModalProps = {
|
|
|
33
32
|
model: EOAModel
|
|
34
33
|
textContent: EOAModalText
|
|
35
34
|
onPracticePress: () => void
|
|
36
|
-
buttonColor?: ButtonColor
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
/**
|
|
@@ -42,7 +40,7 @@ type EOAModalProps = {
|
|
|
42
40
|
* Dynamically renders a modal UI after an assignment ends, using the current `modalVariant`
|
|
43
41
|
* to determine which specific view to display (e.g., `NoAnswer`, `CorrectAnswer`, `CheatDetected`).
|
|
44
42
|
*/
|
|
45
|
-
export const EOAModal = ({ model, textContent, onPracticePress
|
|
43
|
+
export const EOAModal = ({ model, textContent, onPracticePress }: EOAModalProps) => {
|
|
46
44
|
const popUpData = useUnit(model.$popUpData)
|
|
47
45
|
const modalVariant = useUnit(model.$modalVariant)
|
|
48
46
|
|
|
@@ -64,12 +62,7 @@ export const EOAModal = ({ model, textContent, onPracticePress, buttonColor }: E
|
|
|
64
62
|
style={getModalContainerSize(modalVariant)}
|
|
65
63
|
onClose={model.hidePopUp}
|
|
66
64
|
content={
|
|
67
|
-
<ModalContent
|
|
68
|
-
model={model}
|
|
69
|
-
textContent={textContent}
|
|
70
|
-
onPracticePress={onPracticePress}
|
|
71
|
-
buttonColor={buttonColor}
|
|
72
|
-
/>
|
|
65
|
+
<ModalContent model={model} textContent={textContent} onPracticePress={onPracticePress} />
|
|
73
66
|
}
|
|
74
67
|
withBackground={withBackground}
|
|
75
68
|
/>
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
import { EOAModalContentProps } from '../../types'
|
|
14
14
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
15
15
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
16
|
+
import { getEoaButtonColor } from '../../helpers'
|
|
17
|
+
import { useUnit } from 'effector-react'
|
|
18
|
+
|
|
19
|
+
export const ExamPaused = ({ textContent, model }: EOAModalContentProps) => {
|
|
20
|
+
const popUpData = useUnit(model.$popUpData)
|
|
16
21
|
|
|
17
|
-
export const ExamPaused = ({
|
|
18
|
-
textContent,
|
|
19
|
-
model,
|
|
20
|
-
buttonColor = ButtonColor.PURPLE,
|
|
21
|
-
}: EOAModalContentProps) => {
|
|
22
22
|
useKeyBoard({
|
|
23
23
|
callback: (event) => {
|
|
24
24
|
if (event.key === KeyboardKeys.ENTER) {
|
|
@@ -39,7 +39,7 @@ export const ExamPaused = ({
|
|
|
39
39
|
|
|
40
40
|
<Button
|
|
41
41
|
variant={ButtonVariant.PRIMARY}
|
|
42
|
-
colorScheme={
|
|
42
|
+
colorScheme={getEoaButtonColor(popUpData)}
|
|
43
43
|
size={ButtonSize.LARGE}
|
|
44
44
|
style={{ text: styles.buttonText }}
|
|
45
45
|
onPress={model.hidePopUpAndLeave}
|
|
@@ -4,7 +4,6 @@ import { View, StyleSheet, Platform, Image } from 'react-native'
|
|
|
4
4
|
import { useUnit } from 'effector-react'
|
|
5
5
|
import {
|
|
6
6
|
Button,
|
|
7
|
-
ButtonColor,
|
|
8
7
|
ButtonSize,
|
|
9
8
|
ButtonVariant,
|
|
10
9
|
COLORS,
|
|
@@ -18,6 +17,7 @@ import { EOAModalContentProps } from '../../types'
|
|
|
18
17
|
import { PracticeButton } from '../../ui/PracticeButton'
|
|
19
18
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
20
19
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
20
|
+
import { getEoaButtonColor } from '../../helpers'
|
|
21
21
|
|
|
22
22
|
export const ExamSubmit = ({ textContent, model, onPracticePress }: EOAModalContentProps) => {
|
|
23
23
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -60,7 +60,7 @@ export const ExamSubmit = ({ textContent, model, onPracticePress }: EOAModalCont
|
|
|
60
60
|
<Button
|
|
61
61
|
variant={isPracticeButtonVisible ? ButtonVariant.TERTIARY : ButtonVariant.PRIMARY}
|
|
62
62
|
size={ButtonSize.LARGE}
|
|
63
|
-
colorScheme={popUpData
|
|
63
|
+
colorScheme={getEoaButtonColor(popUpData)}
|
|
64
64
|
style={{ text: { textTransform: 'uppercase' } }}
|
|
65
65
|
onPress={model.hidePopUpAndLeave}
|
|
66
66
|
>
|
|
@@ -16,17 +16,19 @@ import { EOAModalContentProps } from '../../types'
|
|
|
16
16
|
import { NoAnswerContent } from './NoAnswerContent'
|
|
17
17
|
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
18
18
|
import { KeyboardKeys } from '../../../../lib/constants'
|
|
19
|
+
import { getEoaButtonColor } from '../../helpers'
|
|
20
|
+
import { AssessmentScoreCard } from '../AssessmentScoreCard/AssessmentScoreCard'
|
|
19
21
|
|
|
20
22
|
export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalContentProps) => {
|
|
21
23
|
const popUpData = useUnit(model.$popUpData)
|
|
22
24
|
|
|
23
|
-
const { stats, isExam, user } = popUpData ?? {}
|
|
25
|
+
const { stats, isExam, isAssessment, user } = popUpData ?? {}
|
|
24
26
|
|
|
25
27
|
function getButtons() {
|
|
26
28
|
const buttons = [
|
|
27
29
|
{
|
|
28
30
|
text: textContent.leftButtonText ?? '',
|
|
29
|
-
colorScheme:
|
|
31
|
+
colorScheme: getEoaButtonColor(popUpData),
|
|
30
32
|
onPress: () => model.hidePopUpAndLeave(),
|
|
31
33
|
},
|
|
32
34
|
]
|
|
@@ -84,10 +86,19 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
84
86
|
</Typography>
|
|
85
87
|
)}
|
|
86
88
|
</View>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
{isAssessment ? (
|
|
90
|
+
<AssessmentScoreCard
|
|
91
|
+
textContent={textContent}
|
|
92
|
+
solvedAmount={stats?.solvedAmount}
|
|
93
|
+
problemsAmount={stats?.problemsAmount}
|
|
94
|
+
/>
|
|
95
|
+
) : (
|
|
96
|
+
<NoAnswerContent
|
|
97
|
+
solvedAmount={stats?.solvedAmount ?? 0}
|
|
98
|
+
problemsAmount={stats?.problemsAmount ?? 0}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
|
|
91
102
|
<View style={styles.buttonsContainer}>
|
|
92
103
|
{buttons.map((button, index) => (
|
|
93
104
|
<Button
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { MODALS_WITH_BACKGROUND } from './constants'
|
|
2
|
-
import { EOAModalVariant } from './types'
|
|
2
|
+
import { EOAModalData, EOAModalVariant } from './types'
|
|
3
|
+
import { ButtonColor } from '@magmamath/react-native-ui'
|
|
3
4
|
|
|
4
5
|
export const getModalContainerSize = (modalVariant: EOAModalVariant) => {
|
|
5
6
|
switch (modalVariant) {
|
|
6
7
|
case EOAModalVariant.EXAM_SUBMIT:
|
|
7
8
|
case EOAModalVariant.EXAM_SAFE_MODE_SUBMIT:
|
|
8
|
-
return { container: { width:
|
|
9
|
+
return { container: { width: 620, height: 384 } }
|
|
9
10
|
case EOAModalVariant.EXAM_PAUSED:
|
|
10
11
|
case EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED:
|
|
11
12
|
return { container: { width: 560, height: 338 } }
|
|
12
13
|
case EOAModalVariant.EXAM_SAFE_MODE_LEAVE:
|
|
13
|
-
return { container: { width: 550, height:
|
|
14
|
+
return { container: { width: 550, height: 325 } }
|
|
14
15
|
case EOAModalVariant.HAS_GOOD_DRAWING:
|
|
15
16
|
return { container: { width: 957, height: 550 } }
|
|
16
17
|
case EOAModalVariant.HAS_CORRECT_ANSWERS:
|
|
@@ -26,3 +27,9 @@ export const shouldDisplayModalBackground = (modalVariant: EOAModalVariant | nul
|
|
|
26
27
|
|
|
27
28
|
return MODALS_WITH_BACKGROUND.includes(modalVariant)
|
|
28
29
|
}
|
|
30
|
+
|
|
31
|
+
export const getEoaButtonColor = (popupData: EOAModalData | null): ButtonColor => {
|
|
32
|
+
if (popupData?.isAssessment) return ButtonColor.SUNSET
|
|
33
|
+
if (popupData?.isExam) return ButtonColor.PURPLE
|
|
34
|
+
return ButtonColor.BLUE
|
|
35
|
+
}
|
|
@@ -9,6 +9,7 @@ export class EOAModel {
|
|
|
9
9
|
public readonly leavePressed = createEvent()
|
|
10
10
|
public readonly goToFirstProblemPressed = createEvent()
|
|
11
11
|
public readonly recommendationsUpdated = createEvent<boolean>()
|
|
12
|
+
public readonly popUpStatsUpdated = createEvent<any>()
|
|
12
13
|
public readonly popUpTriggered = createEvent<EOAEventType>()
|
|
13
14
|
|
|
14
15
|
public readonly $popUpData = createStore<EOAModalData | null>(null)
|
|
@@ -16,6 +17,9 @@ export class EOAModel {
|
|
|
16
17
|
.on(this.recommendationsUpdated, (state, hasRecommendations) =>
|
|
17
18
|
state ? { ...state, hasRecommendations } : state,
|
|
18
19
|
)
|
|
20
|
+
.on(this.popUpStatsUpdated, (state, payload) =>
|
|
21
|
+
state ? { ...state, stats: { ...state.stats, ...payload } } : state,
|
|
22
|
+
)
|
|
19
23
|
.reset(this.hidePopUp)
|
|
20
24
|
|
|
21
25
|
public readonly $modalVariant = createStore<EOAModalVariant | null>(null)
|
|
@@ -33,7 +37,7 @@ export class EOAModel {
|
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
if (eventType === EOAEventType.EXAM_PAUSED) return EOAModalVariant.EXAM_PAUSED
|
|
36
|
-
|
|
40
|
+
|
|
37
41
|
if (eventType === EOAEventType.CHEAT_DETECTED) {
|
|
38
42
|
return EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED
|
|
39
43
|
}
|
|
@@ -34,11 +34,11 @@ export type EOAModalContentProps = {
|
|
|
34
34
|
textContent: EOAModalText
|
|
35
35
|
model: EOAModel
|
|
36
36
|
onPracticePress?: () => void
|
|
37
|
-
buttonColor?: ButtonColor
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
export type EOAModalData = {
|
|
41
40
|
isExam: boolean
|
|
41
|
+
isAssessment: boolean
|
|
42
42
|
newerAssignmentAvailable?: boolean
|
|
43
43
|
examFinished?: boolean
|
|
44
44
|
cheatDetection?: boolean
|
|
@@ -63,5 +63,6 @@ export type EOAModalText = {
|
|
|
63
63
|
correctAnswersPlural?: string
|
|
64
64
|
goodCalculations?: string
|
|
65
65
|
goodCalculationsPlural?: string
|
|
66
|
+
score?: string
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -11,13 +11,14 @@ import Animated, {
|
|
|
11
11
|
import { ButtonVariant, SPACING, Button, ButtonSize, ButtonColor } from '@magmamath/react-native-ui'
|
|
12
12
|
|
|
13
13
|
import { PracticeButton } from './PracticeButton'
|
|
14
|
+
import { getEoaButtonColor } from '../helpers'
|
|
14
15
|
|
|
15
16
|
type PracticeButtonGroupProps = {
|
|
16
17
|
textContent: { leftButtonText?: string; rightButtonText?: string }
|
|
17
18
|
isPracticeButtonVisible: boolean
|
|
18
19
|
onLeftButtonPress: () => void
|
|
19
20
|
onRightButtonPress: () => void
|
|
20
|
-
|
|
21
|
+
buttonColor: ButtonColor
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export const PracticeButtonGroup = ({
|
|
@@ -25,7 +26,7 @@ export const PracticeButtonGroup = ({
|
|
|
25
26
|
isPracticeButtonVisible,
|
|
26
27
|
onLeftButtonPress,
|
|
27
28
|
onRightButtonPress,
|
|
28
|
-
|
|
29
|
+
buttonColor = ButtonColor.BLUE,
|
|
29
30
|
}: PracticeButtonGroupProps) => {
|
|
30
31
|
const buttonsContainerOpacity = useSharedValue(0)
|
|
31
32
|
|
|
@@ -45,7 +46,7 @@ export const PracticeButtonGroup = ({
|
|
|
45
46
|
<Button
|
|
46
47
|
variant={isPracticeButtonVisible ? ButtonVariant.TERTIARY : ButtonVariant.PRIMARY}
|
|
47
48
|
size={ButtonSize.LARGE}
|
|
48
|
-
colorScheme={
|
|
49
|
+
colorScheme={buttonColor}
|
|
49
50
|
style={{ text: { textTransform: 'uppercase' } }}
|
|
50
51
|
onPress={onLeftButtonPress}
|
|
51
52
|
>
|