@magmamath/students-features 0.3.3 → 0.4.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.
Files changed (391) hide show
  1. package/dist/commonjs/features/celebrations/components/Celebrations.js +51 -0
  2. package/dist/commonjs/features/celebrations/components/Celebrations.js.map +1 -0
  3. package/dist/commonjs/features/celebrations/components/Particle.js +84 -0
  4. package/dist/commonjs/features/celebrations/components/Particle.js.map +1 -0
  5. package/dist/commonjs/features/celebrations/components/ParticleBatch.js +45 -0
  6. package/dist/commonjs/features/celebrations/components/ParticleBatch.js.map +1 -0
  7. package/dist/commonjs/features/celebrations/components/Spark.js +23 -0
  8. package/dist/commonjs/features/celebrations/components/Spark.js.map +1 -0
  9. package/dist/commonjs/features/celebrations/config.js +199 -0
  10. package/dist/commonjs/features/celebrations/config.js.map +1 -0
  11. package/dist/commonjs/features/celebrations/helpers.js +94 -0
  12. package/dist/commonjs/features/celebrations/helpers.js.map +1 -0
  13. package/dist/commonjs/features/celebrations/index.js +28 -0
  14. package/dist/commonjs/features/celebrations/index.js.map +1 -0
  15. package/dist/commonjs/features/celebrations/types.js +15 -0
  16. package/dist/commonjs/features/celebrations/types.js.map +1 -0
  17. package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js +58 -0
  18. package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -0
  19. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +247 -0
  20. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -0
  21. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +131 -0
  22. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -0
  23. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +56 -0
  24. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +1 -0
  25. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +68 -0
  26. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +1 -0
  27. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js +53 -0
  28. package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +1 -0
  29. package/dist/commonjs/features/endOfAssignment/components/EOAModal.js +47 -0
  30. package/dist/commonjs/features/endOfAssignment/components/EOAModal.js.map +1 -0
  31. package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js +69 -0
  32. package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -0
  33. package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +55 -0
  34. package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -0
  35. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +102 -0
  36. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -0
  37. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +83 -0
  38. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +1 -0
  39. package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  40. package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js +96 -0
  41. package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js.map +1 -0
  42. package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js +44 -0
  43. package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -0
  44. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +233 -0
  45. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -0
  46. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +63 -0
  47. package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -0
  48. package/dist/commonjs/features/endOfAssignment/components/Modal/model.js +34 -0
  49. package/dist/commonjs/features/endOfAssignment/components/Modal/model.js.map +1 -0
  50. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +91 -0
  51. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -0
  52. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +107 -0
  53. package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -0
  54. package/dist/commonjs/features/endOfAssignment/constants.js +55 -0
  55. package/dist/commonjs/features/endOfAssignment/constants.js.map +1 -0
  56. package/dist/commonjs/features/endOfAssignment/helpers.js +64 -0
  57. package/dist/commonjs/features/endOfAssignment/helpers.js.map +1 -0
  58. package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js +51 -0
  59. package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js.map +1 -0
  60. package/dist/commonjs/features/endOfAssignment/index.js +40 -0
  61. package/dist/commonjs/features/endOfAssignment/index.js.map +1 -0
  62. package/dist/commonjs/features/endOfAssignment/model/model.js +53 -0
  63. package/dist/commonjs/features/endOfAssignment/model/model.js.map +1 -0
  64. package/dist/commonjs/features/endOfAssignment/types.js +33 -0
  65. package/dist/commonjs/features/endOfAssignment/types.js.map +1 -0
  66. package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js +43 -0
  67. package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js.map +1 -0
  68. package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js +30 -0
  69. package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js.map +1 -0
  70. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +65 -0
  71. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -0
  72. package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js +29 -0
  73. package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js.map +1 -0
  74. package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js +32 -0
  75. package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -0
  76. package/dist/commonjs/index.js +24 -0
  77. package/dist/commonjs/index.js.map +1 -1
  78. package/dist/commonjs/shared/icons/Halloween.js +54 -0
  79. package/dist/commonjs/shared/icons/Halloween.js.map +1 -0
  80. package/dist/commonjs/shared/icons/Pi.js +30 -0
  81. package/dist/commonjs/shared/icons/Pi.js.map +1 -0
  82. package/dist/commonjs/shared/icons/Star.js +30 -0
  83. package/dist/commonjs/shared/icons/Star.js.map +1 -0
  84. package/dist/commonjs/shared/icons/Valentine.js +30 -0
  85. package/dist/commonjs/shared/icons/Valentine.js.map +1 -0
  86. package/dist/commonjs/shared/icons/Winter.js +32 -0
  87. package/dist/commonjs/shared/icons/Winter.js.map +1 -0
  88. package/dist/module/features/celebrations/components/Celebrations.js +45 -0
  89. package/dist/module/features/celebrations/components/Celebrations.js.map +1 -0
  90. package/dist/module/features/celebrations/components/Particle.js +76 -0
  91. package/dist/module/features/celebrations/components/Particle.js.map +1 -0
  92. package/dist/module/features/celebrations/components/ParticleBatch.js +38 -0
  93. package/dist/module/features/celebrations/components/ParticleBatch.js.map +1 -0
  94. package/dist/module/features/celebrations/components/Spark.js +17 -0
  95. package/dist/module/features/celebrations/components/Spark.js.map +1 -0
  96. package/dist/module/features/celebrations/config.js +194 -0
  97. package/dist/module/features/celebrations/config.js.map +1 -0
  98. package/dist/module/features/celebrations/helpers.js +87 -0
  99. package/dist/module/features/celebrations/helpers.js.map +1 -0
  100. package/dist/module/features/celebrations/index.js +5 -0
  101. package/dist/module/features/celebrations/index.js.map +1 -0
  102. package/dist/module/features/celebrations/types.js +11 -0
  103. package/dist/module/features/celebrations/types.js.map +1 -0
  104. package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js +52 -0
  105. package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -0
  106. package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +241 -0
  107. package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -0
  108. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +124 -0
  109. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -0
  110. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +50 -0
  111. package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +1 -0
  112. package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +62 -0
  113. package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +1 -0
  114. package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js +47 -0
  115. package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +1 -0
  116. package/dist/module/features/endOfAssignment/components/EOAModal.js +41 -0
  117. package/dist/module/features/endOfAssignment/components/EOAModal.js.map +1 -0
  118. package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js +63 -0
  119. package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -0
  120. package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +49 -0
  121. package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -0
  122. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +96 -0
  123. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -0
  124. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +77 -0
  125. package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +1 -0
  126. package/dist/module/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  127. package/dist/module/features/endOfAssignment/components/Modal/Modal.js +89 -0
  128. package/dist/module/features/endOfAssignment/components/Modal/Modal.js.map +1 -0
  129. package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js +38 -0
  130. package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -0
  131. package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +226 -0
  132. package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -0
  133. package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +56 -0
  134. package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -0
  135. package/dist/module/features/endOfAssignment/components/Modal/model.js +29 -0
  136. package/dist/module/features/endOfAssignment/components/Modal/model.js.map +1 -0
  137. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +85 -0
  138. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -0
  139. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +100 -0
  140. package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -0
  141. package/dist/module/features/endOfAssignment/constants.js +51 -0
  142. package/dist/module/features/endOfAssignment/constants.js.map +1 -0
  143. package/dist/module/features/endOfAssignment/helpers.js +58 -0
  144. package/dist/module/features/endOfAssignment/helpers.js.map +1 -0
  145. package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js +46 -0
  146. package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js.map +1 -0
  147. package/dist/module/features/endOfAssignment/index.js +6 -0
  148. package/dist/module/features/endOfAssignment/index.js.map +1 -0
  149. package/dist/module/features/endOfAssignment/model/model.js +48 -0
  150. package/dist/module/features/endOfAssignment/model/model.js.map +1 -0
  151. package/dist/module/features/endOfAssignment/types.js +29 -0
  152. package/dist/module/features/endOfAssignment/types.js.map +1 -0
  153. package/dist/module/features/endOfAssignment/ui/EOABadge.js +37 -0
  154. package/dist/module/features/endOfAssignment/ui/EOABadge.js.map +1 -0
  155. package/dist/module/features/endOfAssignment/ui/PracticeButton.js +24 -0
  156. package/dist/module/features/endOfAssignment/ui/PracticeButton.js.map +1 -0
  157. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +58 -0
  158. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -0
  159. package/dist/module/features/endOfAssignment/ui/SparkIcon.js +21 -0
  160. package/dist/module/features/endOfAssignment/ui/SparkIcon.js.map +1 -0
  161. package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js +24 -0
  162. package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -0
  163. package/dist/module/index.js +2 -0
  164. package/dist/module/index.js.map +1 -1
  165. package/dist/module/shared/icons/Halloween.js +47 -0
  166. package/dist/module/shared/icons/Halloween.js.map +1 -0
  167. package/dist/module/shared/icons/Pi.js +23 -0
  168. package/dist/module/shared/icons/Pi.js.map +1 -0
  169. package/dist/module/shared/icons/Star.js +23 -0
  170. package/dist/module/shared/icons/Star.js.map +1 -0
  171. package/dist/module/shared/icons/Valentine.js +23 -0
  172. package/dist/module/shared/icons/Valentine.js.map +1 -0
  173. package/dist/module/shared/icons/Winter.js +25 -0
  174. package/dist/module/shared/icons/Winter.js.map +1 -0
  175. package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts +10 -0
  176. package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts.map +1 -0
  177. package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts +19 -0
  178. package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts.map +1 -0
  179. package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts +26 -0
  180. package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts +4 -0
  182. package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/features/celebrations/config.d.ts +167 -0
  184. package/dist/typescript/commonjs/features/celebrations/config.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/features/celebrations/helpers.d.ts +6 -0
  186. package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/features/celebrations/index.d.ts +3 -0
  188. package/dist/typescript/commonjs/features/celebrations/index.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/features/celebrations/types.d.ts +11 -0
  190. package/dist/typescript/commonjs/features/celebrations/types.d.ts.map +1 -0
  191. package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +4 -0
  192. package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +15 -0
  194. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +4 -0
  196. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -0
  197. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +8 -0
  198. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +1 -0
  199. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +8 -0
  200. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +1 -0
  201. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +12 -0
  202. package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +1 -0
  203. package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts +11 -0
  204. package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts.map +1 -0
  205. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +4 -0
  206. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -0
  207. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +4 -0
  208. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -0
  209. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +4 -0
  210. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -0
  211. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +8 -0
  212. package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +1 -0
  213. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts +20 -0
  214. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -0
  215. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts +3 -0
  216. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -0
  217. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +4 -0
  218. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -0
  219. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +4 -0
  220. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -0
  221. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts +14 -0
  222. package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts.map +1 -0
  223. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +4 -0
  224. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -0
  225. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +8 -0
  226. package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +1 -0
  227. package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts +41 -0
  228. package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts.map +1 -0
  229. package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts +9 -0
  230. package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts.map +1 -0
  231. package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts +27 -0
  232. package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +1 -0
  233. package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts +4 -0
  234. package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts.map +1 -0
  235. package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts +14 -0
  236. package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts.map +1 -0
  237. package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts +60 -0
  238. package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts.map +1 -0
  239. package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts +11 -0
  240. package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts.map +1 -0
  241. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts +10 -0
  242. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts.map +1 -0
  243. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +14 -0
  244. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -0
  245. package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts +4 -0
  246. package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -0
  247. package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts +4 -0
  248. package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -0
  249. package/dist/typescript/commonjs/index.d.ts +2 -0
  250. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  251. package/dist/typescript/commonjs/shared/icons/Halloween.d.ts +5 -0
  252. package/dist/typescript/commonjs/shared/icons/Halloween.d.ts.map +1 -0
  253. package/dist/typescript/commonjs/shared/icons/Pi.d.ts +5 -0
  254. package/dist/typescript/commonjs/shared/icons/Pi.d.ts.map +1 -0
  255. package/dist/typescript/commonjs/shared/icons/Star.d.ts +5 -0
  256. package/dist/typescript/commonjs/shared/icons/Star.d.ts.map +1 -0
  257. package/dist/typescript/commonjs/shared/icons/Valentine.d.ts +5 -0
  258. package/dist/typescript/commonjs/shared/icons/Valentine.d.ts.map +1 -0
  259. package/dist/typescript/commonjs/shared/icons/Winter.d.ts +5 -0
  260. package/dist/typescript/commonjs/shared/icons/Winter.d.ts.map +1 -0
  261. package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts +10 -0
  262. package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts.map +1 -0
  263. package/dist/typescript/module/features/celebrations/components/Particle.d.ts +19 -0
  264. package/dist/typescript/module/features/celebrations/components/Particle.d.ts.map +1 -0
  265. package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts +26 -0
  266. package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts.map +1 -0
  267. package/dist/typescript/module/features/celebrations/components/Spark.d.ts +4 -0
  268. package/dist/typescript/module/features/celebrations/components/Spark.d.ts.map +1 -0
  269. package/dist/typescript/module/features/celebrations/config.d.ts +167 -0
  270. package/dist/typescript/module/features/celebrations/config.d.ts.map +1 -0
  271. package/dist/typescript/module/features/celebrations/helpers.d.ts +6 -0
  272. package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -0
  273. package/dist/typescript/module/features/celebrations/index.d.ts +3 -0
  274. package/dist/typescript/module/features/celebrations/index.d.ts.map +1 -0
  275. package/dist/typescript/module/features/celebrations/types.d.ts +11 -0
  276. package/dist/typescript/module/features/celebrations/types.d.ts.map +1 -0
  277. package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +4 -0
  278. package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -0
  279. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +15 -0
  280. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -0
  281. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +4 -0
  282. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -0
  283. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +8 -0
  284. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +1 -0
  285. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +8 -0
  286. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +1 -0
  287. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +12 -0
  288. package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +1 -0
  289. package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts +11 -0
  290. package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts.map +1 -0
  291. package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +4 -0
  292. package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -0
  293. package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +4 -0
  294. package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -0
  295. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +4 -0
  296. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -0
  297. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +8 -0
  298. package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +1 -0
  299. package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts +20 -0
  300. package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -0
  301. package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts +3 -0
  302. package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -0
  303. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +4 -0
  304. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -0
  305. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +4 -0
  306. package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -0
  307. package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts +14 -0
  308. package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts.map +1 -0
  309. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +4 -0
  310. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -0
  311. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +8 -0
  312. package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +1 -0
  313. package/dist/typescript/module/features/endOfAssignment/constants.d.ts +41 -0
  314. package/dist/typescript/module/features/endOfAssignment/constants.d.ts.map +1 -0
  315. package/dist/typescript/module/features/endOfAssignment/helpers.d.ts +9 -0
  316. package/dist/typescript/module/features/endOfAssignment/helpers.d.ts.map +1 -0
  317. package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts +27 -0
  318. package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +1 -0
  319. package/dist/typescript/module/features/endOfAssignment/index.d.ts +4 -0
  320. package/dist/typescript/module/features/endOfAssignment/index.d.ts.map +1 -0
  321. package/dist/typescript/module/features/endOfAssignment/model/model.d.ts +14 -0
  322. package/dist/typescript/module/features/endOfAssignment/model/model.d.ts.map +1 -0
  323. package/dist/typescript/module/features/endOfAssignment/types.d.ts +60 -0
  324. package/dist/typescript/module/features/endOfAssignment/types.d.ts.map +1 -0
  325. package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts +11 -0
  326. package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts.map +1 -0
  327. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts +10 -0
  328. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts.map +1 -0
  329. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +14 -0
  330. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -0
  331. package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts +4 -0
  332. package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -0
  333. package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts +4 -0
  334. package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -0
  335. package/dist/typescript/module/index.d.ts +2 -0
  336. package/dist/typescript/module/index.d.ts.map +1 -1
  337. package/dist/typescript/module/shared/icons/Halloween.d.ts +5 -0
  338. package/dist/typescript/module/shared/icons/Halloween.d.ts.map +1 -0
  339. package/dist/typescript/module/shared/icons/Pi.d.ts +5 -0
  340. package/dist/typescript/module/shared/icons/Pi.d.ts.map +1 -0
  341. package/dist/typescript/module/shared/icons/Star.d.ts +5 -0
  342. package/dist/typescript/module/shared/icons/Star.d.ts.map +1 -0
  343. package/dist/typescript/module/shared/icons/Valentine.d.ts +5 -0
  344. package/dist/typescript/module/shared/icons/Valentine.d.ts.map +1 -0
  345. package/dist/typescript/module/shared/icons/Winter.d.ts +5 -0
  346. package/dist/typescript/module/shared/icons/Winter.d.ts.map +1 -0
  347. package/package.json +3 -1
  348. package/src/features/celebrations/components/Celebrations.tsx +62 -0
  349. package/src/features/celebrations/components/Particle.tsx +99 -0
  350. package/src/features/celebrations/components/ParticleBatch.tsx +56 -0
  351. package/src/features/celebrations/components/Spark.tsx +14 -0
  352. package/src/features/celebrations/config.ts +199 -0
  353. package/src/features/celebrations/helpers.ts +96 -0
  354. package/src/features/celebrations/index.ts +2 -0
  355. package/src/features/celebrations/types.ts +11 -0
  356. package/src/features/endOfAssignment/components/CheatDetected/CheatDetected.tsx +48 -0
  357. package/src/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.tsx +293 -0
  358. package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +128 -0
  359. package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.tsx +39 -0
  360. package/src/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.tsx +40 -0
  361. package/src/features/endOfAssignment/components/CorrectAnswer/Spark.tsx +45 -0
  362. package/src/features/endOfAssignment/components/EOAModal.tsx +64 -0
  363. package/src/features/endOfAssignment/components/ExamLeave/ExamLeave.tsx +56 -0
  364. package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +46 -0
  365. package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +102 -0
  366. package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.tsx +69 -0
  367. package/src/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
  368. package/src/features/endOfAssignment/components/Modal/Modal.tsx +105 -0
  369. package/src/features/endOfAssignment/components/Modal/ModalBackground.tsx +33 -0
  370. package/src/features/endOfAssignment/components/Modal/assets/SunrisingIcon.tsx +196 -0
  371. package/src/features/endOfAssignment/components/Modal/assets/TrophyIcon.tsx +62 -0
  372. package/src/features/endOfAssignment/components/Modal/model.ts +34 -0
  373. package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +85 -0
  374. package/src/features/endOfAssignment/components/NoAnswer/NoAnswerContent.tsx +107 -0
  375. package/src/features/endOfAssignment/constants.ts +53 -0
  376. package/src/features/endOfAssignment/helpers.ts +28 -0
  377. package/src/features/endOfAssignment/hooks/useSparkAnimation.tsx +78 -0
  378. package/src/features/endOfAssignment/index.ts +3 -0
  379. package/src/features/endOfAssignment/model/model.ts +57 -0
  380. package/src/features/endOfAssignment/types.ts +65 -0
  381. package/src/features/endOfAssignment/ui/EOABadge.tsx +47 -0
  382. package/src/features/endOfAssignment/ui/PracticeButton.tsx +27 -0
  383. package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +75 -0
  384. package/src/features/endOfAssignment/ui/SparkIcon.tsx +15 -0
  385. package/src/features/endOfAssignment/ui/ThumbUpIcon.tsx +17 -0
  386. package/src/index.ts +2 -0
  387. package/src/shared/icons/Halloween.tsx +33 -0
  388. package/src/shared/icons/Pi.tsx +16 -0
  389. package/src/shared/icons/Star.tsx +16 -0
  390. package/src/shared/icons/Valentine.tsx +16 -0
  391. package/src/shared/icons/Winter.tsx +19 -0
