@pocketprep/ui-kit 2.0.40 → 3.0.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.
Files changed (305) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +16 -17
  2. package/dist/@pocketprep/ui-kit.js +18856 -0
  3. package/dist/@pocketprep/ui-kit.js.map +1 -0
  4. package/dist/@pocketprep/ui-kit.umd.cjs +28 -0
  5. package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -0
  6. package/dist/style.css +1 -0
  7. package/index.d.ts +6 -62
  8. package/lib/SVGDefinitions.vue +85 -0
  9. package/lib/assets/emojis/tada.png +0 -0
  10. package/lib/assets/halftones/halftone-black.png +0 -0
  11. package/lib/assets/halftones/halftone-blue.png +0 -0
  12. package/lib/assets/halftones/halftone-green.png +0 -0
  13. package/lib/assets/halftones/halftone-purple.png +0 -0
  14. package/lib/assets/halftones/halftone-red.png +0 -0
  15. package/lib/assets/halftones/halftone-yellow.png +0 -0
  16. package/lib/assets/question/paywall-dark.png +0 -0
  17. package/lib/assets/question/paywall-light.png +0 -0
  18. package/lib/components/Banners/Banner.md +41 -0
  19. package/lib/components/Banners/Banner.vue +87 -0
  20. package/lib/components/BundleIcons/AMTA.vue +134 -0
  21. package/lib/components/BundleIcons/BundleIcon.md +60 -0
  22. package/lib/components/BundleIcons/BundleIcon.vue +111 -0
  23. package/lib/components/Bundles/BundleList.md +63 -0
  24. package/lib/components/Bundles/BundleList.vue +170 -0
  25. package/lib/components/Bundles/BundleSearch.md +195 -0
  26. package/lib/components/Bundles/BundleSearch.vue +573 -0
  27. package/lib/components/Bundles/PremiumPill.md +23 -0
  28. package/lib/components/Bundles/PremiumPill.vue +43 -0
  29. package/lib/components/Buttons/Button.md +99 -0
  30. package/lib/components/Buttons/Button.vue +496 -0
  31. package/lib/components/Buttons/Link.md +58 -0
  32. package/lib/components/Buttons/Link.vue +192 -0
  33. package/lib/components/Buttons/Tab.md +35 -0
  34. package/lib/components/Buttons/Tab.vue +103 -0
  35. package/lib/components/Calendar/Calendar.md +18 -0
  36. package/lib/components/Calendar/Calendar.vue +162 -0
  37. package/lib/components/Charts/Bar.md +123 -0
  38. package/lib/components/Charts/Bar.vue +364 -0
  39. package/lib/components/Charts/Pie.md +23 -0
  40. package/lib/components/Charts/Pie.vue +105 -0
  41. package/lib/components/Controls/SegmentControl.md +47 -0
  42. package/lib/components/Controls/SegmentControl.vue +117 -0
  43. package/lib/components/Controls/Slider.md +67 -0
  44. package/lib/components/Controls/Slider.vue +358 -0
  45. package/lib/components/Controls/ToggleSwitch.md +56 -0
  46. package/lib/components/Controls/ToggleSwitch.vue +160 -0
  47. package/lib/components/Exams/ExamCard.md +45 -0
  48. package/lib/components/Exams/ExamCard.vue +257 -0
  49. package/lib/components/Exams/ExamMenuCard.md +90 -0
  50. package/lib/components/Exams/ExamMenuCard.vue +218 -0
  51. package/lib/components/Filters/FilterDropdown.md +59 -0
  52. package/lib/components/Filters/FilterDropdown.vue +176 -0
  53. package/lib/components/Filters/FilterOptions.md +65 -0
  54. package/lib/components/Filters/FilterOptions.vue +265 -0
  55. package/lib/components/Filters/filterOptions.d.ts +10 -0
  56. package/lib/components/Forms/Checkbox.md +52 -0
  57. package/lib/components/Forms/Checkbox.vue +184 -0
  58. package/lib/components/Forms/CheckboxOption.md +37 -0
  59. package/lib/components/Forms/CheckboxOption.vue +173 -0
  60. package/lib/components/Forms/Errors.md +23 -0
  61. package/lib/components/Forms/Errors.vue +109 -0
  62. package/lib/components/Forms/Input.md +63 -0
  63. package/lib/components/Forms/Input.vue +310 -0
  64. package/lib/components/Forms/Radio.md +66 -0
  65. package/lib/components/Forms/Radio.vue +312 -0
  66. package/lib/components/Forms/Select.md +133 -0
  67. package/lib/components/Forms/Select.vue +670 -0
  68. package/lib/components/Forms/Textarea.md +57 -0
  69. package/lib/components/Forms/Textarea.vue +157 -0
  70. package/lib/components/Icons/Icon.md +146 -0
  71. package/lib/components/Icons/Icon.vue +192 -0
  72. package/lib/components/Icons/IconAccordionArrow.md +7 -0
  73. package/lib/components/Icons/IconAccordionArrow.vue +23 -0
  74. package/lib/components/Icons/IconActivity.md +7 -0
  75. package/lib/components/Icons/IconActivity.vue +21 -0
  76. package/lib/components/Icons/IconAdd.md +7 -0
  77. package/lib/components/Icons/IconAdd.vue +19 -0
  78. package/lib/components/Icons/IconAddCircle.md +7 -0
  79. package/lib/components/Icons/IconAddCircle.vue +22 -0
  80. package/lib/components/Icons/IconArrow.md +7 -0
  81. package/lib/components/Icons/IconArrow.vue +21 -0
  82. package/lib/components/Icons/IconBarChart.md +7 -0
  83. package/lib/components/Icons/IconBarChart.vue +23 -0
  84. package/lib/components/Icons/IconCalendar.md +7 -0
  85. package/lib/components/Icons/IconCalendar.vue +19 -0
  86. package/lib/components/Icons/IconCheck.md +7 -0
  87. package/lib/components/Icons/IconCheck.vue +21 -0
  88. package/lib/components/Icons/IconClose.md +7 -0
  89. package/lib/components/Icons/IconClose.vue +23 -0
  90. package/lib/components/Icons/IconCorrect.md +7 -0
  91. package/lib/components/Icons/IconCorrect.vue +19 -0
  92. package/lib/components/Icons/IconEdit.md +7 -0
  93. package/lib/components/Icons/IconEdit.vue +21 -0
  94. package/lib/components/Icons/IconExam.md +7 -0
  95. package/lib/components/Icons/IconExam.vue +34 -0
  96. package/lib/components/Icons/IconExternalLink.md +7 -0
  97. package/lib/components/Icons/IconExternalLink.vue +30 -0
  98. package/lib/components/Icons/IconEyeHide.md +7 -0
  99. package/lib/components/Icons/IconEyeHide.vue +21 -0
  100. package/lib/components/Icons/IconEyeShow.md +7 -0
  101. package/lib/components/Icons/IconEyeShow.vue +21 -0
  102. package/lib/components/Icons/IconFilter.md +7 -0
  103. package/lib/components/Icons/IconFilter.vue +19 -0
  104. package/lib/components/Icons/IconFilterActive.md +7 -0
  105. package/lib/components/Icons/IconFilterActive.vue +20 -0
  106. package/lib/components/Icons/IconFlag.md +7 -0
  107. package/lib/components/Icons/IconFlag.vue +25 -0
  108. package/lib/components/Icons/IconFlagFeedback.md +11 -0
  109. package/lib/components/Icons/IconFlagFeedback.vue +24 -0
  110. package/lib/components/Icons/IconFlagFilled.md +7 -0
  111. package/lib/components/Icons/IconFlagFilled.vue +22 -0
  112. package/lib/components/Icons/IconFullView.md +7 -0
  113. package/lib/components/Icons/IconFullView.vue +30 -0
  114. package/lib/components/Icons/IconFullViewActive.md +7 -0
  115. package/lib/components/Icons/IconFullViewActive.vue +28 -0
  116. package/lib/components/Icons/IconHandle.md +7 -0
  117. package/lib/components/Icons/IconHandle.vue +23 -0
  118. package/lib/components/Icons/IconHeart.md +7 -0
  119. package/lib/components/Icons/IconHeart.vue +19 -0
  120. package/lib/components/Icons/IconHelp.md +7 -0
  121. package/lib/components/Icons/IconHelp.vue +25 -0
  122. package/lib/components/Icons/IconHourglass.md +7 -0
  123. package/lib/components/Icons/IconHourglass.vue +22 -0
  124. package/lib/components/Icons/IconImage.md +7 -0
  125. package/lib/components/Icons/IconImage.vue +21 -0
  126. package/lib/components/Icons/IconIncorrect.md +7 -0
  127. package/lib/components/Icons/IconIncorrect.vue +21 -0
  128. package/lib/components/Icons/IconInfo.md +7 -0
  129. package/lib/components/Icons/IconInfo.vue +24 -0
  130. package/lib/components/Icons/IconKeyboard.md +7 -0
  131. package/lib/components/Icons/IconKeyboard.vue +25 -0
  132. package/lib/components/Icons/IconLaunch.md +7 -0
  133. package/lib/components/Icons/IconLaunch.vue +25 -0
  134. package/lib/components/Icons/IconLightning.md +7 -0
  135. package/lib/components/Icons/IconLightning.vue +21 -0
  136. package/lib/components/Icons/IconList.md +7 -0
  137. package/lib/components/Icons/IconList.vue +26 -0
  138. package/lib/components/Icons/IconLoading.md +7 -0
  139. package/lib/components/Icons/IconLoading.vue +65 -0
  140. package/lib/components/Icons/IconLoading2.md +7 -0
  141. package/lib/components/Icons/IconLoading2.vue +52 -0
  142. package/lib/components/Icons/IconLock.md +7 -0
  143. package/lib/components/Icons/IconLock.vue +23 -0
  144. package/lib/components/Icons/IconMissedQuestions.md +7 -0
  145. package/lib/components/Icons/IconMissedQuestions.vue +22 -0
  146. package/lib/components/Icons/IconMoon.md +7 -0
  147. package/lib/components/Icons/IconMoon.vue +25 -0
  148. package/lib/components/Icons/IconPaginationArrow.md +7 -0
  149. package/lib/components/Icons/IconPaginationArrow.vue +23 -0
  150. package/lib/components/Icons/IconPassage.md +7 -0
  151. package/lib/components/Icons/IconPassage.vue +22 -0
  152. package/lib/components/Icons/IconPencil.md +7 -0
  153. package/lib/components/Icons/IconPencil.vue +19 -0
  154. package/lib/components/Icons/IconPeople.md +7 -0
  155. package/lib/components/Icons/IconPeople.vue +25 -0
  156. package/lib/components/Icons/IconQuestions.md +7 -0
  157. package/lib/components/Icons/IconQuestions.vue +25 -0
  158. package/lib/components/Icons/IconQuick10.md +7 -0
  159. package/lib/components/Icons/IconQuick10.vue +23 -0
  160. package/lib/components/Icons/IconRemoveCircle.md +7 -0
  161. package/lib/components/Icons/IconRemoveCircle.vue +22 -0
  162. package/lib/components/Icons/IconReviewFlag.md +7 -0
  163. package/lib/components/Icons/IconReviewFlag.vue +32 -0
  164. package/lib/components/Icons/IconSearch.md +7 -0
  165. package/lib/components/Icons/IconSearch.vue +23 -0
  166. package/lib/components/Icons/IconShare.md +7 -0
  167. package/lib/components/Icons/IconShare.vue +31 -0
  168. package/lib/components/Icons/IconSideBar.md +7 -0
  169. package/lib/components/Icons/IconSideBar.vue +26 -0
  170. package/lib/components/Icons/IconSideBarActive.md +7 -0
  171. package/lib/components/Icons/IconSideBarActive.vue +28 -0
  172. package/lib/components/Icons/IconStopwatch.md +7 -0
  173. package/lib/components/Icons/IconStopwatch.vue +22 -0
  174. package/lib/components/Icons/IconStrike.md +60 -0
  175. package/lib/components/Icons/IconStrike.vue +23 -0
  176. package/lib/components/Icons/IconSubject.md +7 -0
  177. package/lib/components/Icons/IconSubject.vue +22 -0
  178. package/lib/components/Icons/IconText.md +7 -0
  179. package/lib/components/Icons/IconText.vue +22 -0
  180. package/lib/components/Icons/IconWarning.md +7 -0
  181. package/lib/components/Icons/IconWarning.vue +22 -0
  182. package/lib/components/Modal/Modal.md +31 -0
  183. package/lib/components/Modal/Modal.vue +133 -0
  184. package/lib/components/Modal/ModalContainer.md +96 -0
  185. package/lib/components/Modal/ModalContainer.vue +208 -0
  186. package/lib/components/Onboarding/EmailAuth.md +40 -0
  187. package/lib/components/Onboarding/EmailAuth.vue +218 -0
  188. package/lib/components/Onboarding/MagicCodeEntry.md +20 -0
  189. package/lib/components/Onboarding/MagicCodeEntry.vue +189 -0
  190. package/lib/components/PhonePerson/PhonePerson.md +36 -0
  191. package/lib/components/PhonePerson/PhonePerson.vue +48 -0
  192. package/lib/components/PhonePerson/phoneperson-IT@2x.png +0 -0
  193. package/lib/components/PhonePerson/phoneperson-auto@2x.png +0 -0
  194. package/lib/components/PhonePerson/phoneperson-behavioralhealth@2x.png +0 -0
  195. package/lib/components/PhonePerson/phoneperson-emt@2x.png +0 -0
  196. package/lib/components/PhonePerson/phoneperson-essentials@2x.png +0 -0
  197. package/lib/components/PhonePerson/phoneperson-finance@2x.png +0 -0
  198. package/lib/components/PhonePerson/phoneperson-fitness@2x.png +0 -0
  199. package/lib/components/PhonePerson/phoneperson-medical@2x.png +0 -0
  200. package/lib/components/PhonePerson/phoneperson-nursing@2x.png +0 -0
  201. package/lib/components/PhonePerson/phoneperson-nursingschool@2x.png +0 -0
  202. package/lib/components/PhonePerson/phoneperson-professional@2x.png +0 -0
  203. package/lib/components/PhonePerson/phoneperson-skilledtrades@2x.png +0 -0
  204. package/lib/components/Quiz/FlagToggle.md +37 -0
  205. package/lib/components/Quiz/FlagToggle.vue +124 -0
  206. package/lib/components/Quiz/GlobalMetricsToggle.md +46 -0
  207. package/lib/components/Quiz/GlobalMetricsToggle.vue +124 -0
  208. package/lib/components/Quiz/KeyboardShortcutsButton.md +18 -0
  209. package/lib/components/Quiz/KeyboardShortcutsButton.vue +102 -0
  210. package/lib/components/Quiz/KeyboardShortcutsModal.md +71 -0
  211. package/lib/components/Quiz/KeyboardShortcutsModal.vue +261 -0
  212. package/lib/components/Quiz/Question.md +579 -0
  213. package/lib/components/Quiz/Question.vue +3262 -0
  214. package/lib/components/Quiz/QuizContainer.md +91 -0
  215. package/lib/components/Quiz/QuizContainer.vue +207 -0
  216. package/lib/components/Quiz/QuizProgress.md +122 -0
  217. package/lib/components/Quiz/QuizProgress.vue +188 -0
  218. package/lib/components/Quiz/QuizProgressBar.md +131 -0
  219. package/lib/components/Quiz/QuizProgressBar.vue +96 -0
  220. package/lib/components/Search/Pill.md +37 -0
  221. package/lib/components/Search/Pill.vue +117 -0
  222. package/lib/components/Search/Search.md +44 -0
  223. package/lib/components/Search/Search.vue +341 -0
  224. package/lib/components/SidePanels/SidePanel.md +126 -0
  225. package/lib/components/SidePanels/SidePanel.vue +592 -0
  226. package/lib/components/Tables/StudyTable.md +136 -0
  227. package/lib/components/Tables/Table.vue +497 -0
  228. package/lib/components/Tables/TableActions.vue +199 -0
  229. package/lib/components/Tables/TablePagination.md +19 -0
  230. package/lib/components/Tables/TablePagination.vue +109 -0
  231. package/lib/components/Tables/TeachTable.md +696 -0
  232. package/lib/components/Toasts/Toast.md +35 -0
  233. package/lib/components/Toasts/Toast.vue +213 -0
  234. package/lib/components/Tooltips/OverflowTooltip.md +14 -0
  235. package/lib/components/Tooltips/OverflowTooltip.vue +68 -0
  236. package/lib/components/Tooltips/Tooltip.md +72 -0
  237. package/lib/components/Tooltips/Tooltip.vue +143 -0
  238. package/lib/directives.ts +213 -0
  239. package/lib/index.ts +108 -0
  240. package/{pocketprep-export.module.scss → lib/pocketprep-export.module.scss} +2 -2
  241. package/{pocketprep.scss → lib/pocketprep.scss} +16 -18
  242. package/{styles → lib/styles}/_colors.scss +1 -1
  243. package/lib/styles/fonts.css +149 -0
  244. package/lib/utils.ts +53 -0
  245. package/package.json +76 -56
  246. package/{stylelint.config.js → stylelint.config.cjs} +6 -3
  247. package/assets/Fonts.md +0 -114
  248. package/assets/Images.md +0 -2
  249. package/assets/Styleguidist.vue +0 -11
  250. package/dist/@pocketprep/ui-kit.common.js +0 -29726
  251. package/dist/@pocketprep/ui-kit.common.js.map +0 -1
  252. package/dist/@pocketprep/ui-kit.umd.js +0 -29745
  253. package/dist/@pocketprep/ui-kit.umd.js.map +0 -1
  254. package/dist/@pocketprep/ui-kit.umd.min.js +0 -33
  255. package/dist/@pocketprep/ui-kit.umd.min.js.map +0 -1
  256. package/dist/demo.html +0 -1
  257. package/src/directives.d.ts +0 -2
  258. package/src/shims.d.ts +0 -19
  259. package/src/utils.d.ts +0 -51
  260. package/styles/Colors.md +0 -53
  261. package/styles/Styles.md +0 -4
  262. package/styles/_fonts.scss +0 -149
  263. package/tests/shims-test.d.ts +0 -9
  264. /package/{assets → lib/assets}/fonts/muli/muli-400.eot +0 -0
  265. /package/{assets → lib/assets}/fonts/muli/muli-400.svg +0 -0
  266. /package/{assets → lib/assets}/fonts/muli/muli-400.ttf +0 -0
  267. /package/{assets → lib/assets}/fonts/muli/muli-400.woff +0 -0
  268. /package/{assets → lib/assets}/fonts/muli/muli-400.woff2 +0 -0
  269. /package/{assets → lib/assets}/fonts/muli/muli-400italic.eot +0 -0
  270. /package/{assets → lib/assets}/fonts/muli/muli-400italic.svg +0 -0
  271. /package/{assets → lib/assets}/fonts/muli/muli-400italic.ttf +0 -0
  272. /package/{assets → lib/assets}/fonts/muli/muli-400italic.woff +0 -0
  273. /package/{assets → lib/assets}/fonts/muli/muli-400italic.woff2 +0 -0
  274. /package/{assets → lib/assets}/fonts/muli/muli-600.eot +0 -0
  275. /package/{assets → lib/assets}/fonts/muli/muli-600.svg +0 -0
  276. /package/{assets → lib/assets}/fonts/muli/muli-600.ttf +0 -0
  277. /package/{assets → lib/assets}/fonts/muli/muli-600.woff +0 -0
  278. /package/{assets → lib/assets}/fonts/muli/muli-600.woff2 +0 -0
  279. /package/{assets → lib/assets}/fonts/muli/muli-600italic.eot +0 -0
  280. /package/{assets → lib/assets}/fonts/muli/muli-600italic.svg +0 -0
  281. /package/{assets → lib/assets}/fonts/muli/muli-600italic.ttf +0 -0
  282. /package/{assets → lib/assets}/fonts/muli/muli-600italic.woff +0 -0
  283. /package/{assets → lib/assets}/fonts/muli/muli-600italic.woff2 +0 -0
  284. /package/{assets → lib/assets}/fonts/muli/muli-700.eot +0 -0
  285. /package/{assets → lib/assets}/fonts/muli/muli-700.svg +0 -0
  286. /package/{assets → lib/assets}/fonts/muli/muli-700.ttf +0 -0
  287. /package/{assets → lib/assets}/fonts/muli/muli-700.woff +0 -0
  288. /package/{assets → lib/assets}/fonts/muli/muli-700.woff2 +0 -0
  289. /package/{assets → lib/assets}/fonts/muli/muli-700italic.eot +0 -0
  290. /package/{assets → lib/assets}/fonts/muli/muli-700italic.svg +0 -0
  291. /package/{assets → lib/assets}/fonts/muli/muli-700italic.ttf +0 -0
  292. /package/{assets → lib/assets}/fonts/muli/muli-700italic.woff +0 -0
  293. /package/{assets → lib/assets}/fonts/muli/muli-700italic.woff2 +0 -0
  294. /package/{assets → lib/assets}/images/amta.svg +0 -0
  295. /package/{assets → lib/assets}/images/favicon.ico +0 -0
  296. /package/{assets → lib/assets}/images/thumb-large-dark.svg +0 -0
  297. /package/{assets → lib/assets}/images/thumb-large.svg +0 -0
  298. /package/{assets → lib/assets}/images/thumb-small-dark.svg +0 -0
  299. /package/{assets → lib/assets}/images/thumb-small.svg +0 -0
  300. /package/{src → lib}/components/BundleIcons/bundleIcon.d.ts +0 -0
  301. /package/{src → lib}/components/Icons/icon.d.ts +0 -0
  302. /package/{src → lib}/components/PhonePerson/phonePerson.d.ts +0 -0
  303. /package/{src → lib}/components/Tables/table.d.ts +0 -0
  304. /package/{styles → lib/styles}/_breakpoints.scss +0 -0
  305. /package/{styles/_normalize.scss → lib/styles/normalize.css} +0 -0
