@magmamath/students-features 0.4.1 → 0.4.3-rc-0
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/celebrations/components/Particle.js +2 -1
- package/dist/commonjs/features/celebrations/components/Particle.js.map +1 -1
- package/dist/commonjs/features/celebrations/config.js +10 -10
- package/dist/commonjs/features/celebrations/config.js.map +1 -1
- package/dist/commonjs/features/celebrations/helpers.js +2 -2
- package/dist/commonjs/features/celebrations/helpers.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +5 -2
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js +2 -2
- package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +3 -2
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js +2 -2
- package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +2 -2
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +2 -2
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +24 -14
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +0 -1
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/constants.js +1 -5
- package/dist/commonjs/features/endOfAssignment/constants.js.map +1 -1
- package/dist/commonjs/lib/constants.js +11 -0
- package/dist/commonjs/lib/constants.js.map +1 -0
- package/dist/commonjs/lib/helpers/helpers.js +3 -1
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
- package/dist/commonjs/{features/endOfAssignment → shared}/hooks/useKeyDownListener.js +1 -1
- package/dist/commonjs/shared/hooks/useKeyDownListener.js.map +1 -0
- package/dist/commonjs/{features/endOfAssignment → shared}/hooks/useKeyboard.js +2 -3
- package/dist/commonjs/shared/hooks/useKeyboard.js.map +1 -0
- package/dist/module/features/celebrations/components/Particle.js +2 -1
- package/dist/module/features/celebrations/components/Particle.js.map +1 -1
- package/dist/module/features/celebrations/config.js +10 -10
- package/dist/module/features/celebrations/config.js.map +1 -1
- package/dist/module/features/celebrations/helpers.js +2 -2
- package/dist/module/features/celebrations/helpers.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +5 -2
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js +2 -2
- package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +3 -2
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js +2 -2
- package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +2 -2
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +2 -2
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +24 -14
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +0 -1
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -1
- package/dist/module/features/endOfAssignment/constants.js +0 -4
- package/dist/module/features/endOfAssignment/constants.js.map +1 -1
- package/dist/module/lib/constants.js +7 -0
- package/dist/module/lib/constants.js.map +1 -0
- package/dist/module/lib/helpers/helpers.js +1 -0
- package/dist/module/lib/helpers/helpers.js.map +1 -1
- package/dist/module/{features/endOfAssignment → shared}/hooks/useKeyDownListener.js +1 -1
- package/dist/module/shared/hooks/useKeyDownListener.js.map +1 -0
- package/dist/module/{features/endOfAssignment → shared}/hooks/useKeyboard.js +1 -1
- package/dist/module/shared/hooks/useKeyboard.js.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.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/constants.d.ts +0 -3
- package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/constants.d.ts +4 -0
- package/dist/typescript/commonjs/lib/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts +1 -0
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/{features/endOfAssignment → shared}/hooks/useKeyDownListener.d.ts +1 -1
- package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts.map +1 -0
- package/dist/typescript/commonjs/{features/endOfAssignment → shared}/hooks/useKeyboard.d.ts +1 -1
- package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/components/Particle.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.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/constants.d.ts +0 -3
- package/dist/typescript/module/features/endOfAssignment/constants.d.ts.map +1 -1
- package/dist/typescript/module/lib/constants.d.ts +4 -0
- package/dist/typescript/module/lib/constants.d.ts.map +1 -0
- package/dist/typescript/module/lib/helpers/helpers.d.ts +1 -0
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/module/{features/endOfAssignment → shared}/hooks/useKeyDownListener.d.ts +1 -1
- package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts.map +1 -0
- package/dist/typescript/module/{features/endOfAssignment → shared}/hooks/useKeyboard.d.ts +1 -1
- package/dist/typescript/module/shared/hooks/useKeyboard.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/features/celebrations/components/Particle.tsx +3 -1
- package/src/features/celebrations/config.ts +10 -10
- package/src/features/celebrations/helpers.ts +2 -2
- package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +5 -2
- package/src/features/endOfAssignment/components/CheatDetected/CheatDetected.tsx +2 -2
- package/src/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.tsx +0 -1
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +3 -2
- package/src/features/endOfAssignment/components/ExamLeave/ExamLeave.tsx +2 -2
- package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +2 -2
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +2 -2
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +19 -9
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswerContent.tsx +0 -1
- package/src/features/endOfAssignment/constants.ts +0 -4
- package/src/lib/constants.ts +3 -0
- package/src/lib/helpers/helpers.ts +2 -0
- package/src/{features/endOfAssignment → shared}/hooks/useKeyDownListener.ts +2 -1
- package/src/{features/endOfAssignment → shared}/hooks/useKeyboard.ts +2 -3
- package/dist/commonjs/features/endOfAssignment/hooks/useKeyDownListener.js.map +0 -1
- package/dist/commonjs/features/endOfAssignment/hooks/useKeyboard.js.map +0 -1
- package/dist/module/features/endOfAssignment/hooks/useKeyDownListener.js.map +0 -1
- package/dist/module/features/endOfAssignment/hooks/useKeyboard.js.map +0 -1
- package/dist/typescript/commonjs/features/endOfAssignment/hooks/useKeyDownListener.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/endOfAssignment/hooks/useKeyboard.d.ts.map +0 -1
- package/dist/typescript/module/features/endOfAssignment/hooks/useKeyDownListener.d.ts.map +0 -1
- package/dist/typescript/module/features/endOfAssignment/hooks/useKeyboard.d.ts.map +0 -1
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
import { EOAModalContentProps } from '../../types'
|
|
14
14
|
import { NoAnswerContent } from './NoAnswerContent'
|
|
15
15
|
import { PracticeButton } from '../../ui/PracticeButton'
|
|
16
|
-
import { useKeyBoard } from '
|
|
17
|
-
import { KeyboardKeys } from '
|
|
16
|
+
import { useKeyBoard } from '../../../../shared/hooks/useKeyboard'
|
|
17
|
+
import { KeyboardKeys } from '../../../../lib/constants'
|
|
18
18
|
|
|
19
19
|
export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalContentProps) => {
|
|
20
20
|
const popUpData = useUnit(model.$popUpData)
|
|
@@ -24,8 +24,7 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
24
24
|
const total = stats?.problemsAmount ?? 0
|
|
25
25
|
const buttonColorScheme = isExam ? ButtonColor.YELLOW : ButtonColor.BLUE
|
|
26
26
|
|
|
27
|
-
const practiceButtonVisible =
|
|
28
|
-
!popUpData?.newerAssignmentAvailable && (!isExam || (isExam && !!user?.practiceMode))
|
|
27
|
+
const practiceButtonVisible = !isExam || !!user?.practiceMode
|
|
29
28
|
|
|
30
29
|
const handlePrimaryButtonPress = () => {
|
|
31
30
|
isExam ? onPracticePress?.() : model.goToFirstProblemPressed()
|
|
@@ -40,14 +39,14 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
40
39
|
|
|
41
40
|
return (
|
|
42
41
|
<View style={styles.container}>
|
|
43
|
-
<View style={styles.
|
|
42
|
+
<View style={styles.textContainer}>
|
|
44
43
|
{!!textContent.title && (
|
|
45
|
-
<Typography variant="h2" style={
|
|
44
|
+
<Typography variant="h2" style={styles.title}>
|
|
46
45
|
{textContent.title}
|
|
47
46
|
</Typography>
|
|
48
47
|
)}
|
|
49
|
-
{!!textContent.subtitle && (
|
|
50
|
-
<Typography variant="h4" style={
|
|
48
|
+
{!!textContent.subtitle && practiceButtonVisible && (
|
|
49
|
+
<Typography variant="h4" style={styles.subtitle}>
|
|
51
50
|
{textContent.subtitle}
|
|
52
51
|
</Typography>
|
|
53
52
|
)}
|
|
@@ -78,14 +77,25 @@ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalConten
|
|
|
78
77
|
|
|
79
78
|
const styles = StyleSheet.create({
|
|
80
79
|
container: {
|
|
80
|
+
height: '100%',
|
|
81
81
|
gap: SPACING[400],
|
|
82
82
|
alignItems: 'center',
|
|
83
|
+
justifyContent: 'space-between',
|
|
83
84
|
},
|
|
84
85
|
buttonsContainer: {
|
|
85
86
|
flexDirection: 'row',
|
|
86
87
|
alignItems: 'center',
|
|
88
|
+
justifyContent: 'flex-end',
|
|
87
89
|
gap: SPACING[200],
|
|
88
|
-
|
|
90
|
+
},
|
|
91
|
+
title: {
|
|
92
|
+
color: COLORS.NEUTRAL_9,
|
|
93
|
+
marginBottom: SPACING[400],
|
|
94
|
+
paddingVertical: SPACING[100],
|
|
95
|
+
},
|
|
96
|
+
subtitle: { color: COLORS.NEUTRAL_7, paddingVertical: SPACING[100] },
|
|
97
|
+
textContainer: {
|
|
98
|
+
alignItems: 'center',
|
|
89
99
|
},
|
|
90
100
|
buttonText: {
|
|
91
101
|
textTransform: 'uppercase',
|
|
@@ -5,10 +5,6 @@ import { AnimatedCardVariant, EOAModalVariant } from './types'
|
|
|
5
5
|
export const SPARKS_ANIMATION_DELAY = 2000
|
|
6
6
|
export const GOOD_DRAWING_CARD_APPEARENCE_DELAY = 1800
|
|
7
7
|
|
|
8
|
-
export enum KeyboardKeys {
|
|
9
|
-
ENTER = 'Enter',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
8
|
export const MODALS_WITH_BACKGROUND = [
|
|
13
9
|
EOAModalVariant.HAS_CORRECT_ANSWERS,
|
|
14
10
|
EOAModalVariant.HAS_GOOD_DRAWING,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
|
-
import { useKeyDownListener } from './useKeyDownListener';
|
|
3
|
-
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
import { useKeyDownListener } from './useKeyDownListener';
|
|
4
|
+
import { noop } from '../../lib/helpers/helpers';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* A cross-platform hook for handling keyboard events.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_constants","useKeyDownListener","callback","overrideKeys","KeyboardKeys","ENTER","callbackRef","useRef","current","useEffect","eventHandler","event","includes","key","preventDefault","stopPropagation","document","addEventListener","removeEventListener","exports"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/hooks/useKeyDownListener.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,kBAAkB,GAAGA,CAChCC,QAAwC,EACxCC,YAAY,GAAG,CAACC,uBAAY,CAACC,KAAK,CAAC,KAChC;EACH,MAAMC,WAAW,GAAG,IAAAC,aAAM,EAACL,QAAQ,CAAC;EACpCI,WAAW,CAACE,OAAO,GAAGN,QAAQ;EAE9B,IAAAO,gBAAS,EAAC,MAAM;IACd,MAAMC,YAAY,GAAIC,KAAoB,IAAK;MAC7C,IAAIR,YAAY,CAACS,QAAQ,CAACD,KAAK,CAACE,GAAmB,CAAC,EAAE;QACpDF,KAAK,CAACG,cAAc,CAAC,CAAC;QACtBH,KAAK,CAACI,eAAe,CAAC,CAAC;MACzB;MAEAT,WAAW,CAACE,OAAO,CAACG,KAAK,CAAC;IAC5B,CAAC;IAEDK,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEP,YAAY,EAAE,IAAI,CAAC;IACxD,OAAO,MAAM;MACXM,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAER,YAAY,EAAE,IAAI,CAAC;IAC7D,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAAAS,OAAA,CAAAlB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_useKeyDownListener","noop","useKeyBoard","exports","Platform","select","native","default","useKeyDownListener"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/hooks/useKeyboard.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAGA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,qBAAQ,CAACC,MAAM,CAAC;EACzCC,MAAM,EAAEL,IAAI;EACZM,OAAO,EAAEC;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","KeyboardKeys","useKeyDownListener","callback","overrideKeys","ENTER","callbackRef","current","eventHandler","event","includes","key","preventDefault","stopPropagation","document","addEventListener","removeEventListener"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/hooks/useKeyDownListener.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,YAAY,QAAQ,iBAAc;AAE3C,OAAO,MAAMC,kBAAkB,GAAGA,CAChCC,QAAwC,EACxCC,YAAY,GAAG,CAACH,YAAY,CAACI,KAAK,CAAC,KAChC;EACH,MAAMC,WAAW,GAAGN,MAAM,CAACG,QAAQ,CAAC;EACpCG,WAAW,CAACC,OAAO,GAAGJ,QAAQ;EAE9BJ,SAAS,CAAC,MAAM;IACd,MAAMS,YAAY,GAAIC,KAAoB,IAAK;MAC7C,IAAIL,YAAY,CAACM,QAAQ,CAACD,KAAK,CAACE,GAAmB,CAAC,EAAE;QACpDF,KAAK,CAACG,cAAc,CAAC,CAAC;QACtBH,KAAK,CAACI,eAAe,CAAC,CAAC;MACzB;MAEAP,WAAW,CAACC,OAAO,CAACE,KAAK,CAAC;IAC5B,CAAC;IAEDK,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEP,YAAY,EAAE,IAAI,CAAC;IACxD,OAAO,MAAM;MACXM,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAER,YAAY,EAAE,IAAI,CAAC;IAC7D,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","useKeyDownListener","noop","useKeyBoard","select","native","default"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/hooks/useKeyboard.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,kBAAkB,QAAQ,yBAAsB;AAGzD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGH,QAAQ,CAACI,MAAM,CAAC;EACzCC,MAAM,EAAEH,IAAI;EACZI,OAAO,EAAEL;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyDownListener.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/hooks/useKeyDownListener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,eAAO,MAAM,kBAAkB,aACnB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,wCAqBzC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/hooks/useKeyboard.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,0GAGtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyDownListener.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/hooks/useKeyDownListener.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,eAAO,MAAM,kBAAkB,aACnB,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,wCAqBzC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/endOfAssignment/hooks/useKeyboard.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,0GAGtB,CAAC"}
|