@@ -0,0 +1,85 @@
1
+ import React from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+ import { useUnit } from 'effector-react'
4
+ import {
5
+ Button,
6
+ ButtonColor,
7
+ ButtonVariant,
8
+ COLORS,
9
+ SPACING,
10
+ Typography,
11
+ } from '@magmamath/react-native-ui'
12
+
13
+ import { EOAModalContentProps } from '../../types'
14
+ import { NoAnswerContent } from './NoAnswerContent'
15
+ import { PracticeButton } from '../../ui/PracticeButton'
16
+
17
+ export const NoAnswer = ({ model, textContent, onPracticePress }: EOAModalContentProps) => {
18
+ const popUpData = useUnit(model.$popUpData)
19
+
20
+ const { stats, isExam, user } = popUpData ?? {}
21
+ const solved = stats?.solvedAmount ?? 0
22
+ const total = stats?.problemsAmount ?? 0
23
+ const buttonColorScheme = isExam ? ButtonColor.YELLOW : ButtonColor.BLUE
24
+
25
+ const practiceButtonVisible =
26
+ !popUpData?.newerAssignmentAvailable && (!isExam || (isExam && !!user?.practiceMode))
27
+
28
+ const handlePrimaryButtonPress = () => {
29
+ isExam ? onPracticePress?.() : model.goToFirstProblemPressed()
30
+ model.hidePopUp()
31
+ }
32
+
33
+ return (
34
+ <View style={styles.container}>
35
+ <View style={styles.container}>
36
+ {!!textContent.title && (
37
+ <Typography variant="h2" style={{ color: COLORS.NEUTRAL_9 }}>
38
+ {textContent.title}
39
+ </Typography>
40
+ )}
41
+ {!!textContent.subtitle && (
42
+ <Typography variant="h4" style={{ color: COLORS.NEUTRAL_7 }}>
43
+ {textContent.subtitle}
44
+ </Typography>
45
+ )}
46
+ </View>
47
+ <NoAnswerContent solvedAmount={solved} problemsAmount={total} />
48
+ <View style={styles.buttonsContainer}>
49
+ <Button
50
+ variant={practiceButtonVisible ? ButtonVariant.TERTIARY : ButtonVariant.PRIMARY}
51
+ size="large"
52
+ colorScheme={popUpData?.isExam ? 'purple' : 'blue'}
53
+ style={{ text: { textTransform: 'uppercase' } }}
54
+ onPress={model.hidePopUpAndLeave}
55
+ >
56
+ {textContent.leftButtonText ?? ''}
57
+ </Button>
58
+
59
+ {practiceButtonVisible && (
60
+ <PracticeButton
61
+ onPress={handlePrimaryButtonPress}
62
+ text={textContent.rightButtonText}
63
+ colorScheme={buttonColorScheme}
64
+ />
65
+ )}
66
+ </View>
67
+ </View>
68
+ )
69
+ }
70
+
71
+ const styles = StyleSheet.create({
72
+ container: {
73
+ gap: SPACING[400],
74
+ alignItems: 'center',
75
+ },
76
+ buttonsContainer: {
77
+ flexDirection: 'row',
78
+ alignItems: 'center',
79
+ gap: SPACING[200],
80
+ paddingVertical: SPACING[300],
81
+ },
82
+ buttonText: {
83
+ textTransform: 'uppercase',
84
+ },
85
+ })
@@ -0,0 +1,107 @@
1
+ import React, { useEffect } from 'react'
2
+ import { View, StyleSheet, Text } from 'react-native'
3
+
4
+ import {
5
+ BORDER_RADIUS,
6
+ COLORS,
7
+ FONT_FAMILY,
8
+ IS_MOBILE,
9
+ SPACING,
10
+ Typography,
11
+ } from '@magmamath/react-native-ui'
12
+ import Animated, { Easing, useSharedValue, withDelay, withTiming } from 'react-native-reanimated'
13
+
14
+ import { EOABadge } from '../../ui/EOABadge'
15
+ import { AnimatedCardVariant } from '../../types'
16
+
17
+ type NoAnswerContentProps = {
18
+ solvedAmount: number
19
+ problemsAmount: number
20
+ }
21
+
22
+ export const NoAnswerContent = ({ solvedAmount, problemsAmount }: NoAnswerContentProps) => {
23
+ const opacitySv = useSharedValue(0)
24
+
25
+ useEffect(() => {
26
+ opacitySv.value = withDelay(
27
+ 100,
28
+ withTiming(1, {
29
+ duration: 300,
30
+ easing: Easing.inOut(Easing.ease),
31
+ }),
32
+ )
33
+ }, [])
34
+
35
+ return (
36
+ <Animated.View style={[styles.container, { opacity: opacitySv }]}>
37
+ <View style={styles.content}>
38
+ <EOABadge
39
+ color={COLORS.NEUTRAL_5}
40
+ variant={AnimatedCardVariant.CORRECT_ANSWER}
41
+ size={70}
42
+ iconSize={45}
43
+ />
44
+
45
+ <View style={styles.textContainer}>
46
+ <Typography variant="h4" style={styles.largeText}>
47
+ {solvedAmount}
48
+ </Typography>
49
+ <Typography style={styles.text}>
50
+ <Text style={{ paddingRight: 1 }}>{'/'}</Text>
51
+ {problemsAmount}
52
+ </Typography>
53
+ </View>
54
+ </View>
55
+ </Animated.View>
56
+ )
57
+ }
58
+
59
+ const styles = StyleSheet.create({
60
+ container: {
61
+ alignSelf: 'center',
62
+ paddingHorizontal: SPACING[100],
63
+ marginTop: SPACING[300],
64
+ paddingTop: SPACING[100],
65
+ paddingBottom: 38,
66
+ marginBottom: SPACING[800],
67
+ backgroundColor: COLORS.NEUTRAL_5,
68
+ borderRadius: BORDER_RADIUS[400],
69
+ },
70
+ content: {
71
+ flexDirection: 'row',
72
+ alignItems: 'center',
73
+ justifyContent: 'center',
74
+ backgroundColor: '#fff',
75
+ borderRadius: BORDER_RADIUS[200],
76
+ paddingVertical: SPACING[400],
77
+ paddingHorizontal: SPACING[800],
78
+ gap: SPACING[500],
79
+ },
80
+ iconWrapper: {
81
+ backgroundColor: COLORS.NEUTRAL_5,
82
+ borderRadius: 100,
83
+ width: 70,
84
+ height: 70,
85
+ padding: 8,
86
+ justifyContent: 'center',
87
+ alignItems: 'center',
88
+ },
89
+ textContainer: {
90
+ flexDirection: 'row',
91
+ alignItems: 'flex-end',
92
+ },
93
+ largeText: {
94
+ fontSize: 48,
95
+ fontWeight: '700',
96
+ fontFamily: FONT_FAMILY.buenosAires,
97
+ lineHeight: 48,
98
+ marginBottom: IS_MOBILE ? -7 : 0,
99
+ color: COLORS.NEUTRAL_5,
100
+ },
101
+ text: {
102
+ fontSize: 16,
103
+ fontFamily: FONT_FAMILY.buenosAires,
104
+ fontWeight: '700',
105
+ color: '#E0E0E0',
106
+ },
107
+ })
@@ -0,0 +1,53 @@
1
+ import { COLORS } from '@magmamath/react-native-ui'
2
+
3
+ import { AnimatedCardVariant, EOAModalVariant } from './types'
4
+
5
+ export const SPARKS_ANIMATION_DELAY = 2000
6
+ export const GOOD_DRAWING_CARD_APPEARENCE_DELAY = 1800
7
+
8
+ export const MODALS_WITH_BACKGROUND = [
9
+ EOAModalVariant.HAS_CORRECT_ANSWERS,
10
+ EOAModalVariant.HAS_GOOD_DRAWING,
11
+ EOAModalVariant.EXAM_FINISHED_HAS_CORRECT_ANSWERS,
12
+ ]
13
+
14
+ export const VARIANT_COLORS: Record<AnimatedCardVariant, { initial: string; final: string; primary: string }> = {
15
+ [AnimatedCardVariant.CORRECT_ANSWER]: {
16
+ initial: COLORS.GREEN_2,
17
+ final: COLORS.GREEN_4,
18
+ primary: COLORS.PRIMARY_GREEN,
19
+ },
20
+ [AnimatedCardVariant.GOOD_DRAWING]: {
21
+ initial: COLORS.ORANGE_2,
22
+ final: COLORS.ORANGE_4,
23
+ primary: COLORS.PRIMARY_ORANGE,
24
+ },
25
+ }
26
+
27
+ export const ANIMATION_DELAYS = {
28
+ step3: 500,
29
+ celebrations: 140
30
+ }
31
+
32
+ export const CARD_DIMENSIONS = {
33
+ initialWidth: 85,
34
+ finalWidth: 375,
35
+ initialHeight: 85,
36
+ finalHeight: 175,
37
+ }
38
+
39
+ export const OPACITY = {
40
+ initial: 0,
41
+ final: 1,
42
+ }
43
+
44
+ export const BADGE_PARAMS = {
45
+ initialTranslateX: -9,
46
+ intermediateTranslateX: 230,
47
+ finalTranslateX: 40,
48
+ initialRotation: -180,
49
+ initialScale: 0.5,
50
+ }
51
+
52
+ export const SPRING_CONFIG = { stiffness: 241, damping: 18, mass: 0.75 }
53
+ export const SPRING_CONFIG_STEP_3 = { stiffness: 168.8, damping: 15, mass: 0.75 }
@@ -0,0 +1,28 @@
1
+ import { MODALS_WITH_BACKGROUND } from './constants'
2
+ import { EOAModalVariant } from './types'
3
+
4
+ export const getModalContainerSize = (modalVariant: EOAModalVariant) => {
5
+ switch (modalVariant) {
6
+ case EOAModalVariant.EXAM_SUBMIT:
7
+ case EOAModalVariant.EXAM_SAFE_MODE_SUBMIT:
8
+ return { container: { width: 600, height: 384 } }
9
+ case EOAModalVariant.EXAM_PAUSED:
10
+ case EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED:
11
+ return { container: { width: 560, height: 338 } }
12
+ case EOAModalVariant.EXAM_SAFE_MODE_LEAVE:
13
+ return { container: { width: 550, height: 280 } }
14
+ case EOAModalVariant.HAS_GOOD_DRAWING:
15
+ return { container: { width: 957, height: 550 } }
16
+ case EOAModalVariant.HAS_CORRECT_ANSWERS:
17
+ case EOAModalVariant.EXAM_FINISHED_HAS_CORRECT_ANSWERS:
18
+ return { container: { width: 957, height: 550 } }
19
+ default:
20
+ return { container: { width: 600, height: 429 } }
21
+ }
22
+ }
23
+
24
+ export const shouldDisplayModalBackground = (modalVariant: EOAModalVariant | null) => {
25
+ if (!modalVariant) return false
26
+
27
+ return MODALS_WITH_BACKGROUND.includes(modalVariant)
28
+ }
@@ -0,0 +1,78 @@
1
+ import { useEffect } from 'react'
2
+ import {
3
+ useSharedValue,
4
+ withDelay,
5
+ withRepeat,
6
+ withSequence,
7
+ withSpring,
8
+ useAnimatedReaction,
9
+ useAnimatedStyle,
10
+ interpolate,
11
+ } from 'react-native-reanimated'
12
+ import { SpringConfig } from 'react-native-reanimated/lib/typescript/animation/springUtils'
13
+
14
+ type UseSparkAnimationProps = {
15
+ id: string
16
+ initialDelay: number
17
+ rotationAngle: number
18
+ holdDelay: number
19
+ springConfig: SpringConfig
20
+ x: number
21
+ y: number
22
+ size: number
23
+ }
24
+
25
+ export const useSparkAnimation = ({
26
+ id,
27
+ initialDelay,
28
+ rotationAngle,
29
+ holdDelay,
30
+ springConfig,
31
+ x,
32
+ y,
33
+ size,
34
+ }: UseSparkAnimationProps) => {
35
+ const progress = useSharedValue(0)
36
+ const rotation = useSharedValue(0)
37
+
38
+ useAnimatedReaction(
39
+ () => progress.value,
40
+ (current, previous) => {
41
+ if (typeof previous === 'number' && current < previous * 0.95) {
42
+ rotation.value = id === '2' ? -rotationAngle : rotationAngle
43
+ } else {
44
+ rotation.value = current * (id === '2' ? -rotationAngle : rotationAngle)
45
+ }
46
+ },
47
+ [rotation, progress],
48
+ )
49
+
50
+ useEffect(() => {
51
+ progress.value = withDelay(
52
+ initialDelay,
53
+ withRepeat(
54
+ withSequence(
55
+ withSpring(1, springConfig),
56
+ withDelay(holdDelay, withSpring(0, springConfig)),
57
+ ),
58
+ -1,
59
+ ),
60
+ )
61
+ }, [])
62
+
63
+ const animatedStyle = useAnimatedStyle(() => {
64
+ const opacity = interpolate(progress.value, [0, 1], [0, 1])
65
+ return {
66
+ position: 'absolute',
67
+ top: y,
68
+ left: x,
69
+ width: size,
70
+ height: size,
71
+ opacity,
72
+ transform: [{ rotate: `${rotation.value}deg` }],
73
+ zIndex: 10,
74
+ }
75
+ }, [progress, rotation])
76
+
77
+ return { animatedStyle }
78
+ }
@@ -0,0 +1,3 @@
1
+ export { EOAModal } from './components/EOAModal'
2
+ export * from './types'
3
+ export * from './model/model'
@@ -0,0 +1,57 @@
1
+ import { createStore, createEvent, sample } from 'effector'
2
+ import { EOAModalVariant, EOAModalData, EOAEventType } from '../types'
3
+
4
+ export class EOAModel {
5
+ public readonly showPopUp = createEvent<EOAModalData>()
6
+ public readonly hidePopUp = createEvent()
7
+
8
+ public readonly practicePressed = createEvent()
9
+ public readonly leavePressed = createEvent()
10
+ public readonly goToFirstProblemPressed = createEvent()
11
+ public readonly updateRecommendations = createEvent<boolean>()
12
+ public readonly popUpTriggered = createEvent<EOAEventType>()
13
+
14
+ public readonly $popUpData = createStore<EOAModalData | null>(null)
15
+ .on(this.showPopUp, (_, payload) => payload)
16
+ .on(this.updateRecommendations, (state, hasRecommendations) => (state ? { ...state, hasRecommendations } : state))
17
+ .reset(this.hidePopUp)
18
+
19
+ public readonly $modalVariant = createStore<EOAModalVariant | null>(null)
20
+ .on(this.showPopUp, (_, popUpData) => {
21
+ if (!popUpData) return null;
22
+
23
+ const { isExam, stats, examFinished, eventType, cheatDetection } = popUpData;
24
+ const solvedAmount = stats?.solvedAmount ?? 0;
25
+ const goodDrawingAmount = stats?.goodDrawingAmount ?? 0;
26
+
27
+ if (!isExam) {
28
+ if (solvedAmount === 0) return EOAModalVariant.NO_CORRECT_ANSWERS;
29
+ if (solvedAmount > 0 && goodDrawingAmount > 0) return EOAModalVariant.HAS_GOOD_DRAWING;
30
+ return EOAModalVariant.HAS_CORRECT_ANSWERS;
31
+ }
32
+
33
+ if (eventType === EOAEventType.EXAM_PAUSED) return EOAModalVariant.EXAM_PAUSED;
34
+ if (eventType === EOAEventType.CHEAT_DETECTED) return EOAModalVariant.EXAM_SAFE_MODE_CHEAT_DETECTED;
35
+ if (eventType === EOAEventType.SUBMIT && !examFinished) {
36
+ return cheatDetection
37
+ ? EOAModalVariant.EXAM_SAFE_MODE_SUBMIT
38
+ : EOAModalVariant.EXAM_SUBMIT;
39
+ }
40
+
41
+ if (examFinished || eventType === EOAEventType.EXAM_FINISHED) {
42
+ return solvedAmount > 0
43
+ ? EOAModalVariant.EXAM_FINISHED_HAS_CORRECT_ANSWERS
44
+ : EOAModalVariant.EXAM_FINISHED_NO_CORRECT_ANSWERS;
45
+ }
46
+
47
+ return EOAModalVariant.EXAM_SAFE_MODE_LEAVE;
48
+ })
49
+ .reset(this.hidePopUp);
50
+
51
+
52
+ public readonly hidePopUpAndLeave = () => {
53
+ this.leavePressed()
54
+ this.hidePopUp()
55
+ }
56
+
57
+ }
@@ -0,0 +1,65 @@
1
+ import { EOAModel } from "./model/model"
2
+
3
+ export enum EOAEventType {
4
+ SUBMIT = 'SUBMIT',
5
+ EXAM_LEAVE = 'EXAM_LEAVE',
6
+ EXAM_PAUSED = 'EXAM_PAUSED',
7
+ EXAM_FINISHED = 'EXAM_FINISHED',
8
+ CHEAT_DETECTED = 'CHEAT_DETECTED',
9
+ }
10
+
11
+ export enum EOAModalVariant {
12
+ NO_CORRECT_ANSWERS = 'NO_CORRECT_ANSWERS',
13
+ HAS_CORRECT_ANSWERS = 'HAS_CORRECT_ANSWERS',
14
+ HAS_GOOD_DRAWING = 'HAS_GOOD_DRAWING',
15
+
16
+ EXAM_PAUSED = 'EXAM_PAUSED',
17
+ EXAM_SUBMIT = 'EXAM_SUBMIT',
18
+
19
+ EXAM_SAFE_MODE_SUBMIT = 'EXAM_SAFE_MODE_SUBMIT',
20
+ EXAM_SAFE_MODE_LEAVE = 'EXAM_SAFE_MODE_LEAVE',
21
+ EXAM_SAFE_MODE_CHEAT_DETECTED = 'EXAM_SAFE_MODE_CHEAT_DETECTED',
22
+
23
+ EXAM_FINISHED_HAS_CORRECT_ANSWERS = 'EXAM_FINISHED_HAS_CORRECT_ANSWERS',
24
+ EXAM_FINISHED_NO_CORRECT_ANSWERS = 'EXAM_FINISHED_NO_CORRECT_ANSWERS',
25
+ }
26
+
27
+ export enum AnimatedCardVariant {
28
+ GOOD_DRAWING = 'goodDrawing',
29
+ CORRECT_ANSWER = 'correctAnswers',
30
+ }
31
+
32
+ export type EOAModalContentProps = {
33
+ textContent: EOAModalText
34
+ model: EOAModel
35
+ onPracticePress?: () => void
36
+ }
37
+
38
+ export type EOAModalData = {
39
+ isExam: boolean
40
+ newerAssignmentAvailable?: boolean
41
+ examFinished?: boolean
42
+ cheatDetection?: boolean
43
+ eventType?: EOAEventType
44
+ stats: {
45
+ solvedAmount: number
46
+ goodDrawingAmount: number
47
+ problemsAmount: number
48
+ }
49
+ hasRecommendations?: boolean
50
+ user: { firstName: string; practiceMode: boolean }
51
+ }
52
+
53
+ export type EOAModalText = {
54
+ title?: string
55
+ subtitle?: string
56
+ description?: string
57
+ leftButtonText?: string
58
+ rightButtonText?: string
59
+ stats?: {
60
+ correctAnswers?: string
61
+ correctAnswersPlural?: string
62
+ goodCalculations?: string
63
+ goodCalculationsPlural?: string
64
+ }
65
+ }
@@ -0,0 +1,47 @@
1
+ import React from 'react'
2
+ import { View, StyleSheet } from 'react-native'
3
+
4
+ import { CorrectIcon, COLORS } from '@magmamath/react-native-ui'
5
+ import { ThumbUpIcon } from './ThumbUpIcon'
6
+ import { AnimatedCardVariant } from '../types'
7
+
8
+ type EOABadgeProps = {
9
+ variant: AnimatedCardVariant
10
+ size?: number
11
+ iconSize?: number
12
+ color?: string
13
+ }
14
+
15
+ export const EOABadge = ({
16
+ variant,
17
+ size = 70,
18
+ iconSize = 45,
19
+ color = COLORS.PRIMARY_GREEN,
20
+ }: EOABadgeProps) => {
21
+ return (
22
+ <View
23
+ style={[
24
+ styles.container,
25
+ {
26
+ width: size,
27
+ height: size,
28
+ backgroundColor: color,
29
+ },
30
+ ]}
31
+ >
32
+ {variant === AnimatedCardVariant.CORRECT_ANSWER ? (
33
+ <CorrectIcon size={iconSize} color={COLORS.NEUTRAL_1} />
34
+ ) : (
35
+ <ThumbUpIcon size={iconSize} color={COLORS.NEUTRAL_1} />
36
+ )}
37
+ </View>
38
+ )
39
+ }
40
+
41
+ const styles = StyleSheet.create({
42
+ container: {
43
+ justifyContent: 'center',
44
+ alignItems: 'center',
45
+ borderRadius: 50,
46
+ },
47
+ })
@@ -0,0 +1,27 @@
1
+ import React from 'react'
2
+
3
+ import { Button, ButtonColor } from '@magmamath/react-native-ui'
4
+
5
+ type PracticeButtonProps = {
6
+ onPress: () => void
7
+ text?: string
8
+ colorScheme?: ButtonColor
9
+ }
10
+
11
+ export const PracticeButton = ({
12
+ onPress,
13
+ text = '',
14
+ colorScheme = ButtonColor.YELLOW,
15
+ }: PracticeButtonProps) => {
16
+ return (
17
+ <Button
18
+ variant="primary"
19
+ colorScheme={colorScheme}
20
+ size="large"
21
+ style={{ text: { textTransform: 'uppercase' } }}
22
+ onPress={onPress}
23
+ >
24
+ {text}
25
+ </Button>
26
+ )
27
+ }
@@ -0,0 +1,75 @@
1
+ import React, { useEffect } from 'react'
2
+ import { StyleSheet } from 'react-native'
3
+
4
+ import Animated, {
5
+ useSharedValue,
6
+ withDelay,
7
+ FadeInRight,
8
+ Easing,
9
+ FadeInUp,
10
+ withTiming,
11
+ } from 'react-native-reanimated'
12
+ import { ButtonVariant, SPACING, Button } from '@magmamath/react-native-ui'
13
+
14
+ import { PracticeButton } from './PracticeButton'
15
+
16
+ type PracticeButtonGroupProps = {
17
+ textContent: { leftButtonText?: string; rightButtonText?: string }
18
+ isPracticeButtonVisible: boolean
19
+ onLeftButtonPress: () => void
20
+ onRightButtonPress: () => void
21
+ isExam?: boolean
22
+ }
23
+
24
+ export const PracticeButtonGroup = ({
25
+ textContent,
26
+ isPracticeButtonVisible,
27
+ onLeftButtonPress,
28
+ onRightButtonPress,
29
+ isExam,
30
+ }: PracticeButtonGroupProps) => {
31
+ const buttonsContainerOpacity = useSharedValue(0)
32
+
33
+ console.log('rerender')
34
+
35
+ useEffect(() => {
36
+ buttonsContainerOpacity.value = withDelay(1000, withTiming(1, { duration: 500 }))
37
+ }, [])
38
+
39
+ return (
40
+ <Animated.View style={[styles.buttonsContainer, { opacity: buttonsContainerOpacity }]}>
41
+ <Animated.View
42
+ entering={
43
+ isPracticeButtonVisible
44
+ ? FadeInRight.delay(1000).duration(500).easing(Easing.ease)
45
+ : FadeInUp.duration(500)
46
+ }
47
+ >
48
+ <Button
49
+ variant={isPracticeButtonVisible ? ButtonVariant.TERTIARY : ButtonVariant.PRIMARY}
50
+ size="large"
51
+ colorScheme={isExam ? 'purple' : 'blue'}
52
+ style={{ text: { textTransform: 'uppercase' } }}
53
+ onPress={onLeftButtonPress}
54
+ >
55
+ {textContent.leftButtonText ?? ''}
56
+ </Button>
57
+ </Animated.View>
58
+ <Animated.View>
59
+ {isPracticeButtonVisible && (
60
+ <PracticeButton onPress={onRightButtonPress} text={textContent.rightButtonText ?? ''} />
61
+ )}
62
+ </Animated.View>
63
+ </Animated.View>
64
+ )
65
+ }
66
+
67
+ const styles = StyleSheet.create({
68
+ buttonsContainer: {
69
+ height: 62,
70
+ flexDirection: 'row',
71
+ alignItems: 'center',
72
+ justifyContent: 'center',
73
+ paddingHorizontal: SPACING[300],
74
+ },
75
+ })
@@ -0,0 +1,15 @@
1
+ import React from 'react'
2
+
3
+ import { IconProps } from '@magmamath/react-native-ui'
4
+ import Svg, { Path } from 'react-native-svg'
5
+
6
+ export const SparkIcon = ({ size = 12, color }: IconProps) => {
7
+ return (
8
+ <Svg width={size} height={size} viewBox="0 0 22 22" fill="none">
9
+ <Path
10
+ d="M20.563 12.363c-3.688 1.348-6.782 4.42-8.24 8.244-.505 1.19-2.111 1.19-2.587 0-1.517-3.793-4.61-6.864-8.299-8.18-1.25-.502-1.25-2.352 0-2.79 3.688-1.348 6.782-4.42 8.24-8.244.505-1.19 2.111-1.19 2.587 0 1.517 3.793 4.61 6.864 8.299 8.18 1.25.502 1.25 2.352 0 2.79z"
11
+ fill={color}
12
+ />
13
+ </Svg>
14
+ )
15
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+
3
+ import { COLORS, IconProps } from '@magmamath/react-native-ui'
4
+ import Svg, { Path } from 'react-native-svg'
5
+
6
+ export const ThumbUpIcon = ({ size = 57, color = COLORS.NEUTRAL_1 }: IconProps) => {
7
+ return (
8
+ <Svg width={size} height={size} viewBox="0 0 57 57" fill="none">
9
+ <Path
10
+ fillRule="evenodd"
11
+ clipRule="evenodd"
12
+ d="M23.22 49.594c-2.143 0-4.284-.72-6.027-1.862l-.071-.048-.296-.197-.158.319a4.28 4.28 0 01-3.837 2.382H9.466a4.279 4.279 0 01-4.278-4.28V23.306a4.279 4.279 0 014.278-4.279h3.365c1.479 0 2.782.75 3.551 1.89l.19.282.265-.212c5.975-4.77 8.052-10.642 8.495-13.38.277-1.717 1.289-2.983 2.692-3.609 1.329-.593 2.835-.542 4.145-.08 2.702.951 4.96 3.765 4.472 7.79-.403 3.328-1.348 6.402-2.075 8.692l-.129.407h10.805c3.133 0 5.975 2.24 6.322 5.54.239 2.271.405 5.292.016 7.948-.35 2.397-.956 6.096-2.536 9.219-1.62 3.203-4.436 6.08-9.153 6.08h-16.67zm7.662-42.021c-.566-.2-1.025-.15-1.279-.036a.636.636 0 00-.262.201c-.091.12-.15.279-.184.486-.621 3.847-3.536 11.617-11.909 17.265l-.138.093v16.407l.025.058c.363.867 1.115 1.744 2.184 2.445 1.184.777 2.596 1.227 3.902 1.227h16.67c1.36 0 2.483-.376 3.422-1.07.932-.69 1.665-1.681 2.273-2.884 1.263-2.497 1.807-5.619 2.16-8.031.318-2.173.192-4.812-.035-6.981-.12-1.141-1.125-2.071-2.47-2.071h-11.91c-1.994 0-3.56-1.904-2.936-3.938.123-.4.255-.817.393-1.252l.003-.009c.737-2.327 1.627-5.14 2.003-8.242.13-1.066-.08-1.894-.465-2.506a2.835 2.835 0 00-1.447-1.162zM9.466 22.903a.404.404 0 00-.403.403v22.602c0 .224.18.404.403.404h3.365a.403.403 0 00.404-.403V23.306a.404.404 0 00-.404-.404H9.466z"
13
+ fill={color}
14
+ />
15
+ </Svg>
16
+ )
17
+ }
package/src/index.ts CHANGED
@@ -3,3 +3,5 @@ export type { LocalizationConfig } from './shared/translation'
3
3
  export { generateRandomId } from './lib/helpers/helpers'
4
4
  export * from './features/chatbot'
5
5
  export * from './features/feedback'
6
+ export * from './features/celebrations'
7
+ export * from './features/endOfAssignment'