@@ -0,0 +1,3262 @@
1
+ <template>
2
+ <div
3
+ ref="question"
4
+ v-breakpoint="breakpoints"
5
+ class="uikit-question"
6
+ :class="{
7
+ 'uikit-question--show-side': (showExplanation && !showPaywall) || showPassageAndImage,
8
+ }"
9
+ >
10
+ <slot name="closeIcon">
11
+ <Icon
12
+ v-breakpoint:questionEl="breakpoints"
13
+ v-dark="isDarkMode"
14
+ class="uikit-question__close-icon"
15
+ role="button"
16
+ aria-label="Close question"
17
+ type="close"
18
+ @click="emitClose"
19
+ />
20
+ </slot>
21
+ <div
22
+ v-breakpoint:questionEl="breakpoints"
23
+ class="uikit-question__main"
24
+ :class="{
25
+ 'uikit-question__main--show-side': (showExplanation && !showPaywall) || showPassageAndImage,
26
+ 'uikit-question__main--unanswered': showAnswers && !isMCR && isUnanswered && !isCorrect,
27
+ 'uikit-question__main--mcr': isMCR,
28
+ }"
29
+ >
30
+ <slot name="context">
31
+ <div
32
+ ref="uikit-question__context"
33
+ v-breakpoint:questionEl="breakpoints"
34
+ class="uikit-question__context"
35
+ tabindex="-1"
36
+ >
37
+ <slot name="contextIcon">
38
+ <Icon
39
+ v-dark="isDarkMode"
40
+ class="uikit-question__context-icon"
41
+ :type="contextIconType"
42
+ />
43
+ </slot>
44
+ <slot name="contextText">
45
+ <h2
46
+ v-if="quizMode === 'qotd'"
47
+ v-dark="isDarkMode"
48
+ class="uikit-question__context-text"
49
+ >
50
+ Question of the Day
51
+ </h2>
52
+ <h2
53
+ v-else
54
+ v-dark="isDarkMode"
55
+ class="uikit-question__context-text"
56
+ :aria-label="`Question ${
57
+ questionNumber
58
+ }${
59
+ quizMode !== 'timed'
60
+ ? ` of ${quizLength}`
61
+ : ''
62
+ }${
63
+ showAnswers
64
+ ? isCorrect
65
+ ? ', Answered Correctly'
66
+ : ', Answered Incorrectly'
67
+ : ''
68
+ }`"
69
+ aria-live="assertive"
70
+ >
71
+ <div class="uikit-question__current-index" aria-hidden="true">
72
+ Question {{ questionNumber }}
73
+ </div>
74
+ <div
75
+ v-if="quizMode !== 'timed'"
76
+ class="uikit-question__quiz-length"
77
+ aria-hidden="true"
78
+ >
79
+ / {{ quizLength }}
80
+ </div>
81
+ </h2>
82
+ </slot>
83
+ </div>
84
+ </slot>
85
+ <div
86
+ ref="prompt"
87
+ v-breakpoint:questionEl="breakpoints"
88
+ tabindex="-1"
89
+ class="uikit-question__prompt"
90
+ :class="{
91
+ 'uikit-question__prompt--passage-and-image': question.passage || passageImageUrl,
92
+ }"
93
+ v-html="question.question"
94
+ />
95
+ <PocketButton
96
+ v-if="question.passage || passageImageUrl"
97
+ v-breakpoint:questionEl="breakpoints"
98
+ class="uikit-question__skip-to-passage"
99
+ @click="moveFocusToPassage"
100
+ >
101
+ Skip to Passage
102
+ </PocketButton>
103
+ <div
104
+ v-if="question.passage || passageImageUrl"
105
+ v-breakpoint:questionEl="breakpoints"
106
+ v-dark="isDarkMode"
107
+ class="uikit-question__passage-and-image-dropdown"
108
+ :class="{ 'uikit-question__passage-and-image-dropdown--review-mode': reviewMode }"
109
+ >
110
+ <div
111
+ v-dark="isDarkMode"
112
+ class="uikit-question__passage-and-image-dropdown-btn"
113
+ tabindex="0"
114
+ role="button"
115
+ :aria-expanded="showPassageImageDropdown ? 'true' : 'false'"
116
+ @click.stop="showPassageImageDropdown = !showPassageImageDropdown"
117
+ @keydown.enter.stop="showPassageImageDropdown = !showPassageImageDropdown"
118
+ @mousedown.prevent
119
+ >
120
+ <Icon
121
+ v-if="question.passage"
122
+ class="uikit-question__passage-dropdown-icon"
123
+ type="passage"
124
+ />
125
+ <Icon
126
+ v-else
127
+ class="uikit-question__image-dropdown-icon"
128
+ type="image"
129
+ />
130
+ <span v-dark="isDarkMode" class="uikit-question__passage-and-image-dropdown-text">
131
+ {{ showPassageImageDropdown ? 'Hide' : 'Show' }}
132
+ {{ passageAndImageTitle }}
133
+ </span>
134
+ <Icon
135
+ v-dark="isDarkMode"
136
+ class="uikit-question__passage-and-image-dropdown-arrow"
137
+ :class="{
138
+ 'uikit-question__passage-and-image-dropdown-arrow--up': showPassageImageDropdown,
139
+ }"
140
+ type="accordionArrow"
141
+ />
142
+ </div>
143
+ <div
144
+ v-if="showPassageImageDropdown"
145
+ v-breakpoint:questionEl="breakpoints"
146
+ class="uikit-question__passage-and-image-dropdown-container"
147
+ >
148
+ <div
149
+ v-if="question.passage"
150
+ v-breakpoint:questionEl="breakpoints"
151
+ class="uikit-question__passage-dropdown-passage"
152
+ :class="{
153
+ 'uikit-question__passage-dropdown-passage--with-image': passageImageUrl,
154
+ }"
155
+ v-html="question.passage"
156
+ />
157
+ <img
158
+ v-if="passageImageUrl"
159
+ v-dark="isDarkMode"
160
+ class="uikit-question__image-dropdown-image"
161
+ :class="{
162
+ 'uikit-question__image-dropdown-image--with-passage': question.passage,
163
+ }"
164
+ :src="passageImageUrl"
165
+ :alt="`${passageImageAlt}. Extended image description below.`"
166
+ >
167
+ <PocketButton
168
+ v-if="passageImageLongAlt"
169
+ v-breakpoint:questionEl="breakpoints"
170
+ type="tertiary-small"
171
+ class="uikit-question__toggle-img-dropdown-img-description"
172
+ :class="{
173
+ 'uikit-question__toggle-img-dropdown-img-description--open': showPassageImageLongAlt,
174
+ }"
175
+ :is-dark-mode="isDarkMode"
176
+ :aria-expanded="showPassageImageLongAlt ? 'true' : 'false'"
177
+ @click.stop="togglePassageImageLongAlt"
178
+ @mousedown.prevent
179
+ >
180
+ <span class="uikit-question__toggle-img-dropdown-img-description-text">Image Description</span>
181
+ <Icon
182
+ class="uikit-question__toggle-img-dropdown-img-description-icon"
183
+ :class="{
184
+ 'uikit-question__toggle-img-dropdown-img-description-icon--up': showPassageImageLongAlt,
185
+ }"
186
+ type="accordionArrow"
187
+ />
188
+ </PocketButton>
189
+ <div
190
+ v-if="showPassageImageLongAlt"
191
+ ref="uikit-question__img-dropdown-img-description"
192
+ v-breakpoint:questionEl="breakpoints"
193
+ v-dark="isDarkMode"
194
+ class="uikit-question__img-dropdown-img-description"
195
+ tabindex="-1"
196
+ v-html="passageImageLongAlt"
197
+ />
198
+ </div>
199
+ </div>
200
+ <div
201
+ v-if="showPaywall"
202
+ class="uikit-question__paywall-container"
203
+ >
204
+ <div
205
+ v-dark="isDarkMode"
206
+ v-breakpoint:questionEl="breakpoints"
207
+ class="uikit-question__paywall"
208
+ :class="{ 'uikit-question__paywall--review': reviewMode }"
209
+ >
210
+ <img
211
+ v-breakpoint:questionEl="breakpoints"
212
+ :src="isDarkMode ? paywallImages['dark'] : paywallImages['light']"
213
+ alt=""
214
+ class="uikit-question__paywall-image"
215
+ >
216
+ <div
217
+ v-dark="isDarkMode"
218
+ v-breakpoint:questionEl="breakpoints"
219
+ class="uikit-question__paywall-text"
220
+ >
221
+ You need a Premium Subscription to view this question's answer and explanation.
222
+ </div>
223
+ <PocketButton
224
+ :is-dark-mode="isDarkMode"
225
+ class="uikit-question__paywall-button"
226
+ @click="emitUpgrade"
227
+ >
228
+ Upgrade to Premium
229
+ </PocketButton>
230
+ </div>
231
+ </div>
232
+ <div
233
+ v-if="showAnswers && isTeachReview && isUnanswered"
234
+ v-dark="isDarkMode"
235
+ class="uikit-question__unanswered-teach-review-label"
236
+ >
237
+ <span>
238
+ Unanswered
239
+ </span>
240
+ </div>
241
+ <div
242
+ v-if="!showPaywall"
243
+ v-dark="isDarkMode"
244
+ class="uikit-question__choices"
245
+ :class="{
246
+ 'uikit-question__choices--correct': showAnswers && isMCR && isCorrect,
247
+ 'uikit-question__choices--incorrect':
248
+ showAnswers && (isMCR || isUnanswered) && !isCorrect && !isTeachReview,
249
+ 'uikit-question__choices--unanswered': showAnswers && !isMCR && isUnanswered && !isCorrect,
250
+ 'uikit-question__choices--show-stats': globalMetrics,
251
+ 'uikit-question__choices--no-actions': !(isMCR || isUnanswered)
252
+ && !globalMetrics
253
+ && (
254
+ reviewMode
255
+ || (
256
+ !showAnswers
257
+ && !showCheckAnswer
258
+ && !hideAnswer
259
+ )
260
+ )
261
+ }"
262
+ :role="isMCR
263
+ ? 'group'
264
+ : 'radiogroup'
265
+ "
266
+ >
267
+ <div
268
+ v-if="showAnswers && !isMCR && isUnanswered && !isCorrect && !isTeachReview"
269
+ v-dark="isDarkMode"
270
+ class="uikit-question__unanswered-label"
271
+ >
272
+ <span>Unanswered</span>
273
+ <Icon
274
+ v-dark="isDarkMode"
275
+ class="uikit-question__unanswered-label-icon"
276
+ type="incorrect"
277
+ />
278
+ </div>
279
+ <div
280
+ v-for="(choice, index) in choices"
281
+ :key="choice.key"
282
+ ref="choices"
283
+ v-dark="isDarkMode"
284
+ class="uikit-question__choice-container"
285
+ :class="{
286
+ 'uikit-question__choice-container--hover': !showAnswers && hoverChoiceKey === choice.key,
287
+ 'uikit-question__choice-container--focus': !showAnswers && focusChoiceKey === choice.key,
288
+ 'uikit-question__choice-container--selected': !showAnswers
289
+ && selectedChoices.includes(choice.key),
290
+ 'uikit-question__choice-container--correct': !isMCR && showAnswers && !isUnanswered
291
+ && answerKeys.includes(choice.key),
292
+ 'uikit-question__choice-container--incorrect': !isMCR && showAnswers
293
+ && selectedChoices.includes(choice.key)
294
+ && distractorKeys.includes(choice.key),
295
+ 'uikit-question__choice-container--big': !isMCR && !globalMetrics && (
296
+ showAnswers && !isUnanswered
297
+ ? answerKeys.includes(choice.key)
298
+ : selectedChoices.includes(choice.key)
299
+ ),
300
+ }"
301
+ @mousedown.prevent
302
+ @mouseover="hoverChoiceKey = choice.key"
303
+ @mouseleave="hoverChoiceKey = null"
304
+ @focusin="focusChoiceKey = choice.key"
305
+ @focusout="choiceFocusOut"
306
+ @click.stop="selectChoice(choice.key)"
307
+ @keydown.enter.stop="selectChoice(choice.key)"
308
+ @touchstart="handleTouchStart"
309
+ @touchmove="handleTouchMove"
310
+ @touchend="handleTouchEnd(choice.key, $event)"
311
+ >
312
+ <div
313
+ v-if="!reviewMode"
314
+ v-breakpoint:questionEl="breakpoints"
315
+ v-dark="isDarkMode"
316
+ class="uikit-question__choice-letter"
317
+ :class="!isMCR && {
318
+ 'uikit-question__choice-letter--selected': selectedChoices.includes(choice.key),
319
+ 'uikit-question__choice-letter--correct': showAnswers
320
+ && answerKeys.includes(choice.key),
321
+ 'uikit-question__choice-letter--incorrect': showAnswers
322
+ && selectedChoices.includes(choice.key)
323
+ && distractorKeys.includes(choice.key),
324
+ 'uikit-question__choice-letter--big': !globalMetrics && (showAnswers
325
+ ? answerKeys.includes(choice.key)
326
+ : selectedChoices.includes(choice.key)),
327
+ }"
328
+ >
329
+ {{ String.fromCharCode(index + 65) }}
330
+ </div>
331
+ <div
332
+ :ref="`choice-${choice.key}`"
333
+ v-dark="isDarkMode"
334
+ v-breakpoint:questionEl="breakpoints"
335
+ class="uikit-question__choice"
336
+ :class="{
337
+ 'uikit-question__choice--strike': showAnswers
338
+ ? isMCR
339
+ ? distractorKeys.includes(choice.key)
340
+ : choiceStrikes.includes(choice.key) && !answerKeys.includes(choice.key)
341
+ : choiceStrikes.includes(choice.key),
342
+ 'uikit-question__choice--big': !isMCR && !globalMetrics && (
343
+ showAnswers && !isUnanswered
344
+ ? answerKeys.includes(choice.key)
345
+ : selectedChoices.includes(choice.key)
346
+ ),
347
+ 'uikit-question__choice--mcr': isMCR,
348
+ 'uikit-question__choice--selected': !showAnswers && selectedChoices.includes(choice.key),
349
+ 'uikit-question__choice--distractor': showAnswers
350
+ && distractorKeys.includes(choice.key),
351
+ 'uikit-question__choice--show-stats': globalMetrics,
352
+ 'uikit-question__choice--review-mode': reviewMode,
353
+ }"
354
+ >
355
+ <div
356
+ v-if="isMCR"
357
+ v-dark="isDarkMode"
358
+ class="uikit-question__mcr-checkbox"
359
+ :class="{
360
+ 'uikit-question__mcr-checkbox--selected': selectedChoices.includes(choice.key),
361
+ 'uikit-question__mcr-checkbox--answer': showAnswers
362
+ && answerKeys.includes(choice.key),
363
+ 'uikit-question__mcr-checkbox--distractor': showAnswers
364
+ && distractorKeys.includes(choice.key),
365
+ 'uikit-question__mcr-checkbox--strike': !showAnswers
366
+ && choiceStrikes.includes(choice.key),
367
+ }"
368
+ >
369
+ <Icon
370
+ v-if="selectedChoices.includes(choice.key) || (
371
+ showAnswers && answerKeys.includes(choice.key)
372
+ )"
373
+ class="uikit-question__mcr-check"
374
+ type="check"
375
+ />
376
+ </div>
377
+ <div
378
+ class="uikit-question__choice-text"
379
+ :tabindex="showAnswers ? -1 : 0"
380
+ :role="isMCR
381
+ ? 'checkbox'
382
+ : 'radio'
383
+ "
384
+ :aria-checked="selectedChoices.includes(choice.key) ? 'true' : 'false'"
385
+ :aria-label="`${
386
+ showAnswers
387
+ ? answerKeys.includes(choice.key)
388
+ ? 'Correct Answer, '
389
+ : 'Incorrect Answer, '
390
+ : ''
391
+ }${ stripText(choice.text) }`"
392
+ v-html="choice.text"
393
+ />
394
+ <PocketButton
395
+ v-if="!isMCR && showAnswers && answerKeys.includes(choice.key)"
396
+ v-breakpoint:questionEl="breakpoints"
397
+ type="tertiary-small"
398
+ class="uikit-question__toggle-explanation"
399
+ :class="{ 'uikit-question__toggle-explanation--review-mode': reviewMode }"
400
+ :is-dark-mode="isDarkMode"
401
+ :aria-expanded="showExplanation ? 'true' : 'false'"
402
+ @click.stop="toggleExplanation"
403
+ @mousedown.prevent
404
+ >
405
+ <span
406
+ ref="uikit-question__toggle-explanation-text"
407
+ class="uikit-question__toggle-explanation-text"
408
+ tabindex="-1"
409
+ >{{ showExplanation ? 'Hide' : 'Show' }} Explanation</span>
410
+ <Icon
411
+ v-breakpoint:questionEl="breakpoints"
412
+ class="uikit-question__toggle-explanation-icon"
413
+ :class="{
414
+ 'uikit-question__toggle-explanation-icon--up': showExplanation,
415
+ }"
416
+ type="accordionArrow"
417
+ />
418
+ </PocketButton>
419
+ <div
420
+ v-if="!isMCR && showAnswers && answerKeys.includes(choice.key) && showExplanation"
421
+ v-breakpoint:questionEl="breakpoints"
422
+ class="uikit-question__dropdown-explanation"
423
+ :class="{
424
+ 'uikit-question__dropdown-explanation--show-stats': globalMetrics
425
+ }"
426
+ >
427
+ <div
428
+ v-dark="isDarkMode"
429
+ class="uikit-question__dropdown-explanation-text"
430
+ v-html="question.explanation"
431
+ />
432
+ <img
433
+ v-if="explanationImageUrl"
434
+ v-dark="isDarkMode"
435
+ class="uikit-question__dropdown-explanation-image"
436
+ :src="explanationImageUrl"
437
+ :alt="`${explanationImageAlt}. Extended image description below.`"
438
+ >
439
+ <PocketButton
440
+ v-if="explanationImageLongAlt"
441
+ v-breakpoint:questionEl="breakpoints"
442
+ type="tertiary-small"
443
+ class="uikit-question__toggle-dropdown-explanation-img-description"
444
+ :class="{
445
+ 'uikit-question__toggle-dropdown-explanation-img-description--open':
446
+ showExplanationImageLongAlt,
447
+ 'uikit-question__toggle-dropdown-explanation-img-description--no-reference':
448
+ !question.reference || hideReferences,
449
+ }"
450
+ :is-dark-mode="isDarkMode"
451
+ :aria-expanded="showExplanationImageLongAlt ? 'true' : 'false'"
452
+ @click.stop="toggleExplanationImageLongAlt"
453
+ @mousedown.prevent
454
+ >
455
+ <span class="uikit-question__toggle-dropdown-explanation-img-description-text">
456
+ Image Description
457
+ </span>
458
+ <Icon
459
+ class="uikit-question__toggle-dropdown-explanation-img-description-icon"
460
+ :class="{
461
+ 'uikit-question__toggle-dropdown-explanation-img-description-icon--up':
462
+ showExplanationImageLongAlt,
463
+ }"
464
+ type="accordionArrow"
465
+ />
466
+ </PocketButton>
467
+ <div
468
+ v-if="showExplanationImageLongAlt"
469
+ ref="uikit-question__dropdown-explanation-img-description"
470
+ v-dark="isDarkMode"
471
+ v-breakpoint:questionEl="breakpoints"
472
+ class="uikit-question__dropdown-explanation-img-description"
473
+ tabindex="-1"
474
+ v-html="explanationImageLongAlt"
475
+ />
476
+ <div
477
+ v-if="question.reference && !hideReferences"
478
+ v-dark="isDarkMode"
479
+ class="uikit-question__dropdown-reference"
480
+ >
481
+ <span class="uikit-question__dropdown-reference-label">Reference: </span>
482
+ <div v-html="question.reference" />
483
+ </div>
484
+ </div>
485
+ </div>
486
+ <template v-if="!globalMetrics">
487
+ <div
488
+ v-if="!showAnswers"
489
+ v-breakpoint:questionEl="breakpoints"
490
+ v-dark="isDarkMode"
491
+ :tabindex="showAnswers ? -1 : 0"
492
+ class="uikit-question__strikethrough"
493
+ aria-label="Strikethrough"
494
+ role="switch"
495
+ :aria-checked="choiceStrikes.includes(choice.key) ? 'true' : 'false'"
496
+ :class="{
497
+ 'uikit-question__strikethrough--visible': !showAnswers
498
+ && [ hoverChoiceKey, focusChoiceKey ].includes(choice.key),
499
+ 'uikit-question__strikethrough--active': choiceStrikes.includes(choice.key),
500
+ }"
501
+ @mousedown.prevent
502
+ @click.stop="clickChoiceStrike(choice.key)"
503
+ @keydown.enter.stop="clickChoiceStrike(choice.key)"
504
+ >
505
+ <Icon type="strike" />
506
+ </div>
507
+ <Icon
508
+ v-if="!isMCR
509
+ && showAnswers
510
+ && answerKeys.includes(choice.key)
511
+ && (isCorrect || isUnanswered)
512
+ "
513
+ v-dark="isDarkMode"
514
+ type="correct"
515
+ class="uikit-question__correct-icon"
516
+ :class="{
517
+ 'uikit-question__correct-icon--review-mode': reviewMode,
518
+ }"
519
+ />
520
+ <Icon
521
+ v-if="showAnswers && (
522
+ (
523
+ selectedChoices.includes(choice.key)
524
+ && distractorKeys.includes(choice.key)
525
+ ) || (
526
+ isMCR
527
+ && !selectedChoices.includes(choice.key)
528
+ && answerKeys.includes(choice.key)
529
+ )
530
+ )"
531
+ v-dark="isDarkMode"
532
+ type="incorrect"
533
+ class="uikit-question__incorrect-icon"
534
+ :class="{
535
+ 'uikit-question__incorrect-icon--mcr': isMCR,
536
+ }"
537
+ />
538
+ </template>
539
+ <template v-else>
540
+ <div
541
+ v-dark="isDarkMode"
542
+ class="uikit-question__choice-stats-pct"
543
+ >
544
+ {{ choiceScores[choice.key] }} %
545
+ </div>
546
+ <div v-dark="isDarkMode" class="uikit-question__choice-stats-bar">
547
+ <div
548
+ v-dark="isDarkMode"
549
+ class="uikit-question__choice-stats-bar-fill"
550
+ :class="{
551
+ 'uikit-question__choice-stats-bar-fill--correct': showAnswers
552
+ && answerKeys.includes(choice.key),
553
+ 'uikit-question__choice-stats-bar-fill--incorrect': showAnswers
554
+ && distractorKeys.includes(choice.key)
555
+ && selectedChoices.includes(choice.key),
556
+ }"
557
+ :style="{
558
+ 'width': `${(choiceScores[choice.key]) || 0}%`
559
+ }"
560
+ />
561
+ </div>
562
+ </template>
563
+ </div>
564
+ </div>
565
+ <div
566
+ v-if="isMCR && showAnswers && !showPaywall"
567
+ v-dark="isDarkMode"
568
+ v-breakpoint:questionEl="breakpoints"
569
+ class="uikit-question__summary"
570
+ >
571
+ <div class="uikit-question__summary-title">
572
+ {{ isCorrect ? 'Correct': isUnanswered ? 'Unanswered' : 'Incorrect' }}
573
+ </div>
574
+ <PocketButton
575
+ v-breakpoint:questionEl="breakpoints"
576
+ type="tertiary-small"
577
+ class="uikit-question__summary-toggle-explanation"
578
+ :class="{ 'uikit-question__summary-toggle-explanation': reviewMode }"
579
+ :is-dark-mode="isDarkMode"
580
+ :aria-expanded="showExplanation ? 'true' : 'false'"
581
+ @click="toggleExplanation"
582
+ @mousedown.prevent
583
+ >
584
+ <span
585
+ ref="uikit-question__summary-toggle-explanation-text"
586
+ class="uikit-question__summary-toggle-explanation-text"
587
+ tabindex="-1"
588
+ >{{ showExplanation ? 'Hide' : 'Show' }} Explanation</span>
589
+ <Icon
590
+ v-breakpoint:questionEl="breakpoints"
591
+ type="accordionArrow"
592
+ class="uikit-question__summary-toggle-explanation-icon"
593
+ :class="{
594
+ 'uikit-question__summary-toggle-explanation-icon--up': showExplanation,
595
+ }"
596
+ />
597
+ </PocketButton>
598
+ <div
599
+ v-if="showExplanation"
600
+ v-breakpoint:questionEl="breakpoints"
601
+ class="uikit-question__summary-dropdown-explanation"
602
+ >
603
+ <div
604
+ v-dark="isDarkMode"
605
+ class="uikit-question__summary-dropdown-explanation-text"
606
+ v-html="question.explanation"
607
+ />
608
+ <img
609
+ v-if="explanationImageUrl"
610
+ v-dark="isDarkMode"
611
+ class="uikit-question__summary-dropdown-explanation-image"
612
+ :src="explanationImageUrl"
613
+ :alt="`${explanationImageAlt}. Extended image description below.`"
614
+ >
615
+ <PocketButton
616
+ v-if="explanationImageLongAlt"
617
+ v-breakpoint:questionEl="breakpoints"
618
+ type="tertiary-small"
619
+ class="uikit-question__toggle-summary-dropdown-explanation-img-description"
620
+ :class="{
621
+ 'uikit-question__toggle-summary-dropdown-explanation-img-description--open':
622
+ showExplanationImageLongAlt,
623
+ 'uikit-question__toggle-summary-dropdown-explanation-img-description--no-reference':
624
+ !question.reference || hideReferences,
625
+ }"
626
+ :is-dark-mode="isDarkMode"
627
+ :aria-expanded="showExplanationImageLongAlt ? 'true' : 'false'"
628
+ @click.stop="toggleExplanationImageLongAlt"
629
+ @mousedown.prevent
630
+ >
631
+ <span class="uikit-question__toggle-summary-dropdown-explanation-img-description-text">
632
+ Image Description
633
+ </span>
634
+ <Icon
635
+ class="uikit-question__toggle-summary-dropdown-explanation-img-description-icon"
636
+ :class="{
637
+ 'uikit-question__toggle-summary-dropdown-explanation-img-description-icon--up':
638
+ showExplanationImageLongAlt,
639
+ }"
640
+ type="accordionArrow"
641
+ />
642
+ </PocketButton>
643
+ <div
644
+ v-if="showExplanationImageLongAlt"
645
+ ref="uikit-question__summary-dropdown-explanation-img-description"
646
+ v-dark="isDarkMode"
647
+ v-breakpoint:questionEl="breakpoints"
648
+ class="uikit-question__summary-dropdown-explanation-img-description"
649
+ tabindex="-1"
650
+ v-html="explanationImageLongAlt"
651
+ />
652
+ <div
653
+ v-if="question.reference && !hideReferences"
654
+ v-dark="isDarkMode"
655
+ class="uikit-question__summary-dropdown-reference"
656
+ >
657
+ <span class="uikit-question__summary-dropdown-reference-label">Reference: </span>
658
+ <div v-html="question.reference" />
659
+ </div>
660
+ </div>
661
+ <Icon
662
+ v-if="isCorrect"
663
+ v-dark="isDarkMode"
664
+ type="correct"
665
+ class="uikit-question__summary-correct-icon"
666
+ />
667
+ <Icon
668
+ v-else
669
+ v-dark="isDarkMode"
670
+ type="incorrect"
671
+ class="uikit-question__summary-incorrect-icon"
672
+ />
673
+ </div>
674
+ <div
675
+ v-if="globalMetrics"
676
+ class="uikit-question__stats-summary"
677
+ >
678
+ <div v-dark="isDarkMode" class="uikit-question__stats-summary-total">
679
+ <div class="uikit-question__stats-summary-value">
680
+ {{ choiceScores.totalAnswered }}
681
+ </div>
682
+ <div v-dark="isDarkMode" class="uikit-question__stats-summary-label">
683
+ Studiers Answered
684
+ </div>
685
+ </div>
686
+ <div v-dark="isDarkMode" class="uikit-question__stats-summary-correct">
687
+ <div class="uikit-question__stats-summary-value">
688
+ {{ Math.round((choiceScores.answeredCorrectly / choiceScores.totalAnswered) * 100) }}%
689
+ </div>
690
+ <div v-dark="isDarkMode" class="uikit-question__stats-summary-label">
691
+ Answered Correctly
692
+ </div>
693
+ </div>
694
+ </div>
695
+ <div
696
+ v-if="!reviewMode"
697
+ v-breakpoint:questionEl="breakpoints"
698
+ class="uikit-question__action-container"
699
+ :class="{
700
+ 'uikit-question__action-container--mcr-summary': isMCR && showAnswers,
701
+ }"
702
+ >
703
+ <slot name="action">
704
+ <PocketButton
705
+ v-if="!showAnswers && !hideAnswer && (showCheckAnswer || isMCR)"
706
+ :disabled="!selectedChoices.length"
707
+ :is-dark-mode="isDarkMode"
708
+ @click="clickCheckAnswer"
709
+ >
710
+ Check Answer
711
+ </PocketButton>
712
+ <PocketButton
713
+ v-else-if="(showAnswers || hideAnswer) && (questionNumber >= quizLength)"
714
+ :is-dark-mode="isDarkMode"
715
+ @click="emitSubmitQuiz"
716
+ >
717
+ Submit Quiz
718
+ </PocketButton>
719
+ <PocketButton
720
+ v-else-if="(showAnswers || hideAnswer) && showNextQuestion"
721
+ :is-dark-mode="isDarkMode"
722
+ @click="emitNextQuestion"
723
+ >
724
+ Next Question
725
+ </PocketButton>
726
+ <PocketButton
727
+ v-else-if="showCloseButton"
728
+ :is-dark-mode="isDarkMode"
729
+ @click="emitClose"
730
+ >
731
+ Close
732
+ </PocketButton>
733
+ </slot>
734
+ </div>
735
+ <slot name="afterQuestion" />
736
+ </div>
737
+ <div
738
+ v-if="showPassageAndImage || (showExplanation && !showPaywall)"
739
+ v-breakpoint:questionEl="breakpoints"
740
+ class="uikit-question__right-side"
741
+ :class="{
742
+ 'uikit-question__right-side--explanation': showExplanation && !showPaywall,
743
+ }"
744
+ >
745
+ <div
746
+ v-if="showPassageAndImage"
747
+ v-breakpoint:questionEl="breakpoints"
748
+ class="uikit-question__passage-and-image"
749
+ >
750
+ <div
751
+ ref="uikit-question__passage-and-image-title"
752
+ v-dark="isDarkMode"
753
+ class="uikit-question__passage-and-image-title"
754
+ tabindex="-1"
755
+ >
756
+ {{ passageAndImageTitle }}
757
+ </div>
758
+ <div
759
+ v-if="question.passage"
760
+ class="uikit-question__passage"
761
+ v-html="question.passage"
762
+ />
763
+ <img
764
+ v-if="passageImageUrl"
765
+ v-dark="isDarkMode"
766
+ v-breakpoint:questionEl="breakpoints"
767
+ class="uikit-question__image"
768
+ :src="passageImageUrl"
769
+ :alt="`${passageImageAlt}. Extended image description below.`"
770
+ >
771
+ <PocketButton
772
+ v-if="passageImageLongAlt"
773
+ v-breakpoint:questionEl="breakpoints"
774
+ type="tertiary-small"
775
+ class="uikit-question__toggle-passage-image-description"
776
+ :is-dark-mode="isDarkMode"
777
+ :aria-expanded="showPassageImageLongAlt ? 'true' : 'false'"
778
+ @click.stop="togglePassageImageLongAlt"
779
+ @mousedown.prevent
780
+ >
781
+ <span class="uikit-question__toggle-passage-image-description-text">Image Description</span>
782
+ <Icon
783
+ class="uikit-question__toggle-passage-image-description-icon"
784
+ :class="{
785
+ 'uikit-question__toggle-passage-image-description-icon--up': showPassageImageLongAlt,
786
+ }"
787
+ type="accordionArrow"
788
+ />
789
+ </PocketButton>
790
+ <div
791
+ v-if="showPassageImageLongAlt"
792
+ ref="uikit-question__passage-image-description"
793
+ v-dark="isDarkMode"
794
+ class="uikit-question__passage-image-description"
795
+ tabindex="-1"
796
+ v-html="passageImageLongAlt"
797
+ />
798
+ <PocketButton
799
+ class="uikit-question__return-to-prompt"
800
+ @click="moveFocusToPrompt"
801
+ >
802
+ Return to Question
803
+ </PocketButton>
804
+ </div>
805
+ <div
806
+ v-if="showExplanation && !showPaywall"
807
+ v-breakpoint:questionEl="breakpoints"
808
+ v-dark="isDarkMode"
809
+ class="uikit-question__explanation"
810
+ >
811
+ <div
812
+ ref="explanation"
813
+ v-dark="isDarkMode"
814
+ class="uikit-question__explanation-title"
815
+ tabindex="-1"
816
+ >
817
+ Explanation Details
818
+ </div>
819
+ <div
820
+ v-dark="isDarkMode"
821
+ v-breakpoint:questionEl="breakpoints"
822
+ class="uikit-question__explanation-text"
823
+ v-html="question.explanation"
824
+ />
825
+ <img
826
+ v-if="explanationImageUrl"
827
+ v-dark="isDarkMode"
828
+ v-breakpoint:questionEl="breakpoints"
829
+ class="uikit-question__explanation-image"
830
+ :class="{
831
+ 'uikit-question__explanation-image--long-alt': explanationImageLongAlt,
832
+ }"
833
+ :src="explanationImageUrl"
834
+ :alt="`${explanationImageAlt}. Extended image description below.`"
835
+ >
836
+ <PocketButton
837
+ v-if="explanationImageLongAlt"
838
+ v-breakpoint:questionEl="breakpoints"
839
+ type="tertiary-small"
840
+ class="uikit-question__toggle-explanation-img-description"
841
+ :class="{
842
+ 'uikit-question__toggle-explanation-img-description--open': showExplanationImageLongAlt,
843
+ }"
844
+ :is-dark-mode="isDarkMode"
845
+ :aria-expanded="showExplanationImageLongAlt ? 'true' : 'false'"
846
+ @click.stop="toggleExplanationImageLongAlt"
847
+ @mousedown.prevent
848
+ >
849
+ <span class="uikit-question__toggle-explanation-img-description-text">Image Description</span>
850
+ <Icon
851
+ class="uikit-question__toggle-explanation-img-description-icon"
852
+ :class="{
853
+ 'uikit-question__toggle-explanation-img-description-icon--up': showExplanationImageLongAlt,
854
+ }"
855
+ type="accordionArrow"
856
+ />
857
+ </PocketButton>
858
+ <div
859
+ v-if="showExplanationImageLongAlt"
860
+ ref="uikit-question__explanation-img-description"
861
+ v-dark="isDarkMode"
862
+ class="uikit-question__explanation-img-description"
863
+ tabindex="-1"
864
+ v-html="explanationImageLongAlt"
865
+ />
866
+ <div
867
+ v-if="question.reference && !hideReferences"
868
+ v-dark="isDarkMode"
869
+ class="uikit-question__reference"
870
+ >
871
+ <span class="uikit-question__reference-label">Reference: </span>
872
+ <div v-html="question.reference" />
873
+ </div>
874
+ <div
875
+ v-if="!reviewMode"
876
+ v-dark="isDarkMode"
877
+ class="uikit-question__explanation-close"
878
+ tabindex="0"
879
+ role="button"
880
+ aria-label="Close explanation"
881
+ @keydown.enter.stop="toggleExplanation"
882
+ @click.stop="toggleExplanation"
883
+ @mousedown.prevent
884
+ >
885
+ <Icon type="close" />
886
+ </div>
887
+ </div>
888
+ </div>
889
+ </div>
890
+ </template>
891
+
892
+ <script lang="ts">
893
+ import { Component, Vue, Prop, Watch, Emit } from 'vue-facing-decorator'
894
+ import PocketButton from '../Buttons/Button.vue'
895
+ import Icon from '../Icons/Icon.vue'
896
+ import type { Study } from '@pocketprep/types'
897
+ import { breakpoint, dark } from '../../directives'
898
+ import { studyModes } from '../../utils'
899
+ import PaywallImageLight from '../../assets/question/paywall-light.png'
900
+ import PaywallImageDark from '../../assets/question/paywall-dark.png'
901
+
902
+ type TChoiceKey = `${'a' | 'd'}${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`
903
+ type TChoice = { text?: string; key: TChoiceKey }
904
+ type TChoiceScores = Partial<Record<TChoiceKey, number>> & {
905
+ totalAnswered: number
906
+ answeredCorrectly: number
907
+ }
908
+ type TQuizMode = 'qotd' | 'quick10' | 'timed' | 'weakest' | 'missed' | 'custom'
909
+ type Ref = HTMLElement | null
910
+
911
+ @Component({
912
+ components: {
913
+ PocketButton,
914
+ Icon,
915
+ },
916
+ directives: {
917
+ breakpoint,
918
+ dark,
919
+ },
920
+ })
921
+ export default class Question extends Vue {
922
+ @Prop() question!: Study.Class.ExamDataJSON
923
+ @Prop() questionNumber!: number
924
+ @Prop() quizLength!: number
925
+ @Prop({ default: '' }) imageUrlPrefix!: string
926
+ @Prop({ default: 'quick10' }) quizMode!: TQuizMode
927
+ @Prop({ default: false }) initialShowAnswers!: boolean
928
+ @Prop({ default: true }) showCheckAnswer!: boolean
929
+ @Prop({ default: false }) hideAnswer!: boolean
930
+ @Prop({ default: true }) showNextQuestion!: boolean
931
+ @Prop({ default: false }) reviewMode!: boolean
932
+ @Prop({ default: null }) previousChoices!: TChoiceKey[] | null
933
+ @Prop({ default: null }) globalMetrics!: Study.Class.GlobalQuestionMetricJSON | null
934
+ @Prop({ default: true }) allowKeyboardShortcuts!: boolean
935
+ @Prop({ default: null }) containerEl!: Element | null
936
+ @Prop({ default: false }) isDarkMode!: boolean
937
+ @Prop({ default: null }) answerSeed!: number[]
938
+ @Prop({ default: false }) showCloseButton!: boolean
939
+ @Prop({ default: null }) defaultShowExplanation!: boolean
940
+ @Prop({ default: false }) autoFocusPrompt!: boolean | null // false autofocuses the context, null is no autofocus
941
+ @Prop({ default: false }) showPaywall!: boolean
942
+ @Prop({ default: false }) hideReferences!: boolean
943
+ @Prop({ default: false }) isTeachReview!: boolean
944
+
945
+ hoverChoiceKey: TChoiceKey | null = null
946
+ focusChoiceKey: TChoiceKey | null = null
947
+ choiceStrikes: TChoiceKey[] = []
948
+ selectedChoices: TChoiceKey[] = []
949
+ showAnswers = false
950
+ showExplanation = false
951
+ showPassageImageDropdown = false
952
+ showPassageImageLongAlt = false
953
+ showExplanationImageDropdown = false
954
+ showExplanationImageLongAlt = false
955
+ swipeStart: {
956
+ x: number | null
957
+ y: number | null
958
+ } = { x: null, y: null }
959
+
960
+ get paywallImages () {
961
+ return {
962
+ light: PaywallImageLight,
963
+ dark: PaywallImageDark,
964
+ }
965
+ }
966
+
967
+ get breakpoints () {
968
+ // Passing the container element (typically QuizContainer) allows us to bind to that element's width
969
+ if (this.containerEl) {
970
+ return {
971
+ 'mobile': 767,
972
+ 'tablet-portrait': 1023,
973
+ 'tablet-landscape': 1439,
974
+ }
975
+ } else {
976
+ // These were calculated to account for the expected widths of our Quiz Container sides
977
+ return {
978
+ 'mobile': 729, // 767 - (19 + 19)
979
+ 'tablet-portrait': 978, // 1023 - (22 + 23)
980
+ 'tablet-landscape': 1309, // 1439 - (65 + 65)
981
+ }
982
+ }
983
+ }
984
+
985
+ get questionEl () {
986
+ return this.containerEl || this.$refs['question']
987
+ }
988
+
989
+ get contextIconType () {
990
+ const mode = this.quizMode
991
+ return Object.values(studyModes).find(studyMode => studyMode.shortName === mode)?.icon || 'quick10'
992
+ }
993
+
994
+ get isMCR () {
995
+ return this.question.type === 'Multiple Correct Response'
996
+ }
997
+
998
+ get passageImageUrl () {
999
+ const imageUrl = this.question.images?.passage?.url
1000
+ || this.question.images?.Question // Legacy support - TODO: remove when `Question` is deprecated
1001
+
1002
+ return imageUrl ? `${this.imageUrlPrefix}${imageUrl}` : null
1003
+ }
1004
+
1005
+ get passageImageAlt () {
1006
+ return this.question.images?.passage?.altText
1007
+ }
1008
+
1009
+ get passageImageLongAlt () {
1010
+ return this.question.images?.passage?.longAltText
1011
+ }
1012
+
1013
+ get explanationImageUrl () {
1014
+ const imageUrl = this.question.images?.explanation?.url
1015
+ || this.question.images?.Explanation // Legacy support - TODO: remove when `Explanation` is deprecated
1016
+
1017
+ return imageUrl ? `${this.imageUrlPrefix}${imageUrl}` : null
1018
+ }
1019
+
1020
+ get explanationImageAlt () {
1021
+ return this.question.images?.explanation?.altText
1022
+ }
1023
+
1024
+ get explanationImageLongAlt () {
1025
+ return this.question.images?.explanation?.longAltText
1026
+ }
1027
+
1028
+ get showPassageAndImage () {
1029
+ return !this.showExplanation && !!(this.question.passage || this.passageImageUrl)
1030
+ }
1031
+
1032
+ get passageAndImageTitle () {
1033
+ if (this.question.passage && this.passageImageUrl) {
1034
+ return 'Passage + Image'
1035
+ } else if (!this.question.passage && this.passageImageUrl) {
1036
+ return 'Image'
1037
+ } else {
1038
+ return 'Passage'
1039
+ }
1040
+ }
1041
+
1042
+ get answers (): TChoice[] {
1043
+ const answers = [
1044
+ { text: this.question.answer, key: 'a1' },
1045
+ { text: this.question.answer2, key: 'a2' },
1046
+ { text: this.question.answer3, key: 'a3' },
1047
+ { text: this.question.answer4, key: 'a4' },
1048
+ { text: this.question.answer5, key: 'a5' },
1049
+ { text: this.question.answer6, key: 'a6' },
1050
+ { text: this.question.answer7, key: 'a7' },
1051
+ { text: this.question.answer8, key: 'a8' },
1052
+ { text: this.question.answer9, key: 'a9' },
1053
+ ] as const
1054
+
1055
+ return answers.filter(choice => !!choice.text)
1056
+ }
1057
+
1058
+ get answerKeys (): TChoiceKey[] {
1059
+ return this.answers.map(choice => choice.key)
1060
+ }
1061
+
1062
+ get distractors (): TChoice[] {
1063
+ const distractors = [
1064
+ { text: this.question.distractor1, key: 'd1' },
1065
+ { text: this.question.distractor2, key: 'd2' },
1066
+ { text: this.question.distractor3, key: 'd3' },
1067
+ { text: this.question.distractor4, key: 'd4' },
1068
+ { text: this.question.distractor5, key: 'd5' },
1069
+ { text: this.question.distractor6, key: 'd6' },
1070
+ { text: this.question.distractor7, key: 'd7' },
1071
+ { text: this.question.distractor8, key: 'd8' },
1072
+ { text: this.question.distractor9, key: 'd9' },
1073
+ ] as const
1074
+
1075
+ return distractors.filter(choice => !!choice.text)
1076
+ }
1077
+
1078
+ get distractorKeys (): TChoiceKey[] {
1079
+ return this.distractors.map(choice => choice.key)
1080
+ }
1081
+
1082
+ get choices () {
1083
+ return this.shuffleChoices([
1084
+ ...this.answers,
1085
+ ...this.distractors,
1086
+ ])
1087
+ }
1088
+
1089
+ get isCorrect () {
1090
+ // In order to be correct, user must have selected all the answers and none of the distractors
1091
+ return this.showAnswers
1092
+ && this.selectedChoices.length === this.answerKeys.length
1093
+ && !this.selectedChoices.join(' ').includes('d')
1094
+ }
1095
+
1096
+ get choiceScores (): TChoiceScores {
1097
+ const globalMetrics = this.globalMetrics
1098
+
1099
+ const scores: TChoiceScores = {
1100
+ totalAnswered: this.selectedChoices.length && this.showAnswers && !this.reviewMode ? 1 : 0,
1101
+ answeredCorrectly: this.isCorrect && !this.reviewMode ? 1 : 0,
1102
+ }
1103
+
1104
+ if (!globalMetrics) {
1105
+ return scores
1106
+ }
1107
+
1108
+ scores.totalAnswered += (
1109
+ (globalMetrics.answeredCorrectlyCount || 0)
1110
+ + (globalMetrics.answeredIncorrectlyCount || 0)
1111
+ )
1112
+ scores.answeredCorrectly += (globalMetrics.answeredCorrectlyCount || 0)
1113
+
1114
+ const selectedChoicesCount = this.showAnswers && !this.reviewMode && this.selectedChoices.length || 0
1115
+ const totalChoicesCount = selectedChoicesCount + Object.values(globalMetrics.choiceStats)
1116
+ .reduce<number>((choiceCount, acc) => (acc || 0) + (choiceCount || 0), 0)
1117
+
1118
+ this.choices.forEach(({ key }) => {
1119
+ const globalAnswerCount = globalMetrics.choiceStats[key] || 0
1120
+ const userAnswerCount = this.showAnswers && this.selectedChoices.includes(key) && !this.reviewMode ? 1 : 0
1121
+ const choiceAnswerCount = globalAnswerCount + userAnswerCount
1122
+ const answerPct = Math.round((choiceAnswerCount / totalChoicesCount) * 100)
1123
+ scores[key] = answerPct
1124
+ })
1125
+
1126
+ return scores
1127
+ }
1128
+
1129
+ get isUnanswered () {
1130
+ return this.selectedChoices.length === 0
1131
+ }
1132
+
1133
+ mounted () {
1134
+ if (this.reviewMode) {
1135
+ this.startReviewMode()
1136
+ }
1137
+
1138
+ if (this.previousChoices) {
1139
+ this.updateSelectedChoices(this.previousChoices)
1140
+ }
1141
+
1142
+ if (this.initialShowAnswers) {
1143
+ this.showAnswers = this.initialShowAnswers
1144
+ }
1145
+
1146
+ if (this.allowKeyboardShortcuts) {
1147
+ window.addEventListener('keydown', this.keydownListener)
1148
+ }
1149
+
1150
+ if (this.autoFocusPrompt) {
1151
+ this.moveFocusToPrompt()
1152
+ } else if (this.autoFocusPrompt === false) {
1153
+ setTimeout(() => {
1154
+ const contextEl = this.$refs['uikit-question__context'] as HTMLElement | undefined
1155
+ contextEl?.focus()
1156
+ }, 0)
1157
+ }
1158
+ }
1159
+
1160
+ beforeUnmount () {
1161
+ window.removeEventListener('keydown', this.keydownListener)
1162
+ }
1163
+
1164
+ keydownListener (e: KeyboardEvent) {
1165
+ switch (e.code) {
1166
+ case 'KeyA':
1167
+ this.choices[0] && this.selectChoice(this.choices[0].key, true)
1168
+ break
1169
+ case 'KeyB':
1170
+ this.choices[1] && this.selectChoice(this.choices[1].key, true)
1171
+ break
1172
+ case 'KeyC':
1173
+ this.choices[2] && this.selectChoice(this.choices[2].key, true)
1174
+ break
1175
+ case 'KeyD':
1176
+ this.choices[3] && this.selectChoice(this.choices[3].key, true)
1177
+ break
1178
+ case 'KeyE':
1179
+ this.choices[4] && this.selectChoice(this.choices[4].key, true)
1180
+ break
1181
+ case 'KeyF':
1182
+ this.choices[5] && this.selectChoice(this.choices[5].key, true)
1183
+ break
1184
+ case 'KeyG':
1185
+ this.choices[6] && this.selectChoice(this.choices[6].key, true)
1186
+ break
1187
+ case 'KeyH':
1188
+ this.choices[7] && this.selectChoice(this.choices[7].key, true)
1189
+ break
1190
+ case 'KeyI':
1191
+ this.choices[8] && this.selectChoice(this.choices[8].key, true)
1192
+ break
1193
+ case 'KeyJ':
1194
+ this.choices[9] && this.selectChoice(this.choices[9].key, true)
1195
+ break
1196
+ case 'KeyX':
1197
+ this.showAnswers && this.toggleExplanation()
1198
+ break
1199
+ case 'Escape':
1200
+ this.emitClose()
1201
+ e.preventDefault()
1202
+ break
1203
+ case 'Enter':
1204
+ if (!this.showAnswers && this.selectedChoices.length && this.focusChoiceKey === null) {
1205
+ this.clickCheckAnswer()
1206
+ e.preventDefault()
1207
+ }
1208
+ break
1209
+ case 'ArrowLeft':
1210
+ this.emitPreviousQuestion()
1211
+ e.preventDefault()
1212
+ break
1213
+ case 'ArrowRight':
1214
+ this.emitNextQuestion()
1215
+ e.preventDefault()
1216
+ break
1217
+ }
1218
+ }
1219
+
1220
+ moveFocusToPassage () {
1221
+ setTimeout(() => {
1222
+ const passageTitleEl = this.$refs['uikit-question__passage-and-image-title'] as HTMLElement | undefined
1223
+ passageTitleEl?.focus()
1224
+ }, 0)
1225
+ }
1226
+
1227
+ moveFocusToPrompt () {
1228
+ setTimeout(() => {
1229
+ const promptEl = this.$refs['prompt'] as HTMLElement | undefined
1230
+ promptEl?.focus()
1231
+ }, 0)
1232
+ }
1233
+
1234
+ stripText (string?: string) {
1235
+ return string?.replace(/<[^\s>]+[^>]*>/gi, ' ').trim()
1236
+ }
1237
+
1238
+ startReviewMode () {
1239
+ this.showAnswers = true
1240
+ this.showExplanation = this.defaultShowExplanation === null ? true : this.defaultShowExplanation
1241
+ this.selectedChoices = this.answerKeys
1242
+ }
1243
+
1244
+ stopReviewMode () {
1245
+ this.showAnswers = false
1246
+ this.showExplanation = false
1247
+ this.selectedChoices = []
1248
+ }
1249
+
1250
+ updateSelectedChoices (choices: TChoiceKey[]) {
1251
+ this.selectedChoices = [ ...choices ]
1252
+ }
1253
+
1254
+ // deterministic shuffling of choices so they don't change order everytime you reload the component
1255
+ shuffleChoices (choices: TChoice[]): TChoice[] {
1256
+ const sortedChoices = choices.sort((a, b) => {
1257
+ const hashChar = (char: string, num: number) => ((num << 5) - num) + char.charCodeAt(0)
1258
+
1259
+ const aHash = a.text?.split('')
1260
+ .reduce((acc: number, char: string) => hashChar(char, acc) & hashChar(char, acc), 0)
1261
+ const bHash = b.text?.split('')
1262
+ .reduce((acc: number, char: string) => hashChar(char, acc) & hashChar(char, acc), 0)
1263
+
1264
+ return (aHash || 0) - (bHash || 0)
1265
+ })
1266
+
1267
+ return this.answerSeed
1268
+ ? this.answerSeed.reduce<TChoice[]>((acc, i) => {
1269
+ const sortedChoice = sortedChoices[i]
1270
+ if (sortedChoice) {
1271
+ acc.push(sortedChoice)
1272
+ }
1273
+
1274
+ return acc
1275
+ }, [])
1276
+ : sortedChoices
1277
+ }
1278
+
1279
+ choiceFocusOut (event: FocusEvent) {
1280
+ const relatedTarget = event.relatedTarget
1281
+ if (
1282
+ relatedTarget instanceof Element
1283
+ ) {
1284
+ const classesString = relatedTarget.getAttribute('class') || ''
1285
+ const classes = classesString.split(' ')
1286
+ if (classes.includes('uikit-question__strikethrough')) {
1287
+ return // Don't set focusChoiceKey = null
1288
+ }
1289
+ }
1290
+ this.focusChoiceKey = null
1291
+ }
1292
+
1293
+ handleTouchStart (event: TouchEvent) {
1294
+ this.swipeStart = {
1295
+ x: event?.touches[0]?.clientX || null,
1296
+ y: event?.touches[0]?.clientY || null,
1297
+ }
1298
+ }
1299
+
1300
+ handleTouchMove (event: TouchEvent) {
1301
+ if (event.cancelable) {
1302
+ const changedY = event?.changedTouches[0]?.clientY || null
1303
+ const changedX = event?.changedTouches[0]?.clientX || null
1304
+ if (
1305
+ changedY !== null
1306
+ && changedX !== null
1307
+ && this.swipeStart.y !== null
1308
+ && this.swipeStart.x !== null
1309
+ && Math.abs(changedX - this.swipeStart.x) > 26
1310
+ ) {
1311
+ event.stopPropagation()
1312
+ event.preventDefault()
1313
+ }
1314
+ }
1315
+ }
1316
+
1317
+ handleTouchEnd (choiceKey: TChoiceKey, event: TouchEvent) {
1318
+ const targetEl = event.target as Ref
1319
+ const swipeEnd = {
1320
+ x: event?.changedTouches[0]?.clientX || null,
1321
+ y: event?.changedTouches[0]?.clientY || null,
1322
+ }
1323
+ if (
1324
+ targetEl instanceof HTMLElement
1325
+ && swipeEnd.x !== null
1326
+ && swipeEnd.y !== null
1327
+ && this.swipeStart.x !== null
1328
+ && Math.abs(swipeEnd.x - this.swipeStart.x) > 80
1329
+ ) {
1330
+ const choiceEls = this.$refs.choices as HTMLElement[]
1331
+ const parent = choiceEls.find(choiceEl => choiceEl.contains(targetEl))
1332
+ const finalElement = document.elementFromPoint(swipeEnd.x, swipeEnd.y)
1333
+ if (parent?.contains(finalElement)) {
1334
+ this.clickChoiceStrike(choiceKey)
1335
+ }
1336
+ } else if (!this.showAnswers) {
1337
+ if (event.cancelable) {
1338
+ event.preventDefault()
1339
+ }
1340
+ if (
1341
+ swipeEnd.y !== null
1342
+ && this.swipeStart.y !== null
1343
+ && Math.abs(swipeEnd.y - this.swipeStart.y) < 20
1344
+ ) {
1345
+ this.selectChoice(choiceKey)
1346
+ }
1347
+ }
1348
+
1349
+ this.swipeStart = { x: null, y: null }
1350
+ }
1351
+
1352
+ clickChoiceStrike (choiceKey: TChoiceKey) {
1353
+ if (this.showAnswers) {
1354
+ return
1355
+ }
1356
+
1357
+ const choiceStrikes = this.choiceStrikes
1358
+ const indexOfChoiceStrike = choiceStrikes.indexOf(choiceKey)
1359
+ if (indexOfChoiceStrike !== -1) {
1360
+ choiceStrikes.splice(indexOfChoiceStrike, 1)
1361
+ } else {
1362
+ choiceStrikes.push(choiceKey)
1363
+ // If striking a selected choice, unselect it
1364
+ const selectedChoices = this.selectedChoices
1365
+ const indexOfSelectedChoice = selectedChoices.indexOf(choiceKey)
1366
+ if (indexOfSelectedChoice !== -1) {
1367
+ selectedChoices.splice(indexOfSelectedChoice, 1)
1368
+ }
1369
+ }
1370
+ }
1371
+
1372
+ selectChoice (choiceKey: TChoiceKey, focusChoice?: boolean) {
1373
+ if (this.showAnswers) {
1374
+ return
1375
+ }
1376
+
1377
+ const selectedChoices = this.selectedChoices
1378
+ const indexOfSelectedChoice = selectedChoices.indexOf(choiceKey)
1379
+ if (indexOfSelectedChoice !== -1) {
1380
+ selectedChoices.splice(indexOfSelectedChoice, 1)
1381
+ } else {
1382
+ if (this.isMCR) {
1383
+ selectedChoices.push(choiceKey)
1384
+ } else {
1385
+ this.hoverChoiceKey = null
1386
+ this.selectedChoices = [ choiceKey ]
1387
+ if (!this.showCheckAnswer) {
1388
+ this.clickCheckAnswer()
1389
+ }
1390
+ }
1391
+ // If selecting a striked choice, unstrike it
1392
+ const choiceStrikes = this.choiceStrikes
1393
+ const indexOfChoiceStrike = this.choiceStrikes.indexOf(choiceKey)
1394
+ if (indexOfChoiceStrike !== -1) {
1395
+ choiceStrikes.splice(indexOfChoiceStrike, 1)
1396
+ }
1397
+ }
1398
+
1399
+ if (focusChoice) {
1400
+ const choiceEl = this.$refs[`choice-${choiceKey}`] as HTMLElement | HTMLElement[];
1401
+ ('length' in choiceEl)
1402
+ ? choiceEl[0]?.focus()
1403
+ : choiceEl.focus()
1404
+ }
1405
+ }
1406
+
1407
+ togglePassageImageLongAlt () {
1408
+ this.showPassageImageLongAlt = !this.showPassageImageLongAlt
1409
+
1410
+ if (this.showPassageImageLongAlt) {
1411
+ setTimeout(() => {
1412
+ const mobileLongAlt = this.$refs['uikit-question__img-dropdown-img-description'] as Ref
1413
+ const longAlt = this.$refs['uikit-question__passage-image-description'] as Ref
1414
+
1415
+ // Checking offsetParent tells us which element is visible
1416
+ if (mobileLongAlt?.offsetParent) {
1417
+ mobileLongAlt.focus()
1418
+ } else if (longAlt?.offsetParent) {
1419
+ longAlt.focus()
1420
+ }
1421
+ }, 0)
1422
+ }
1423
+ }
1424
+
1425
+ toggleExplanationImageLongAlt () {
1426
+ this.showExplanationImageLongAlt = !this.showExplanationImageLongAlt
1427
+
1428
+ if (this.showExplanationImageLongAlt) {
1429
+ setTimeout(() => {
1430
+ const mcrLongAlt = this.$refs['uikit-question__summary-dropdown-explanation-img-description'] as Ref
1431
+ const mobileLongAlt = this.$refs['uikit-question__dropdown-explanation-img-description'] as Ref[]
1432
+ const longAlt = this.$refs['uikit-question__explanation-img-description'] as Ref
1433
+
1434
+ // Checking offsetParent tells us which element is visible
1435
+ if (mcrLongAlt?.offsetParent) {
1436
+ mcrLongAlt.focus()
1437
+ } else if (mobileLongAlt?.[0]?.offsetParent) {
1438
+ mobileLongAlt[0].focus()
1439
+ } else if (longAlt?.offsetParent) {
1440
+ longAlt.focus()
1441
+ }
1442
+ }, 0)
1443
+ }
1444
+ }
1445
+
1446
+ toggleExplanation () {
1447
+ this.showExplanation = !this.showExplanation
1448
+ if (!this.showExplanation) {
1449
+ setTimeout(() => {
1450
+ const showExplanationRef = (
1451
+ this.$refs['uikit-question__toggle-explanation-text']
1452
+ || this.$refs['uikit-question__summary-toggle-explanation-text']
1453
+ ) as Element[] | Element | undefined
1454
+ const showExplanationEl = (
1455
+ showExplanationRef instanceof Array
1456
+ ? showExplanationRef[0]
1457
+ : showExplanationRef
1458
+ ) as HTMLElement | undefined
1459
+ showExplanationEl?.focus()
1460
+ }, 0)
1461
+ } else {
1462
+ setTimeout(() => {
1463
+ const explanationTitle = this.$refs['explanation'] as HTMLElement | undefined
1464
+ explanationTitle?.focus()
1465
+ }, 0)
1466
+ }
1467
+ }
1468
+
1469
+ clickCheckAnswer () {
1470
+ if (!this.hideAnswer) {
1471
+ this.showAnswers = true
1472
+ this.emitCheckAnswer({
1473
+ isCorrect: this.isCorrect,
1474
+ selectedChoices: this.selectedChoices,
1475
+ questionSerial: this.question.serial,
1476
+ })
1477
+ setTimeout(() => {
1478
+ const showExplanationRef = (
1479
+ this.$refs['uikit-question__toggle-explanation-text']
1480
+ || this.$refs['uikit-question__summary-toggle-explanation-text']
1481
+ ) as Element[] | Element | undefined
1482
+ const showExplanationEl = (
1483
+ showExplanationRef instanceof Array
1484
+ ? showExplanationRef[0]
1485
+ : showExplanationRef
1486
+ ) as HTMLElement | undefined
1487
+ showExplanationEl?.focus()
1488
+ }, 500)
1489
+ }
1490
+ }
1491
+
1492
+ @Emit('update:selectedChoices')
1493
+ emitSelectedChoices (selectedChoices: Study.Cloud.IQuizAnswer) {
1494
+ return selectedChoices
1495
+ }
1496
+
1497
+ @Watch('reviewMode')
1498
+ reviewModeChanged (reviewMode: boolean) {
1499
+ if (reviewMode) {
1500
+ this.startReviewMode()
1501
+ } else {
1502
+ this.stopReviewMode()
1503
+ }
1504
+ }
1505
+
1506
+ @Watch('previousChoices')
1507
+ previousChoicesChanged (choices: TChoiceKey[]) {
1508
+ this.updateSelectedChoices(choices)
1509
+ }
1510
+
1511
+ @Watch('selectedChoices')
1512
+ selectedChoicesChanged () {
1513
+ this.emitSelectedChoices({
1514
+ isCorrect: this.selectedChoices.length === this.answerKeys.length
1515
+ && !this.selectedChoices.join(' ').includes('d'),
1516
+ selectedChoices: this.selectedChoices,
1517
+ questionSerial: this.question.serial,
1518
+ } as Study.Cloud.IQuizAnswer)
1519
+ }
1520
+
1521
+ @Emit('close')
1522
+ emitClose () {
1523
+ return true
1524
+ }
1525
+
1526
+ @Emit('upgrade')
1527
+ emitUpgrade () {
1528
+ return true
1529
+ }
1530
+
1531
+ @Emit('submitQuiz')
1532
+ emitSubmitQuiz () {
1533
+ return true
1534
+ }
1535
+
1536
+ @Emit('nextQuestion')
1537
+ emitNextQuestion () {
1538
+ return true
1539
+ }
1540
+
1541
+ @Emit('previousQuestion')
1542
+ emitPreviousQuestion () {
1543
+ return true
1544
+ }
1545
+
1546
+ @Emit('checkAnswer')
1547
+ emitCheckAnswer (answer: Study.Cloud.IQuizAnswer) {
1548
+ return answer
1549
+ }
1550
+ }
1551
+ </script>
1552
+
1553
+ <style lang="scss">
1554
+ @import '../../styles/colors';
1555
+ @import '../../styles/breakpoints';
1556
+
1557
+ .uikit-question {
1558
+ position: relative;
1559
+ display: flex;
1560
+ justify-content: center;
1561
+ width: 100%;
1562
+ box-sizing: border-box;
1563
+
1564
+ &--tablet-landscape {
1565
+ overflow-y: auto;
1566
+ }
1567
+
1568
+ &__close-icon {
1569
+ display: none;
1570
+ position: absolute;
1571
+ top: 14px;
1572
+ left: 14px;
1573
+ width: 34px;
1574
+ height: 34px;
1575
+ color: $brand-blue;
1576
+ cursor: pointer;
1577
+ z-index: 1;
1578
+
1579
+ @media (hover: hover) {
1580
+ &:hover {
1581
+ color: $brand-black;
1582
+ }
1583
+ }
1584
+
1585
+ @include breakpoint(black-bear) {
1586
+ display: block;
1587
+ }
1588
+
1589
+ &--dark {
1590
+ color: $banana-bread;
1591
+
1592
+ @media (hover: hover) {
1593
+ &:hover {
1594
+ color: $butterscotch;
1595
+ }
1596
+ }
1597
+ }
1598
+ }
1599
+
1600
+ &__main {
1601
+ position: relative;
1602
+ display: flex;
1603
+ flex-direction: column;
1604
+ align-items: center;
1605
+ width: 100%;
1606
+ height: 100%;
1607
+ box-sizing: border-box;
1608
+ padding: 0 42px;
1609
+ overflow-y: auto;
1610
+
1611
+ &--show-side:not(&--tablet-portrait) {
1612
+ width: 51%;
1613
+ }
1614
+
1615
+ &--show-side#{&}--tablet-landscape:not(&--tablet-portrait) {
1616
+ width: 50%;
1617
+ padding-right: 36px;
1618
+ }
1619
+
1620
+ &--unanswered#{&}--mobile,
1621
+ &--mcr#{&}--mobile {
1622
+ display: inline-block;
1623
+ max-width: 492px;
1624
+ }
1625
+
1626
+ &--mobile {
1627
+ overflow-y: visible;
1628
+ padding: 0 17px;
1629
+ }
1630
+ }
1631
+
1632
+ &__right-side {
1633
+ width: 49%;
1634
+ box-sizing: border-box;
1635
+ overflow-y: auto;
1636
+
1637
+ &--tablet-landscape {
1638
+ width: 48%;
1639
+ }
1640
+
1641
+ &--tablet-portrait {
1642
+ display: none;
1643
+ }
1644
+
1645
+ &--explanation {
1646
+ padding-top: 58px;
1647
+ padding-right: 11px;
1648
+ font-size: 16.5px;
1649
+ line-height: 26px;
1650
+ }
1651
+
1652
+ &--explanation#{&}--tablet-landscape {
1653
+ padding-top: 22px;
1654
+ font-size: 16px;
1655
+ line-height: 24px;
1656
+ }
1657
+ }
1658
+
1659
+ &__passage-and-image {
1660
+ position: relative;
1661
+ max-width: 566px;
1662
+ padding: 133px 60px 72px 60px;
1663
+ box-sizing: border-box;
1664
+ line-height: 26px;
1665
+ font-size: 16.5px;
1666
+ font-weight: 400;
1667
+ letter-spacing: -0.1px;
1668
+
1669
+ &--tablet-landscape {
1670
+ padding: 115px 41px 42px 30px;
1671
+ font-size: 16.5px;
1672
+ line-height: 26px;
1673
+ }
1674
+ }
1675
+
1676
+ &__passage-and-image-title {
1677
+ color: $ash;
1678
+ margin-bottom: 24px;
1679
+ font-weight: 600;
1680
+ font-size: 17.5px;
1681
+ line-height: 25px;
1682
+ letter-spacing: -0.1px;
1683
+ outline: none;
1684
+
1685
+ &--dark {
1686
+ color: rgba($white, 0.86);
1687
+ }
1688
+ }
1689
+
1690
+ &__passage {
1691
+ line-height: 26px;
1692
+ font-weight: 400;
1693
+ font-size: 16.5px;
1694
+ letter-spacing: -0.1px;
1695
+ margin-bottom: 24px;
1696
+
1697
+ strong,
1698
+ b {
1699
+ font-weight: 600;
1700
+ }
1701
+ }
1702
+
1703
+ &__image {
1704
+ display: block;
1705
+ position: relative;
1706
+ left: 50%;
1707
+ transform: translateX(-50%);
1708
+ width: calc(100% + 24px);
1709
+ border: 1px solid $fog;
1710
+
1711
+ &--dark {
1712
+ border: 1px solid $jet;
1713
+ }
1714
+
1715
+ &--tablet-landscape {
1716
+ width: calc(100% + 16px);
1717
+ }
1718
+ }
1719
+
1720
+ &__toggle-passage-image-description {
1721
+ margin-top: 16px;
1722
+ margin-bottom: 8px;
1723
+
1724
+ &--tablet-landscape {
1725
+ margin-top: 12px;
1726
+ }
1727
+ }
1728
+
1729
+ &__toggle-passage-image-description-text,
1730
+ &__toggle-explanation-img-description-text,
1731
+ &__toggle-img-dropdown-img-description-text,
1732
+ &__toggle-dropdown-explanation-img-description-text,
1733
+ &__toggle-summary-dropdown-explanation-img-description-text {
1734
+ outline: none;
1735
+ }
1736
+
1737
+ &__toggle-passage-image-description-icon,
1738
+ &__toggle-explanation-img-description-icon,
1739
+ &__toggle-img-dropdown-img-description-icon,
1740
+ &__toggle-dropdown-explanation-img-description-icon,
1741
+ &__toggle-summary-dropdown-explanation-img-description-icon {
1742
+ margin-left: 8px;
1743
+
1744
+ &--up {
1745
+ transform: rotate(180deg);
1746
+ }
1747
+ }
1748
+
1749
+ &__passage-image-description {
1750
+ outline: none;
1751
+ color: $ash;
1752
+ font-size: 15px;
1753
+ line-height: 22px;
1754
+ font-weight: 500;
1755
+ letter-spacing: -0.2px;
1756
+
1757
+ &--dark {
1758
+ color: $fog;
1759
+ }
1760
+
1761
+ p {
1762
+ margin: 0;
1763
+ }
1764
+ }
1765
+
1766
+ &__return-to-prompt {
1767
+ position: absolute;
1768
+ left: -10000px;
1769
+
1770
+ &:focus {
1771
+ left: auto;
1772
+ }
1773
+ }
1774
+
1775
+ &__explanation {
1776
+ position: relative;
1777
+ background-color: $white;
1778
+ border: 1px solid rgba($pewter, 0.85);
1779
+ border-bottom: 0;
1780
+ border-radius: 6px 6px 0 0;
1781
+ padding: 42px 60px 72px;
1782
+ box-sizing: border-box;
1783
+ max-width: 565px;
1784
+ min-height: 100%;
1785
+
1786
+ &--tablet-landscape {
1787
+ max-width: 460px;
1788
+ padding: 42px 36px 72px;
1789
+ }
1790
+
1791
+ &--dark {
1792
+ border-color: $slate;
1793
+ background-color: $mariner;
1794
+ }
1795
+ }
1796
+
1797
+ &__explanation-close {
1798
+ position: absolute;
1799
+ width: 30px;
1800
+ height: 30px;
1801
+ top: 12px;
1802
+ right: 12px;
1803
+ color: $brand-blue;
1804
+ cursor: pointer;
1805
+ outline: none;
1806
+
1807
+ &:hover {
1808
+ color: $brand-black;
1809
+ }
1810
+
1811
+ &:focus::before {
1812
+ content: '';
1813
+ left: -1px;
1814
+ top: -1px;
1815
+ width: 100%;
1816
+ height: 100%;
1817
+ position: absolute;
1818
+ border: 1px solid $brand-blue;
1819
+ border-radius: 5px;
1820
+ }
1821
+
1822
+ &--dark {
1823
+ color: $banana-bread;
1824
+
1825
+ &:hover {
1826
+ color: $butterscotch;
1827
+ }
1828
+
1829
+ &:focus::before {
1830
+ border-color: $banana-bread;
1831
+ }
1832
+ }
1833
+
1834
+ svg {
1835
+ width: 100%;
1836
+ height: 100%;
1837
+ }
1838
+ }
1839
+
1840
+ &__explanation-title {
1841
+ font-weight: 600;
1842
+ font-size: 17.5px;
1843
+ letter-spacing: -0.1px;
1844
+ line-height: 25px;
1845
+ outline: none;
1846
+
1847
+ &--dark {
1848
+ color: $fog;
1849
+ }
1850
+ }
1851
+
1852
+ &__explanation-text {
1853
+ font-weight: 400;
1854
+ font-size: 16.5px;
1855
+ letter-spacing: -0.1px;
1856
+ line-height: 26px;
1857
+ margin-bottom: 24px;
1858
+ word-break: break-word;
1859
+
1860
+ &--dark {
1861
+ color: $white;
1862
+ }
1863
+
1864
+ &--tablet-landscape {
1865
+ margin-bottom: 24px;
1866
+ font-size: 16px;
1867
+ line-height: 24px;
1868
+ }
1869
+
1870
+ strong,
1871
+ b {
1872
+ font-weight: 600;
1873
+ }
1874
+ }
1875
+
1876
+ &__explanation-image {
1877
+ display: block;
1878
+ position: relative;
1879
+ left: 50%;
1880
+ transform: translateX(-50%);
1881
+ width: calc(100% + 24px);
1882
+ margin-bottom: 24px;
1883
+ border: 1px solid $fog;
1884
+
1885
+ &--long-alt {
1886
+ margin-bottom: 0;
1887
+ }
1888
+
1889
+ &--dark {
1890
+ border: 1px solid $jet;
1891
+ }
1892
+
1893
+ &--tablet-landscape {
1894
+ width: calc(100% + 16px);
1895
+ }
1896
+ }
1897
+
1898
+ &__toggle-explanation-img-description {
1899
+ margin-top: 24px;
1900
+
1901
+ &--open {
1902
+ margin-bottom: 6px;
1903
+ }
1904
+
1905
+ &--tablet-landscape {
1906
+ margin-top: 12px;
1907
+ }
1908
+ }
1909
+
1910
+ &__explanation-img-description {
1911
+ outline: none;
1912
+ color: $ash;
1913
+ font-size: 15px;
1914
+ font-weight: 500;
1915
+ letter-spacing: -0.2px;
1916
+ line-height: 22px;
1917
+ margin-bottom: 24px;
1918
+
1919
+ &--dark {
1920
+ color: $fog;
1921
+ }
1922
+
1923
+ p {
1924
+ margin: 0;
1925
+ }
1926
+ }
1927
+
1928
+ &__reference {
1929
+ padding-top: 24px;
1930
+ border-top: 1px solid $fog;
1931
+ font-size: 15px;
1932
+ letter-spacing: -0.1px;
1933
+ line-height: 22px;
1934
+ font-weight: 600;
1935
+ word-break: break-word;
1936
+
1937
+ &--dark {
1938
+ color: $white;
1939
+ border-top-color: rgba($fog, 0.28);
1940
+ }
1941
+
1942
+ p {
1943
+ margin: 6px 0 8pt 0;
1944
+ font-size: 15px;
1945
+ letter-spacing: -0.1px;
1946
+ font-weight: 400;
1947
+ font-style: italic;
1948
+ }
1949
+ }
1950
+
1951
+ &__reference-label,
1952
+ &__dropdown-reference-label,
1953
+ &__summary-dropdown-reference-label {
1954
+ font-weight: 600;
1955
+ }
1956
+
1957
+ &__context {
1958
+ display: flex;
1959
+ flex-direction: column;
1960
+ align-items: center;
1961
+ flex-shrink: 0;
1962
+ margin-bottom: 28px;
1963
+ padding-top: 60px;
1964
+ outline: none;
1965
+
1966
+ &--tablet-landscape {
1967
+ padding-top: 42px;
1968
+ }
1969
+
1970
+ &--tablet-portrait {
1971
+ padding-top: 52px;
1972
+ }
1973
+
1974
+ &--mobile {
1975
+ padding-top: 22px;
1976
+ }
1977
+ }
1978
+
1979
+ &__context-icon {
1980
+ margin-bottom: 8px;
1981
+ margin-left: 6px;
1982
+ color: $ash;
1983
+
1984
+ &--dark {
1985
+ color: $fog;
1986
+ }
1987
+ }
1988
+
1989
+ &__context-text {
1990
+ display: flex;
1991
+ font-size: 14px;
1992
+ font-weight: 600;
1993
+ letter-spacing: 0.2px;
1994
+ line-height: 17px;
1995
+ color: $ash;
1996
+ margin: 0;
1997
+
1998
+ &--dark {
1999
+ color: $fog;
2000
+ }
2001
+ }
2002
+
2003
+ &__quiz-length {
2004
+ margin-left: 5px;
2005
+ font-weight: 500;
2006
+ }
2007
+
2008
+ &__prompt {
2009
+ outline: none;
2010
+ font-weight: 600;
2011
+ font-size: 17.5px;
2012
+ letter-spacing: -0.1px;
2013
+ line-height: 26px;
2014
+ padding: 0 16px;
2015
+ margin-bottom: 24px;
2016
+ width: 100%;
2017
+ max-width: 492px;
2018
+ box-sizing: border-box;
2019
+
2020
+ &--passage-and-image {
2021
+ &--mobile {
2022
+ margin-bottom: 14px;
2023
+ font-size: 16px;
2024
+ }
2025
+ }
2026
+
2027
+ &--tablet-portrait {
2028
+ padding: 0 15px;
2029
+ box-sizing: border-box;
2030
+ font-weight: 600;
2031
+ font-size: 17px;
2032
+ letter-spacing: -0.1px;
2033
+ line-height: 25px;
2034
+ margin-bottom: 24px;
2035
+ }
2036
+
2037
+ strong,
2038
+ b {
2039
+ font-weight: 700;
2040
+ }
2041
+
2042
+ p {
2043
+ margin: 0 0 12px;
2044
+
2045
+ &:last-child {
2046
+ margin: 0;
2047
+ }
2048
+ }
2049
+
2050
+ table {
2051
+ width: 100%;
2052
+ display: block;
2053
+ height: auto !important;
2054
+ overflow: auto;
2055
+
2056
+ tr td {
2057
+ border: 1px solid $steel;
2058
+ padding: 6px 10px;
2059
+ }
2060
+ }
2061
+ }
2062
+
2063
+ &__skip-to-passage {
2064
+ display: block;
2065
+ position: absolute;
2066
+ left: -10000px;
2067
+
2068
+ &:focus {
2069
+ left: auto;
2070
+ }
2071
+
2072
+ &--tablet-portrait {
2073
+ display: none;
2074
+ }
2075
+ }
2076
+
2077
+ &__passage-and-image-dropdown {
2078
+ display: none;
2079
+ position: relative;
2080
+ width: 100%;
2081
+ max-width: 492px;
2082
+ background-color: $white;
2083
+ border: 1px solid rgba($pewter, 0.85);
2084
+ border-radius: 6px;
2085
+ box-sizing: border-box;
2086
+ margin-bottom: 24px;
2087
+ font-size: 16px;
2088
+ line-height: 24px;
2089
+ font-weight: 400;
2090
+
2091
+ &--dark {
2092
+ background-color: $brand-black;
2093
+ border-color: $slate;
2094
+ }
2095
+
2096
+ &--tablet-portrait,
2097
+ &--review-mode {
2098
+ display: block;
2099
+ }
2100
+ }
2101
+
2102
+ &__passage-and-image-dropdown-btn {
2103
+ position: relative;
2104
+ display: flex;
2105
+ align-items: center;
2106
+ border: 1px solid rgba($pewter, 0.85);
2107
+ border-radius: 5px;
2108
+ box-shadow: 0 1px 4px 0 rgba($ash, 0.3);
2109
+ box-sizing: border-box;
2110
+ height: 50px;
2111
+ padding: 15px 57px 16px 48px;
2112
+ margin: -1px;
2113
+ cursor: pointer;
2114
+ outline: none;
2115
+
2116
+ &:hover {
2117
+ .uikit-question__passage-and-image-dropdown-text {
2118
+ color: mix($brand-blue, black, 90%);
2119
+ }
2120
+
2121
+ .uikit-question__passage-and-image-dropdown-arrow {
2122
+ color: mix($brand-blue, black, 90%);
2123
+ }
2124
+
2125
+ &::before {
2126
+ content: '';
2127
+ left: -2px;
2128
+ top: -2px;
2129
+ width: 100%;
2130
+ height: 100%;
2131
+ border: 2px solid $slate;
2132
+ position: absolute;
2133
+ border-radius: 5px;
2134
+ }
2135
+ }
2136
+
2137
+ &:focus::before {
2138
+ content: '';
2139
+ left: -3px;
2140
+ top: -3px;
2141
+ width: calc(100% + 4px);
2142
+ height: calc(100% + 4px);
2143
+ border: 1px solid $brand-blue;
2144
+ position: absolute;
2145
+ border-radius: 8px;
2146
+ }
2147
+
2148
+ &--dark {
2149
+ box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
2150
+ border-color: $slate;
2151
+
2152
+ &:hover {
2153
+ .uikit-question__passage-and-image-dropdown-text {
2154
+ color: $butterscotch;
2155
+ }
2156
+
2157
+ .uikit-question__passage-and-image-dropdown-arrow {
2158
+ color: $butterscotch;
2159
+ }
2160
+
2161
+ &::before {
2162
+ border-color: rgba($white, 0.6);
2163
+ }
2164
+ }
2165
+
2166
+ &:focus::before {
2167
+ border-color: $banana-bread;
2168
+ }
2169
+ }
2170
+ }
2171
+
2172
+ &__passage-and-image-dropdown-text {
2173
+ font-size: 16px;
2174
+ line-height: 24px;
2175
+ font-weight: 600;
2176
+ color: $brand-blue;
2177
+
2178
+ &--dark {
2179
+ color: $banana-bread;
2180
+ }
2181
+ }
2182
+
2183
+ &__passage-dropdown-icon,
2184
+ &__image-dropdown-icon {
2185
+ position: absolute;
2186
+ left: 17px;
2187
+ width: 19px;
2188
+ }
2189
+
2190
+ &__passage-and-image-dropdown-arrow {
2191
+ position: absolute;
2192
+ right: 20px;
2193
+ color: $brand-blue;
2194
+
2195
+ &--dark {
2196
+ color: $banana-bread;
2197
+ }
2198
+
2199
+ &--up {
2200
+ transform: rotate(180deg);
2201
+ }
2202
+ }
2203
+
2204
+ &__passage-and-image-dropdown-container {
2205
+ padding: 14px 15px 16px 16px;
2206
+
2207
+ &--mobile {
2208
+ padding: 12px 15px 16px 15px;
2209
+ }
2210
+ }
2211
+
2212
+ &__passage-dropdown-passage {
2213
+ box-sizing: border-box;
2214
+ margin: 14px 20px 24px 17px;
2215
+ line-height: 24px;
2216
+ font-size: 16px;
2217
+ font-weight: 400;
2218
+ letter-spacing: -0.1;
2219
+
2220
+ &--mobile {
2221
+ line-height: 24px;
2222
+ font-size: 16px;
2223
+ }
2224
+
2225
+ &--with-image {
2226
+ margin-bottom: 16px;
2227
+ }
2228
+ }
2229
+
2230
+ &__image-dropdown-image {
2231
+ display: block;
2232
+ box-sizing: border-box;
2233
+ width: 100%;
2234
+ border: 1px solid $fog;
2235
+
2236
+ &--with-passage {
2237
+ padding-top: 0;
2238
+ }
2239
+
2240
+ &--dark {
2241
+ border: 1px solid $jet;
2242
+ }
2243
+ }
2244
+
2245
+ &__toggle-img-dropdown-img-description {
2246
+ margin-top: 16px;
2247
+
2248
+ &--open {
2249
+ margin-bottom: 8px;
2250
+ }
2251
+ }
2252
+
2253
+ &__img-dropdown-img-description {
2254
+ outline: none;
2255
+ color: $ash;
2256
+ font-size: 15px;
2257
+ line-height: 22px;
2258
+ font-weight: 500;
2259
+ letter-spacing: -0.2;
2260
+
2261
+ &--dark {
2262
+ color: $fog;
2263
+ }
2264
+
2265
+ &--tablet-landscape {
2266
+ margin-bottom: 4px;
2267
+ }
2268
+
2269
+ &--tablet-portrait {
2270
+ margin-bottom: 0;
2271
+ }
2272
+
2273
+ p {
2274
+ margin: 0;
2275
+ }
2276
+ }
2277
+
2278
+ &__unanswered-teach-review-label {
2279
+ margin-bottom: 12px;
2280
+ display: flex;
2281
+ justify-content: space-between;
2282
+ width: 100%;
2283
+ max-width: 492px;
2284
+ font-size: 16px;
2285
+ letter-spacing: -0.1px;
2286
+ line-height: 22px;
2287
+ color: $brand-black;
2288
+ }
2289
+
2290
+ &__choices {
2291
+ display: flex;
2292
+ flex-direction: column;
2293
+ align-items: center;
2294
+ flex-shrink: 0;
2295
+ width: 100%;
2296
+ max-width: 492px;
2297
+ position: relative;
2298
+ margin: 0;
2299
+ list-style: none;
2300
+ padding: 0;
2301
+
2302
+ &::before {
2303
+ content: '';
2304
+ position: absolute;
2305
+ top: -11px;
2306
+ bottom: -12px;
2307
+ left: -11px;
2308
+ right: -11px;
2309
+ visibility: hidden;
2310
+ box-shadow: 0 1px 4px 0 rgba($brand-black, 0.12);
2311
+ border-radius: 11px;
2312
+ }
2313
+
2314
+ &--correct {
2315
+ &::before {
2316
+ visibility: visible;
2317
+ border: 2px solid $cadaverous;
2318
+ }
2319
+
2320
+ &--dark::before {
2321
+ border-color: $jungle-green;
2322
+ }
2323
+ }
2324
+
2325
+ &--incorrect {
2326
+ &::before {
2327
+ visibility: visible;
2328
+ border: 3px solid $pepper;
2329
+ }
2330
+
2331
+ &--dark::before {
2332
+ border-color: $rosa;
2333
+ }
2334
+ }
2335
+
2336
+ &--no-actions {
2337
+ padding-bottom: 71px;
2338
+ }
2339
+
2340
+ &--incorrect#{&}--unanswered {
2341
+ display: inline-flex;
2342
+ margin-top: 30px;
2343
+ }
2344
+
2345
+ &--incorrect#{&}--unanswered:not(&--show-stats) {
2346
+ margin-bottom: 71px;
2347
+ }
2348
+ }
2349
+
2350
+ &__unanswered-label {
2351
+ position: absolute;
2352
+ top: -38px;
2353
+ display: flex;
2354
+ justify-content: space-between;
2355
+ width: 100%;
2356
+ font-size: 16px;
2357
+ letter-spacing: -0.1px;
2358
+ line-height: 22px;
2359
+ color: $brand-black;
2360
+
2361
+ &--dark {
2362
+ color: $white;
2363
+ }
2364
+ }
2365
+
2366
+ &__unanswered-label-icon {
2367
+ color: $pepper;
2368
+
2369
+ &--dark {
2370
+ color: $rosa;
2371
+ }
2372
+ }
2373
+
2374
+ &__choice-container {
2375
+ position: relative;
2376
+ display: flex;
2377
+ align-items: center;
2378
+ width: 100%;
2379
+ outline: none;
2380
+ transition: 0.1s width ease;
2381
+ border-radius: 6px;
2382
+ cursor: default;
2383
+
2384
+ &:not(:last-child) {
2385
+ margin-bottom: 9px;
2386
+ }
2387
+
2388
+ &::after {
2389
+ content: '';
2390
+ position: absolute;
2391
+ top: -1px;
2392
+ bottom: -1px;
2393
+ left: -1px;
2394
+ right: -1px;
2395
+ border: 1px solid rgba($pewter, 0.85);
2396
+ box-shadow: 0 1px 4px 0 rgba($ash, 0.3);
2397
+ border-radius: 6px;
2398
+ pointer-events: none;
2399
+ }
2400
+
2401
+ &--dark {
2402
+ &::after {
2403
+ border-color: $slate;
2404
+ box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
2405
+ }
2406
+ }
2407
+
2408
+ &--big {
2409
+ width: calc(100% + 10px);
2410
+ }
2411
+
2412
+ &--hover {
2413
+ cursor: pointer;
2414
+
2415
+ &::after {
2416
+ display: block;
2417
+ top: -2px;
2418
+ bottom: -2px;
2419
+ left: -2px;
2420
+ right: -2px;
2421
+ border: 2px solid $slate;
2422
+ border-radius: 7px;
2423
+ }
2424
+
2425
+ &--dark::after {
2426
+ border-color: rgba($white, 0.6);
2427
+ }
2428
+ }
2429
+
2430
+ &--focus {
2431
+ &::after {
2432
+ display: block;
2433
+ border: 1px solid $brand-blue;
2434
+ }
2435
+
2436
+ &--dark::after {
2437
+ border-color: $banana-bread;
2438
+ }
2439
+ }
2440
+
2441
+ &--selected {
2442
+ &::after {
2443
+ display: block;
2444
+ border: 2px solid $brand-blue;
2445
+ }
2446
+
2447
+ &:focus::before {
2448
+ content: '';
2449
+ position: absolute;
2450
+ top: -3px;
2451
+ bottom: -3px;
2452
+ left: -3px;
2453
+ right: -3px;
2454
+ border-radius: 7px;
2455
+ border: 1px solid $brand-blue;
2456
+ pointer-events: none;
2457
+ }
2458
+
2459
+ &--dark::after {
2460
+ border-color: $banana-bread;
2461
+ }
2462
+
2463
+ &--dark:hover::after {
2464
+ border-color: $butterscotch;
2465
+ }
2466
+
2467
+ &--dark:focus::before {
2468
+ border-color: $banana-bread;
2469
+ }
2470
+ }
2471
+
2472
+ &--incorrect {
2473
+ &::after {
2474
+ display: block;
2475
+ border: 1px solid $pepper;
2476
+ }
2477
+
2478
+ &--dark::after {
2479
+ border-color: $rosa;
2480
+ }
2481
+ }
2482
+
2483
+ &--correct {
2484
+ &::after {
2485
+ display: block;
2486
+ border: 2px solid $cadaverous;
2487
+ }
2488
+
2489
+ &--dark::after {
2490
+ border-color: $jungle-green;
2491
+ }
2492
+
2493
+ .uikit-question__choice--big.uikit-question__choice--tablet-portrait {
2494
+ padding: 11px 38px 11px 17px;
2495
+ }
2496
+
2497
+ .uikit-question__choice--big.uikit-question__choice--mobile {
2498
+ padding: 11px 21px 9px;
2499
+ }
2500
+ }
2501
+ }
2502
+
2503
+ &__choice-letter {
2504
+ position: absolute;
2505
+ left: -26px;
2506
+ top: 50%;
2507
+ transform: translateY(calc(-50% + 2px));
2508
+ color: $slate-01;
2509
+ font-size: 14px;
2510
+ line-height: 17px;
2511
+ transition: 0.1s left ease;
2512
+
2513
+ &--dark {
2514
+ color: rgba($white, 0.6);
2515
+ }
2516
+
2517
+ &--selected {
2518
+ color: $brand-blue;
2519
+
2520
+ &--dark {
2521
+ color: $banana-bread;
2522
+ }
2523
+ }
2524
+
2525
+ &--correct {
2526
+ color: $victoria-green;
2527
+
2528
+ &--dark {
2529
+ color: $jungle-green;
2530
+ }
2531
+ }
2532
+
2533
+ &--incorrect {
2534
+ color: $lust;
2535
+
2536
+ &--dark {
2537
+ color: $rosa;
2538
+ }
2539
+ }
2540
+
2541
+ &--big {
2542
+ left: -21px;
2543
+ }
2544
+
2545
+ &--mobile {
2546
+ display: none;
2547
+ }
2548
+ }
2549
+
2550
+ &__choice {
2551
+ width: 100%;
2552
+ background-color: $white;
2553
+ border-radius: 5px;
2554
+ padding: 11px 46px 11px 15px;
2555
+ font-size: 16.5px;
2556
+ font-weight: 500;
2557
+ letter-spacing: -0.1px;
2558
+ line-height: 23px;
2559
+ position: relative;
2560
+ transition: 0.1s padding ease;
2561
+
2562
+ &--tablet-portrait {
2563
+ font-size: 16px;
2564
+ font-weight: 500;
2565
+ letter-spacing: -0.1px;
2566
+ line-height: 23px;
2567
+ }
2568
+
2569
+ &--review-mode#{&}--distractor {
2570
+ color: $slate;
2571
+
2572
+ &--dark {
2573
+ color: $fog;
2574
+ }
2575
+ }
2576
+
2577
+ &--strike {
2578
+ text-decoration: line-through;
2579
+
2580
+ &--dark:not(&--mcr) {
2581
+ color: #c5cbd1 !important;
2582
+ }
2583
+ }
2584
+
2585
+ &--strike:not(&--mcr) {
2586
+ color: $pewter;
2587
+ }
2588
+
2589
+ &--strike#{&}--distractor#{&}--mcr {
2590
+ background-color: rgba($barely-background, 0.5);
2591
+ color: $ash;
2592
+ box-shadow: 0 1px 4px 0 rgba($fog, 0.4);
2593
+
2594
+ &--dark {
2595
+ background-color: rgba($moonlit-ocean, 0.5);
2596
+ box-shadow: 0 1px 4px 0 rgba($charcoal, 0.2);
2597
+ }
2598
+ }
2599
+
2600
+ &--selected {
2601
+ box-shadow: 0 1px 4px 0 rgba($brand-black, 0.12);
2602
+ }
2603
+
2604
+ &--big {
2605
+ padding: 11px 51px 11px 20px;
2606
+ }
2607
+
2608
+ &--mcr {
2609
+ padding: 13px 46px 15px 50px;
2610
+ }
2611
+
2612
+ &--show-stats {
2613
+ padding-bottom: 23px;
2614
+ padding-right: 66px;
2615
+ }
2616
+
2617
+ &--dark {
2618
+ background-color: $brand-black;
2619
+ color: $gray-background;
2620
+ }
2621
+
2622
+ p {
2623
+ margin: 0;
2624
+ }
2625
+ }
2626
+
2627
+ &__mcr-checkbox {
2628
+ display: flex;
2629
+ justify-content: center;
2630
+ align-items: center;
2631
+ position: absolute;
2632
+ top: 15px;
2633
+ left: 15px;
2634
+ width: 21px;
2635
+ height: 21px;
2636
+ border: 1px solid rgba($slate-01, 0.5);
2637
+ border-radius: 2px;
2638
+ box-sizing: border-box;
2639
+
2640
+ &--dark {
2641
+ background: $barely-background;
2642
+ border-color: $barely-background;
2643
+ }
2644
+
2645
+ &--distractor--dark {
2646
+ background: transparent;
2647
+ border: 1px solid $pewter;
2648
+ }
2649
+
2650
+ &--selected {
2651
+ background-color: $brand-black;
2652
+ color: $white;
2653
+
2654
+ &--dark {
2655
+ background: $barely-background;
2656
+ color: $brand-black;
2657
+ }
2658
+ }
2659
+
2660
+ &--selected#{&}--distractor {
2661
+ background-color: rgba($slate-01, 0.5);
2662
+ color: $white;
2663
+ border: none;
2664
+
2665
+ &--dark {
2666
+ background-color: rgba($barely-background, 0.4);
2667
+ color: $brand-black;
2668
+ }
2669
+ }
2670
+
2671
+ &--selected#{&}--answer {
2672
+ background-color: $chromophobia-green;
2673
+ color: $white;
2674
+ border: none;
2675
+
2676
+ &--dark {
2677
+ background: $jungle-green;
2678
+ }
2679
+ }
2680
+
2681
+ &--answer:not(&--selected) {
2682
+ color: $chromophobia-green;
2683
+ }
2684
+
2685
+ &--answer--dark:not(&--selected) {
2686
+ color: $jungle-green;
2687
+ background: transparent;
2688
+ border: 1px solid $pewter;
2689
+ }
2690
+
2691
+ &--strike {
2692
+ border-color: $pewter;
2693
+ }
2694
+ }
2695
+
2696
+ &__mcr-check {
2697
+ width: 13px;
2698
+ height: 11px;
2699
+ }
2700
+
2701
+ &__choice-text {
2702
+ outline: none;
2703
+ }
2704
+
2705
+ &__toggle-explanation {
2706
+ margin-top: 8px;
2707
+ margin-bottom: 8px;
2708
+ padding: 0;
2709
+ z-index: 2;
2710
+
2711
+ &--review-mode {
2712
+ display: none;
2713
+
2714
+ &.uikit-question__toggle-explanation--tablet-portrait,
2715
+ &.uikit-question__toggle-explanation--mobile {
2716
+ display: block;
2717
+ }
2718
+ }
2719
+ }
2720
+
2721
+ &__toggle-explanation-text,
2722
+ &__summary-toggle-explanation-text {
2723
+ outline: none;
2724
+ }
2725
+
2726
+ &__toggle-explanation-icon,
2727
+ &__summary-toggle-explanation-icon {
2728
+ margin-left: 5px;
2729
+ display: none;
2730
+
2731
+ &--tablet-portrait {
2732
+ display: initial;
2733
+ }
2734
+
2735
+ &--up {
2736
+ transform: rotate(180deg);
2737
+ }
2738
+ }
2739
+
2740
+ &__dropdown-explanation,
2741
+ &__summary-dropdown-explanation {
2742
+ display: none;
2743
+
2744
+ &--tablet-portrait {
2745
+ display: block;
2746
+ }
2747
+ }
2748
+
2749
+ &__dropdown-explanation-text,
2750
+ &__summary-dropdown-explanation-text {
2751
+ font-size: 16px;
2752
+ letter-spacing: -0.1px;
2753
+ line-height: 24px;
2754
+ font-weight: 400;
2755
+ padding-bottom: 6px;
2756
+
2757
+ p {
2758
+ margin: 10px 0;
2759
+
2760
+ &:first-child {
2761
+ margin: 0;
2762
+ }
2763
+ }
2764
+ }
2765
+
2766
+ &__dropdown-explanation-image,
2767
+ &__summary-dropdown-explanation-image {
2768
+ display: block;
2769
+ box-sizing: border-box;
2770
+ width: 100%;
2771
+ border: 1px solid $fog;
2772
+
2773
+ &--dark {
2774
+ border: 1px solid $jet;
2775
+ }
2776
+ }
2777
+
2778
+ &__toggle-dropdown-explanation-img-description,
2779
+ &__toggle-summary-dropdown-explanation-img-description {
2780
+ margin-top: 12px;
2781
+ margin-bottom: 20px;
2782
+
2783
+ &--open {
2784
+ margin-bottom: 6px;
2785
+ }
2786
+
2787
+ &--tablet-portrait {
2788
+ &.uikit-question__toggle-dropdown-explanation-img-description--no-reference,
2789
+ &.uikit-question__toggle-summary-dropdown-explanation-img-description--no-reference {
2790
+ margin-bottom: 4px;
2791
+ }
2792
+
2793
+ &.uikit-question__toggle-dropdown-explanation-img-description--open,
2794
+ &.uikit-question__toggle-summary-dropdown-explanation-img-description--open {
2795
+ margin-bottom: 6px;
2796
+ }
2797
+ }
2798
+
2799
+ &--mobile {
2800
+ margin-top: 16px;
2801
+ margin-bottom: 16px;
2802
+
2803
+ &.uikit-question__toggle-dropdown-explanation-img-description--no-reference,
2804
+ &.uikit-question__toggle-summary-dropdown-explanation-img-description--no-reference {
2805
+ margin-bottom: 7px;
2806
+ }
2807
+
2808
+ &.uikit-question__toggle-dropdown-explanation-img-description--open,
2809
+ &.uikit-question__toggle-summary-dropdown-explanation-img-description--open {
2810
+ margin-bottom: 4px;
2811
+ }
2812
+ }
2813
+ }
2814
+
2815
+ &__dropdown-explanation-img-description,
2816
+ &__summary-dropdown-explanation-img-description {
2817
+ outline: none;
2818
+ color: $ash;
2819
+ font-size: 15px;
2820
+ line-height: 22px;
2821
+ margin-bottom: 20px;
2822
+
2823
+ &--dark {
2824
+ color: $fog;
2825
+ }
2826
+
2827
+ &--mobile {
2828
+ margin-bottom: 16px;
2829
+ }
2830
+
2831
+ p {
2832
+ margin: 0;
2833
+ }
2834
+ }
2835
+
2836
+ &__dropdown-reference,
2837
+ &__summary-dropdown-reference {
2838
+ padding-top: 24px;
2839
+ border-top: 1px solid $fog;
2840
+ font-size: 15px;
2841
+ letter-spacing: -0.1px;
2842
+ line-height: 22px;
2843
+ font-weight: 400;
2844
+ word-break: break-word;
2845
+ margin-bottom: -7px;
2846
+
2847
+ &--dark {
2848
+ color: $white;
2849
+ border-top-color: rgba($fog, 0.28);
2850
+ }
2851
+
2852
+ p {
2853
+ margin: 6px 0 8pt 0;
2854
+ }
2855
+ }
2856
+
2857
+ &__strikethrough {
2858
+ display: flex;
2859
+ align-items: center;
2860
+ justify-content: center;
2861
+ position: absolute;
2862
+ width: 20px;
2863
+ height: 22px;
2864
+ right: 12px;
2865
+ background-color: $gray-background;
2866
+ border-radius: 2px;
2867
+ z-index: 2;
2868
+ outline: none;
2869
+ opacity: 0;
2870
+
2871
+ &--visible {
2872
+ opacity: 1;
2873
+ }
2874
+
2875
+ &:hover:not(&--active) {
2876
+ background-color: rgba($sky-blue, 0.674);
2877
+ color: $brand-blue;
2878
+ }
2879
+
2880
+ &:focus:not(&--active) {
2881
+ background-color: $gray-background;
2882
+ color: $brand-blue;
2883
+
2884
+ &::after {
2885
+ content: '';
2886
+ position: absolute;
2887
+ top: 0;
2888
+ bottom: 0;
2889
+ left: 0;
2890
+ right: 0;
2891
+ border: 1px solid $brand-blue;
2892
+ border-radius: 2px;
2893
+ }
2894
+ }
2895
+
2896
+ &--dark {
2897
+ background-color: $ash;
2898
+ color: $white;
2899
+
2900
+ &:hover:not(&--active) {
2901
+ background-color: rgba($banana-bread, 0.15);
2902
+ color: $banana-bread;
2903
+ }
2904
+
2905
+ &:focus:not(&--active) {
2906
+ background-color: rgba($white, 0.15);
2907
+ color: $banana-bread;
2908
+
2909
+ &::after {
2910
+ border-color: $banana-bread;
2911
+ }
2912
+ }
2913
+ }
2914
+
2915
+ &--active {
2916
+ background-color: $brand-blue;
2917
+ color: $white;
2918
+
2919
+ &:hover {
2920
+ background-color: mix($brand-blue, black, 90%);
2921
+ }
2922
+
2923
+ &:focus {
2924
+ &::before {
2925
+ content: '';
2926
+ position: absolute;
2927
+ top: -2px;
2928
+ bottom: -2px;
2929
+ left: -2px;
2930
+ right: -2px;
2931
+ border: 1px solid $brand-blue;
2932
+ border-radius: 2px;
2933
+ }
2934
+ }
2935
+
2936
+ &--dark {
2937
+ background-color: $banana-bread;
2938
+ color: $brand-black;
2939
+
2940
+ &:hover {
2941
+ background-color: $banana-bread;
2942
+ color: $brand-black;
2943
+ }
2944
+
2945
+ &:focus {
2946
+ background-color: $banana-bread !important;
2947
+ color: $brand-black !important;
2948
+
2949
+ &::before {
2950
+ border-color: $banana-bread;
2951
+ }
2952
+ }
2953
+ }
2954
+ }
2955
+
2956
+ &--tablet-landscape {
2957
+ display: none;
2958
+ }
2959
+ }
2960
+
2961
+ &__correct-icon {
2962
+ position: absolute;
2963
+ top: 12px;
2964
+ right: 15px;
2965
+ width: 22px;
2966
+ height: 22px;
2967
+ color: $cadaverous;
2968
+
2969
+ &--dark {
2970
+ color: $jungle-green;
2971
+ }
2972
+
2973
+ &--review-mode {
2974
+ top: 11px;
2975
+ }
2976
+ }
2977
+
2978
+ &__incorrect-icon {
2979
+ position: absolute;
2980
+ top: 12px;
2981
+ right: 10px;
2982
+ width: 22px;
2983
+ height: 22px;
2984
+ color: $pepper;
2985
+
2986
+ &--mcr {
2987
+ top: 11px;
2988
+ }
2989
+
2990
+ &--dark {
2991
+ color: $rosa;
2992
+ }
2993
+ }
2994
+
2995
+ &__choice-stats-pct {
2996
+ position: absolute;
2997
+ top: 50%;
2998
+ right: 10px;
2999
+ transform: translateY(-50%);
3000
+ color: $ash;
3001
+ font-size: 15.5px;
3002
+ letter-spacing: -0.2px;
3003
+ line-height: 19px;
3004
+ font-weight: 600;
3005
+ transition: 0.1s right ease;
3006
+
3007
+ &--dark {
3008
+ color: $fog;
3009
+ }
3010
+
3011
+ &--big {
3012
+ right: 15px;
3013
+ }
3014
+ }
3015
+
3016
+ &__choice-stats-bar {
3017
+ position: absolute;
3018
+ bottom: 0;
3019
+ width: 100%;
3020
+ height: 12px;
3021
+ box-sizing: border-box;
3022
+ background-color: $fog;
3023
+ border-radius: 0 0 5px 5px;
3024
+ overflow: hidden;
3025
+
3026
+ &--dark {
3027
+ background-color: $ash;
3028
+ }
3029
+ }
3030
+
3031
+ &__choice-stats-bar-fill {
3032
+ background-color: $slate-01;
3033
+ height: 100%;
3034
+
3035
+ &--dark {
3036
+ background-color: $pewter;
3037
+ }
3038
+
3039
+ &--correct {
3040
+ background-color: $green;
3041
+ }
3042
+
3043
+ &--incorrect {
3044
+ background-color: $brand-red;
3045
+
3046
+ &--dark {
3047
+ background-color: $rosa;
3048
+ }
3049
+ }
3050
+ }
3051
+
3052
+ &__summary {
3053
+ position: relative;
3054
+ background-color: $white;
3055
+ width: 100%;
3056
+ max-width: 492px;
3057
+ margin-top: 24px;
3058
+ padding: 11px 46px 11px 15px;
3059
+ box-sizing: border-box;
3060
+ border-radius: 5px;
3061
+ box-shadow: 0 1px 6px 0 rgba($fog, 0.6);
3062
+
3063
+ &--dark {
3064
+ background: $brand-black;
3065
+ border: 1px solid $slate;
3066
+ box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
3067
+ }
3068
+
3069
+ &--tablet-portrait {
3070
+ display: inline-block;
3071
+ }
3072
+ }
3073
+
3074
+ &__summary-title {
3075
+ font-weight: 600;
3076
+ font-size: 15.5px;
3077
+ line-height: 22px;
3078
+ }
3079
+
3080
+ &__summary-toggle-explanation {
3081
+ margin-top: 8px;
3082
+ margin-bottom: 8px;
3083
+ padding: 0;
3084
+
3085
+ &--review-mode {
3086
+ display: none;
3087
+
3088
+ &.uikit-question__summary-toggle-explanation--tablet-portrait {
3089
+ display: block;
3090
+ }
3091
+ }
3092
+ }
3093
+
3094
+ &__summary-correct-icon {
3095
+ position: absolute;
3096
+ top: 12px;
3097
+ right: 10px;
3098
+ width: 22px;
3099
+ height: 22px;
3100
+ color: $cadaverous;
3101
+
3102
+ &--dark {
3103
+ color: $jungle-green;
3104
+ }
3105
+ }
3106
+
3107
+ &__summary-incorrect-icon {
3108
+ position: absolute;
3109
+ top: 12px;
3110
+ right: 10px;
3111
+ width: 22px;
3112
+ height: 22px;
3113
+ color: $pepper;
3114
+
3115
+ &--dark {
3116
+ color: $rosa;
3117
+ }
3118
+ }
3119
+
3120
+ &__stats-summary {
3121
+ margin-top: 24px;
3122
+ display: flex;
3123
+ width: 100%;
3124
+ max-width: 492px;
3125
+ padding-bottom: 50px;
3126
+ }
3127
+
3128
+ &__stats-summary-total {
3129
+ display: flex;
3130
+ flex-direction: column;
3131
+ align-items: center;
3132
+ flex: 1;
3133
+ margin-right: 16px;
3134
+ background-color: rgba($sky-blue, 0.8);
3135
+ padding: 9px 0;
3136
+ border-radius: 6px;
3137
+
3138
+ &--dark {
3139
+ background-color: $brand-black;
3140
+ }
3141
+ }
3142
+
3143
+ &__stats-summary-correct {
3144
+ display: flex;
3145
+ flex-direction: column;
3146
+ align-items: center;
3147
+ flex: 1;
3148
+ background-color: rgba($green, 0.13);
3149
+ padding: 9px 0;
3150
+ border-radius: 6px;
3151
+
3152
+ &--dark {
3153
+ background-color: $brand-black;
3154
+ }
3155
+ }
3156
+
3157
+ &__stats-summary-value {
3158
+ font-weight: 600;
3159
+ font-size: 26px;
3160
+ letter-spacing: 0.26px;
3161
+ line-height: 31px;
3162
+ }
3163
+
3164
+ &__stats-summary-label {
3165
+ color: $ash;
3166
+ font-size: 13px;
3167
+ line-height: 16px;
3168
+
3169
+ &--dark {
3170
+ color: $white;
3171
+ }
3172
+ }
3173
+
3174
+ &__action-container {
3175
+ display: flex;
3176
+ justify-content: center;
3177
+ flex-shrink: 0;
3178
+ width: 100%;
3179
+ margin-top: 24px;
3180
+ padding-bottom: 71px;
3181
+
3182
+ &--tablet-landscape {
3183
+ margin-top: 24px;
3184
+ }
3185
+
3186
+ &--mcr-summary {
3187
+ margin-top: 24px;
3188
+ }
3189
+ }
3190
+
3191
+ &__paywall-container {
3192
+ width: 100%;
3193
+ display: flex;
3194
+ justify-content: center;
3195
+ }
3196
+
3197
+ &__paywall {
3198
+ width: 100%;
3199
+ max-width: 500px;
3200
+ background: $white;
3201
+ border-radius: 8px;
3202
+ border: 1px solid $steel;
3203
+ display: flex;
3204
+ flex-direction: column;
3205
+ align-items: center;
3206
+ justify-content: center;
3207
+
3208
+ &--dark {
3209
+ background: $brand-black;
3210
+ }
3211
+
3212
+ &--tablet-portrait {
3213
+ max-width: 430px;
3214
+ }
3215
+
3216
+ &--review {
3217
+ margin-bottom: 20px;
3218
+ }
3219
+ }
3220
+
3221
+ &__paywall-image {
3222
+ width: 305px;
3223
+ height: 230px;
3224
+ margin: 25px auto 21px;
3225
+
3226
+ &--mobile {
3227
+ width: 262px;
3228
+ height: 199px;
3229
+ margin: 14px auto 18px;
3230
+ }
3231
+ }
3232
+
3233
+ &__paywall-text {
3234
+ font-size: 18px;
3235
+ line-height: 22px;
3236
+ color: $brand-black;
3237
+ margin-bottom: 24px;
3238
+ font-weight: 600;
3239
+ text-align: center;
3240
+ max-width: 372px;
3241
+
3242
+ &--dark {
3243
+ color: $white;
3244
+ }
3245
+
3246
+ &--tablet-portrait {
3247
+ max-width: 302px;
3248
+ }
3249
+
3250
+ &--mobile {
3251
+ max-width: 293px;
3252
+ margin-bottom: 22px;
3253
+ font-size: 16px;
3254
+ line-height: 19px;
3255
+ }
3256
+ }
3257
+
3258
+ &__paywall-button {
3259
+ margin-bottom: 36px;
3260
+ }
3261
+ }
3262
+ </style>