@pocketprep/ui-kit 3.8.4 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/@pocketprep/ui-kit.css +1 -1
  2. package/dist/@pocketprep/ui-kit.js +14469 -17731
  3. package/dist/@pocketprep/ui-kit.js.map +1 -1
  4. package/dist/@pocketprep/ui-kit.umd.cjs +19 -29
  5. package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
  6. package/eslint.config.ts +38 -11
  7. package/lib/SVGDefinitions.vue +32 -35
  8. package/lib/components/Banners/Banner.vue +10 -14
  9. package/lib/components/Blobs/Blob.vue +6 -14
  10. package/lib/components/Blobs/BlobEmptyState.vue +9 -8
  11. package/lib/components/Blobs/blob.d.ts +1 -1
  12. package/lib/components/BundleIcons/BundleIcon.vue +36 -63
  13. package/lib/components/BundleIcons/bundleIcon.d.ts +1 -1
  14. package/lib/components/Bundles/BundleList.vue +71 -59
  15. package/lib/components/Bundles/BundleSearch.vue +93 -117
  16. package/lib/components/Bundles/PremiumPill.vue +6 -12
  17. package/lib/components/Buttons/Button.vue +32 -35
  18. package/lib/components/Buttons/Link.vue +32 -31
  19. package/lib/components/Buttons/Tab.vue +14 -17
  20. package/lib/components/Calendar/Calendar.vue +87 -85
  21. package/lib/components/Charts/Bar.vue +192 -263
  22. package/lib/components/Charts/Pie.vue +55 -61
  23. package/lib/components/Charts/highcharts-wrap.ts +81 -0
  24. package/lib/components/Controls/SegmentControl.vue +26 -24
  25. package/lib/components/Controls/Slider.vue +51 -47
  26. package/lib/components/Controls/ToggleSwitch.vue +33 -31
  27. package/lib/components/EmptyStates/EmptyState.vue +69 -73
  28. package/lib/components/Exams/ExamCard.vue +59 -47
  29. package/lib/components/Exams/ExamMenuCard.vue +30 -28
  30. package/lib/components/Filters/FilterDropdown.vue +83 -86
  31. package/lib/components/Filters/FilterOptions.vue +83 -88
  32. package/lib/components/Forms/Checkbox.vue +27 -27
  33. package/lib/components/Forms/CheckboxOption.vue +30 -30
  34. package/lib/components/Forms/Errors.vue +21 -24
  35. package/lib/components/Forms/Input.vue +71 -59
  36. package/lib/components/Forms/Radio.vue +2 -2
  37. package/lib/components/Forms/RadioButton.vue +8 -8
  38. package/lib/components/Forms/Select.vue +265 -257
  39. package/lib/components/Forms/Textarea.vue +49 -35
  40. package/lib/components/Icons/IconAccordionArrow.vue +7 -9
  41. package/lib/components/Icons/IconActivity.vue +7 -9
  42. package/lib/components/Icons/IconAdd.vue +7 -11
  43. package/lib/components/Icons/IconAddCircle.vue +7 -9
  44. package/lib/components/Icons/IconArrow.vue +7 -9
  45. package/lib/components/Icons/IconBarChart.vue +7 -9
  46. package/lib/components/Icons/IconCalendar.vue +7 -9
  47. package/lib/components/Icons/IconCalendarPicker.vue +7 -9
  48. package/lib/components/Icons/IconChat.vue +7 -9
  49. package/lib/components/Icons/IconCheck.vue +7 -9
  50. package/lib/components/Icons/IconClose.vue +7 -9
  51. package/lib/components/Icons/IconConcept.vue +1 -1
  52. package/lib/components/Icons/IconCorrect.vue +7 -9
  53. package/lib/components/Icons/IconEdit.vue +7 -11
  54. package/lib/components/Icons/IconExam.vue +7 -9
  55. package/lib/components/Icons/IconExternalLink.vue +7 -9
  56. package/lib/components/Icons/IconEyeHide.vue +7 -9
  57. package/lib/components/Icons/IconEyeShow.vue +7 -9
  58. package/lib/components/Icons/IconFilter.vue +7 -9
  59. package/lib/components/Icons/IconFilterActive.vue +7 -9
  60. package/lib/components/Icons/IconFlag.vue +7 -9
  61. package/lib/components/Icons/IconFlagContent.vue +8 -9
  62. package/lib/components/Icons/IconFlagFeedback.vue +8 -10
  63. package/lib/components/Icons/IconFlagFilled.vue +7 -9
  64. package/lib/components/Icons/IconFullView.vue +7 -9
  65. package/lib/components/Icons/IconFullViewActive.vue +7 -9
  66. package/lib/components/Icons/IconGridDrag.vue +2 -2
  67. package/lib/components/Icons/IconHandle.vue +7 -9
  68. package/lib/components/Icons/IconHeart.vue +7 -9
  69. package/lib/components/Icons/IconHelp.vue +7 -9
  70. package/lib/components/Icons/IconHighlight.vue +2 -2
  71. package/lib/components/Icons/IconHourglass.vue +7 -9
  72. package/lib/components/Icons/IconImage.vue +7 -9
  73. package/lib/components/Icons/IconIncorrect.vue +7 -9
  74. package/lib/components/Icons/IconInfo.vue +7 -9
  75. package/lib/components/Icons/IconKeyboard.vue +7 -9
  76. package/lib/components/Icons/IconLaunch.vue +7 -9
  77. package/lib/components/Icons/IconLevelUp.vue +7 -9
  78. package/lib/components/Icons/IconLightbulb.vue +7 -9
  79. package/lib/components/Icons/IconLightning.vue +7 -9
  80. package/lib/components/Icons/IconLink.vue +7 -9
  81. package/lib/components/Icons/IconList.vue +7 -9
  82. package/lib/components/Icons/IconLoading.vue +7 -9
  83. package/lib/components/Icons/IconLoading2.vue +11 -11
  84. package/lib/components/Icons/IconLock.vue +7 -9
  85. package/lib/components/Icons/IconMissedQuestions.vue +7 -9
  86. package/lib/components/Icons/IconMoon.vue +7 -9
  87. package/lib/components/Icons/IconPaginationArrow.vue +7 -9
  88. package/lib/components/Icons/IconPaginationArrowDouble.vue +7 -9
  89. package/lib/components/Icons/IconPassage.vue +7 -9
  90. package/lib/components/Icons/IconPencil.vue +7 -9
  91. package/lib/components/Icons/IconPeople.vue +7 -9
  92. package/lib/components/Icons/IconPercent.vue +7 -9
  93. package/lib/components/Icons/IconPerson.vue +8 -9
  94. package/lib/components/Icons/IconPresent.vue +7 -9
  95. package/lib/components/Icons/IconPreview.vue +7 -9
  96. package/lib/components/Icons/IconQuestions.vue +7 -9
  97. package/lib/components/Icons/IconQuick10.vue +7 -9
  98. package/lib/components/Icons/IconQuickActions.vue +2 -2
  99. package/lib/components/Icons/IconRecommendedFilter.vue +1 -1
  100. package/lib/components/Icons/IconRemoveCircle.vue +7 -9
  101. package/lib/components/Icons/IconReviewFlag.vue +7 -9
  102. package/lib/components/Icons/IconSearch.vue +7 -9
  103. package/lib/components/Icons/IconShare.vue +7 -9
  104. package/lib/components/Icons/IconSideBar.vue +7 -9
  105. package/lib/components/Icons/IconSideBarActive.vue +7 -9
  106. package/lib/components/Icons/IconStar.vue +1 -1
  107. package/lib/components/Icons/IconStopwatch.vue +7 -9
  108. package/lib/components/Icons/IconStrike.vue +7 -9
  109. package/lib/components/Icons/IconSubject.vue +7 -9
  110. package/lib/components/Icons/IconText.vue +7 -9
  111. package/lib/components/Icons/IconTimer.vue +8 -9
  112. package/lib/components/Icons/IconWarning.vue +7 -9
  113. package/lib/components/Icons/icon.d.ts +1 -1
  114. package/lib/components/Loaders/SkeletonLoader.vue +1 -5
  115. package/lib/components/Modal/Modal.vue +23 -29
  116. package/lib/components/Modal/ModalContainer.vue +135 -133
  117. package/lib/components/Onboarding/EmailAuth.vue +66 -70
  118. package/lib/components/Onboarding/MagicCodeEntry.vue +88 -83
  119. package/lib/components/Pagination/QuestionReviewPagination.vue +3 -3
  120. package/lib/components/Pagination/TablePagination.vue +47 -44
  121. package/lib/components/PhonePerson/PhonePerson.vue +18 -18
  122. package/lib/components/PhonePerson/phonePerson.d.ts +1 -1
  123. package/lib/components/Quiz/FlagToggle.vue +45 -44
  124. package/lib/components/Quiz/GlobalMetricsToggle.vue +29 -28
  125. package/lib/components/Quiz/KeyboardShortcutsButton.vue +16 -23
  126. package/lib/components/Quiz/KeyboardShortcutsModal.vue +36 -37
  127. package/lib/components/Quiz/Question/BuildListChoicesContainer.vue +65 -65
  128. package/lib/components/Quiz/Question/ChoicesContainer.vue +5 -5
  129. package/lib/components/Quiz/Question/DropdownExplanation.vue +5 -5
  130. package/lib/components/Quiz/Question/Explanation.vue +6 -6
  131. package/lib/components/Quiz/Question/MPMCChoicesContainer.vue +17 -17
  132. package/lib/components/Quiz/Question/MPMCRadioGroup.vue +2 -2
  133. package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +39 -39
  134. package/lib/components/Quiz/Question/MatrixRadioGroup.vue +6 -6
  135. package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +27 -28
  136. package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +2 -2
  137. package/lib/components/Quiz/Question/PassageAndImage.vue +3 -3
  138. package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +7 -7
  139. package/lib/components/Quiz/Question/Paywall.vue +2 -2
  140. package/lib/components/Quiz/Question/QuestionContext.vue +1 -1
  141. package/lib/components/Quiz/Question/StatsSummary.vue +2 -2
  142. package/lib/components/Quiz/Question/Summary.vue +11 -11
  143. package/lib/components/Quiz/Question.vue +90 -82
  144. package/lib/components/Quiz/QuizContainer.vue +1 -1
  145. package/lib/components/Quiz/QuizProgressBar.vue +23 -23
  146. package/lib/components/Quiz/question.d.ts +3 -3
  147. package/lib/components/Search/Pill.vue +16 -19
  148. package/lib/components/Search/Search.vue +52 -47
  149. package/lib/components/SidePanels/SidePanel.vue +168 -174
  150. package/lib/components/Tables/Table.vue +135 -122
  151. package/lib/components/Tables/TableActions.vue +81 -76
  152. package/lib/components/Tables/table.d.ts +1 -1
  153. package/lib/components/Tags/Tag.vue +49 -39
  154. package/lib/components/Toasts/Toast.vue +44 -42
  155. package/lib/components/Tooltips/OverflowTooltip.vue +39 -45
  156. package/lib/components/Tooltips/Tooltip.vue +69 -70
  157. package/lib/directives.ts +4 -4
  158. package/lib/utils.ts +13 -12
  159. package/package.json +27 -28
@@ -26,8 +26,8 @@
26
26
  class="uikit-question-passage-and-image-dropdown__image-dropdown-icon"
27
27
  type="image"
28
28
  />
29
- <span
30
- v-dark="isDarkMode"
29
+ <span
30
+ v-dark="isDarkMode"
31
31
  class="uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-text"
32
32
  >
33
33
  {{ showPassageImageDropdown ? 'Hide' : 'Show' }}
@@ -37,7 +37,7 @@
37
37
  v-dark="isDarkMode"
38
38
  class="uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-arrow"
39
39
  :class="{
40
- 'uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-arrow--up':
40
+ 'uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-arrow--up':
41
41
  showPassageImageDropdown,
42
42
  }"
43
43
  type="accordionArrow"
@@ -73,7 +73,7 @@
73
73
  type="tertiary-small"
74
74
  class="uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description"
75
75
  :class="{
76
- 'uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description--open':
76
+ 'uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description--open':
77
77
  showPassageImageLongAlt,
78
78
  }"
79
79
  :is-dark-mode="isDarkMode"
@@ -81,7 +81,7 @@
81
81
  @click="togglePassageImageLongAltDropdown"
82
82
  @mousedown.prevent
83
83
  >
84
- <span
84
+ <span
85
85
  class="uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description-text"
86
86
  >
87
87
  Image Description
@@ -89,7 +89,7 @@
89
89
  <Icon
90
90
  class="uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description-icon"
91
91
  :class="{
92
- 'uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description-icon--up':
92
+ 'uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description-icon--up':
93
93
  showPassageImageLongAlt,
94
94
  }"
95
95
  type="accordionArrow"
@@ -335,4 +335,4 @@ const togglePassageImageLongAltDropdown = () => {
335
335
  }
336
336
  }
337
337
  }
338
- </style>
338
+ </style>
@@ -4,7 +4,7 @@
4
4
  >
5
5
  <div
6
6
  v-dark="isDarkMode"
7
- v-breakpoint="breakpointsWithEl"
7
+ v-breakpoint="breakpointsWithEl"
8
8
  class="uikit-question-paywall__paywall"
9
9
  :class="{ 'uikit-question-paywall__paywall--review': reviewMode }"
10
10
  >
@@ -139,4 +139,4 @@ const emitUpgradeClick = () => {
139
139
  margin-bottom: 36px;
140
140
  }
141
141
  }
142
- </style>
142
+ </style>
@@ -172,4 +172,4 @@ const isCorrectlyAnswered = computed(() => {
172
172
  font-weight: 500;
173
173
  }
174
174
  }
175
- </style>
175
+ </style>
@@ -46,7 +46,7 @@ import { useQuestionContext } from './composables'
46
46
 
47
47
  const {
48
48
  globalMetrics,
49
- choiceScores,
49
+ choiceScores,
50
50
  isDarkMode,
51
51
  isMatrixQuestion,
52
52
  isMPMCQuestion,
@@ -115,4 +115,4 @@ const {
115
115
  }
116
116
  }
117
117
  }
118
- </style>
118
+ </style>
@@ -9,7 +9,7 @@
9
9
  'uikit-question-summary--matrix-question-review-mode': isMatrixQuestion && reviewMode,
10
10
  'uikit-question-summary--mpmc-question': isMPMCQuestion,
11
11
  'uikit-question-summary--mpmc-question-review-mode': isMPMCQuestion && reviewMode,
12
- 'uikit-question-summary--build-list-question-not-review-mode':
12
+ 'uikit-question-summary--build-list-question-not-review-mode':
13
13
  isBuildListQuestion && !reviewMode,
14
14
  }"
15
15
  >
@@ -46,11 +46,11 @@
46
46
  ref="uikit-question-summary__summary-dropdown-explanation"
47
47
  class="uikit-question-summary__summary-dropdown-explanation"
48
48
  :class="{
49
- 'uikit-question-summary__summary-dropdown-explanation--matrix-question-review-mode':
49
+ 'uikit-question-summary__summary-dropdown-explanation--matrix-question-review-mode':
50
50
  isMatrixQuestion && reviewMode,
51
- 'uikit-question-summary__summary-dropdown-explanation--mpmc-question-review-mode':
51
+ 'uikit-question-summary__summary-dropdown-explanation--mpmc-question-review-mode':
52
52
  isMPMCQuestion && reviewMode,
53
- 'uikit-question-summary__summary-dropdown-explanation--build-list-question-review-mode':
53
+ 'uikit-question-summary__summary-dropdown-explanation--build-list-question-review-mode':
54
54
  isBuildListQuestion && reviewMode,
55
55
  }"
56
56
  >
@@ -169,15 +169,15 @@ const {
169
169
  } = useQuestionContext()
170
170
 
171
171
  const isQuestionCorrect = computed(() => {
172
- return ((!isMatrixQuestion.value || !isMPMCQuestion.value || !isBuildListQuestion) && isCorrect.value) ||
173
- (isMatrixQuestion.value && isMatrixQuestionCorrect.value && !isUnanswered.value) ||
174
- (isMPMCQuestion.value && isMPMCQuestionCorrect.value) ||
175
- (isBuildListQuestion.value && isBuildListOrderCorrect.value)
172
+ return ((!isMatrixQuestion.value || !isMPMCQuestion.value || !isBuildListQuestion) && isCorrect.value)
173
+ || (isMatrixQuestion.value && isMatrixQuestionCorrect.value && !isUnanswered.value)
174
+ || (isMPMCQuestion.value && isMPMCQuestionCorrect.value)
175
+ || (isBuildListQuestion.value && isBuildListOrderCorrect.value)
176
176
  })
177
177
 
178
178
  const summary = computed(() => {
179
179
  return highlightKeywordsInText({
180
- text: question.value.explanation || '',
180
+ text: question.value.explanation || '',
181
181
  keywordDefinitions: keywordDefinitions.value,
182
182
  isDarkMode: isDarkMode.value,
183
183
  location: 'explanation',
@@ -371,7 +371,7 @@ const toggleSummaryExplanationImageLongAlt = () => {
371
371
  letter-spacing: -0.1px;
372
372
  line-height: 22px;
373
373
  font-weight: 400;
374
- word-break: break-word;
374
+ overflow-wrap: anywhere;
375
375
  margin-bottom: -7px;
376
376
 
377
377
  &--dark {
@@ -434,4 +434,4 @@ const toggleSummaryExplanationImageLongAlt = () => {
434
434
  }
435
435
  }
436
436
  }
437
- </style>
437
+ </style>
@@ -38,7 +38,7 @@
38
38
  }"
39
39
  >
40
40
  <div v-if="!showPassageAndImage && !showExplanation && !showPaywall">
41
- <slot
41
+ <slot
42
42
  name="keywordDefinitionHint"
43
43
  />
44
44
  </div>
@@ -93,7 +93,7 @@
93
93
  v-if="question.passage || passageImageUrl"
94
94
  ref="uikit-question__passage-and-image-dropdown"
95
95
  class="uikit-question__passage-and-image-dropdown"
96
- :class="{
96
+ :class="{
97
97
  'uikit-question__passage-and-image-dropdown--review-mode': reviewMode,
98
98
  'uikit-question__passage-and-image-dropdown--build-list': isBuildListQuestion,
99
99
 
@@ -120,13 +120,13 @@
120
120
  class="uikit-question__choices"
121
121
  :class="{
122
122
  'uikit-question__choices--correct': showAnswers && isMCR && isCorrect,
123
- 'uikit-question__choices--incorrect':
123
+ 'uikit-question__choices--incorrect':
124
124
  showAnswers && (isMCR || isUnanswered) && !isCorrect && !isTeachReview,
125
125
  'uikit-question__choices--matrix': isMatrixQuestion,
126
126
  'uikit-question__choices--mpmc': isMPMCQuestion,
127
127
  'uikit-question__choices--unanswered': showAnswers && !isMCR && isUnanswered && !isCorrect,
128
128
  'uikit-question__choices--show-stats': globalMetrics,
129
- 'uikit-question__choices--no-actions':
129
+ 'uikit-question__choices--no-actions':
130
130
  !(isMCR || isUnanswered || isMatrixQuestion || isBuildListQuestion || isMPMCQuestion)
131
131
  && !globalMetrics
132
132
  && (
@@ -145,13 +145,13 @@
145
145
  >
146
146
  <div
147
147
  v-if="
148
- showAnswers
149
- && !isMCR
150
- && !isMatrixQuestion
151
- && !isMPMCQuestion
148
+ showAnswers
149
+ && !isMCR
150
+ && !isMatrixQuestion
151
+ && !isMPMCQuestion
152
152
  && !isBuildListQuestion
153
- && isUnanswered
154
- && !isCorrect
153
+ && isUnanswered
154
+ && !isCorrect
155
155
  && !isTeachReview
156
156
  "
157
157
  v-dark="isDarkMode"
@@ -166,7 +166,7 @@
166
166
  </div>
167
167
  <ChoicesContainer
168
168
  v-if="
169
- question.type !== 'Matrix Checkbox'
169
+ question.type !== 'Matrix Checkbox'
170
170
  && question.type !== 'Matrix Radio Button'
171
171
  && question.type !== 'Multi-Part Multiple Choice'
172
172
  && question.type !== 'Build List'"
@@ -193,7 +193,7 @@
193
193
  showAnswers:showAnswersMM,
194
194
  answerKeys:answerKeysMM,
195
195
  }">
196
- <slot
196
+ <slot
197
197
  name="motivationalMoment"
198
198
  :showAnswers="showAnswersMM"
199
199
  :answerKeys="answerKeysMM"
@@ -204,7 +204,7 @@
204
204
  <template #showNamesTable="{
205
205
  choiceKey,
206
206
  }">
207
- <slot
207
+ <slot
208
208
  name="showNamesTable"
209
209
  :choiceKey="choiceKey"
210
210
  />
@@ -219,14 +219,14 @@
219
219
  ref="uikit-question__matrix-choices-container"
220
220
  v-breakpoint="breakpointsWithEl"
221
221
  @emitSelectedMatrixChoice="selectMatrixChoice"
222
- >
222
+ >
223
223
  <template #motivationalMoment="{
224
224
  isCorrect:isCorrectMM,
225
225
  choiceKey,
226
226
  showAnswers:showAnswersMM,
227
227
  answerKeys:answerKeysMM,
228
228
  }">
229
- <slot
229
+ <slot
230
230
  name="motivationalMoment"
231
231
  :showAnswers="showAnswersMM"
232
232
  :answerKeys="answerKeysMM"
@@ -243,7 +243,7 @@
243
243
  class="uikit-question__mobile-matrix-choices-container"
244
244
  v-breakpoint="breakpointsWithEl"
245
245
  @emitSelectedMatrixChoice="selectMatrixChoice"
246
- >
246
+ >
247
247
  <template
248
248
  #motivationalMoment="{
249
249
  isCorrect:isCorrectMM,
@@ -252,7 +252,7 @@
252
252
  answerKeys:answerKeysMM,
253
253
  }"
254
254
  >
255
- <slot
255
+ <slot
256
256
  name="motivationalMoment"
257
257
  :showAnswers="showAnswersMM"
258
258
  :answerKeys="answerKeysMM"
@@ -269,7 +269,7 @@
269
269
  class="uikit-question__mpmc-choices-container"
270
270
  v-breakpoint="breakpointsWithEl"
271
271
  @emitSelectedMPMCChoice="selectMPMCChoice"
272
- >
272
+ >
273
273
  <template #explanationBottomExperiment>
274
274
  <slot name="explanationBottomExperiment" />
275
275
  </template>
@@ -287,8 +287,8 @@
287
287
  </div>
288
288
  <Summary
289
289
  v-if="
290
- ((isMCR && showAnswers)
291
- || (isMatrixQuestion && showMatrixAnswers))
290
+ ((isMCR && showAnswers)
291
+ || (isMatrixQuestion && showMatrixAnswers))
292
292
  || (isMPMCQuestion && showMPMCAnswers)
293
293
  || (isBuildListQuestion && showBuildListOrder)
294
294
  && !showPaywall"
@@ -341,9 +341,9 @@
341
341
  <slot name="action">
342
342
  <PocketButton
343
343
  v-if="
344
- !showAnswers
345
- && !hideAnswer
346
- && (showCheckAnswer || isMCR)
344
+ !showAnswers
345
+ && !hideAnswer
346
+ && (showCheckAnswer || isMCR)
347
347
  && !isMatrixQuestion
348
348
  && !isBuildListQuestion
349
349
  && !isMPMCQuestion
@@ -380,11 +380,11 @@
380
380
  </PocketButton>
381
381
  <PocketButton
382
382
  v-else-if="(
383
- showAnswers
384
- || showMatrixAnswers
383
+ showAnswers
384
+ || showMatrixAnswers
385
385
  || showBuildListOrder
386
- || showMPMCAnswers
387
- || hideAnswer)
386
+ || showMPMCAnswers
387
+ || hideAnswer)
388
388
  && (questionNumber >= quizLength)
389
389
  "
390
390
  :is-dark-mode="isDarkMode"
@@ -394,7 +394,7 @@
394
394
  </PocketButton>
395
395
  <PocketButton
396
396
  v-else-if="
397
- (showAnswers || showMatrixAnswers || showBuildListOrder || showMPMCAnswers || hideAnswer )
397
+ (showAnswers || showMatrixAnswers || showBuildListOrder || showMPMCAnswers || hideAnswer )
398
398
  && showNextQuestion
399
399
  "
400
400
  :is-dark-mode="isDarkMode"
@@ -444,7 +444,7 @@
444
444
  <slot name="explanationBottomExperiment" />
445
445
  </template>
446
446
  </Explanation>
447
- </div>
447
+ </div>
448
448
  </div>
449
449
  </template>
450
450
 
@@ -466,7 +466,7 @@ import MPMCChoicesContainer from '../Quiz/Question/MPMCChoicesContainer.vue'
466
466
  import BuildListChoicesContainer from './Question/BuildListChoicesContainer.vue'
467
467
  import type { Study } from '@pocketprep/types'
468
468
  import { highlightKeywordsInText, studyModes } from '../../utils'
469
- import type {
469
+ import type {
470
470
  Ref,
471
471
  TQuizMode,
472
472
  TChoiceKey,
@@ -674,11 +674,9 @@ const numberOfScenarioQuestions = computed(() => {
674
674
 
675
675
  const currentScenarioQuestionNumber = computed(() => {
676
676
  if (questionScenario.value?.questions) {
677
- const indexOfScenarioSerial = questionScenario.value.questions.findIndex(
678
- (scenarioSerial: IScenarioSerial) => {
679
- return scenarioSerial.serial === props.question.serial
680
- }
681
- )
677
+ const indexOfScenarioSerial = questionScenario.value.questions.findIndex((scenarioSerial: IScenarioSerial) => {
678
+ return scenarioSerial.serial === props.question.serial
679
+ })
682
680
 
683
681
  return indexOfScenarioSerial !== -1 ? indexOfScenarioSerial + 1 : undefined
684
682
  }
@@ -687,7 +685,7 @@ const currentScenarioQuestionNumber = computed(() => {
687
685
 
688
686
  const passageImageUrl = computed(() => {
689
687
  const imageUrl = props.question.passageImage?.url
690
-
688
+
691
689
  return imageUrl ? `${props.imageUrlPrefix}${imageUrl}` : null
692
690
  })
693
691
 
@@ -701,7 +699,7 @@ const passageImageLongAlt = computed(() => {
701
699
 
702
700
  const explanationImageUrl = computed(() => {
703
701
  const imageUrl = props.question.explanationImage?.url
704
-
702
+
705
703
  return imageUrl ? `${props.imageUrlPrefix}${imageUrl}` : null
706
704
  })
707
705
 
@@ -719,13 +717,15 @@ const showPassageAndImage = computed(() => {
719
717
 
720
718
  const passageAndImageTitle = computed(() => {
721
719
  if (props.question.passage && passageImageUrl.value) {
722
- return props.question.passageLabel ? `${props.question.passageLabel} + Image` :
723
- 'Passage + Image'
720
+ return props.question.passageLabel
721
+ ? `${props.question.passageLabel} + Image`
722
+ : 'Passage + Image'
724
723
  } else if (!props.question.passage && passageImageUrl.value) {
725
724
  return 'Image'
726
725
  } else {
727
- return props.question.passageLabel ? props.question.passageLabel :
728
- 'Passage'
726
+ return props.question.passageLabel
727
+ ? props.question.passageLabel
728
+ : 'Passage'
729
729
  }
730
730
  })
731
731
 
@@ -734,10 +734,13 @@ const reference = computed(() => {
734
734
  })
735
735
 
736
736
  const answers = computed((): TChoice[] => {
737
- return props.question.choices.filter(choice => choice.isCorrect).map((choice, index) => ({
738
- text: choice.text,
739
- key: `a${index + 1}` as `a${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`,
740
- })).filter(choice => !!choice.text)
737
+ return props.question.choices
738
+ .filter(choice => choice.isCorrect)
739
+ .map((choice, index) => ({
740
+ text: choice.text,
741
+ key: `a${index + 1}` as `a${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`,
742
+ }))
743
+ .filter(choice => !!choice.text)
741
744
  })
742
745
 
743
746
  const answerKeys = computed((): TChoiceKey[] => {
@@ -762,10 +765,13 @@ const correctOrderBuildListAnswerKeys = computed((): TBuildListChoiceKey[] => {
762
765
  })
763
766
 
764
767
  const distractors = computed((): TChoice[] => {
765
- return props.question.choices.filter(choice => !choice.isCorrect).map((choice, index) => ({
766
- text: choice.text,
767
- key: `d${index + 1}` as `d${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`,
768
- })).filter(choice => !!choice.text)
768
+ return props.question.choices
769
+ .filter(choice => !choice.isCorrect)
770
+ .map((choice, index) => ({
771
+ text: choice.text,
772
+ key: `d${index + 1}` as `d${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`,
773
+ }))
774
+ .filter(choice => !!choice.text)
769
775
  })
770
776
 
771
777
  const distractorKeys = computed((): TChoiceKey[] => {
@@ -786,23 +792,23 @@ const buildListChoices = computed(() => {
786
792
  key: choice.id as TBuildListChoiceKey,
787
793
  }
788
794
  })
789
-
795
+
790
796
  const shuffledChoices = shuffleBuildListChoices([ ...blChoices ])
791
-
797
+
792
798
  // Check if the shuffled array is in correct order
793
799
  const isInCorrectOrder = shuffledChoices.every((choice, index) => {
794
800
  const expectedNumber = index + 1
795
801
  const actualNumber = Number(choice.key.substring(1))
796
802
  return actualNumber === expectedNumber
797
803
  })
798
-
804
+
799
805
  // If it is in the correct order, then we need to switch the first and second element
800
806
  if (isInCorrectOrder && shuffledChoices.length >= 2) {
801
807
  const [ first, second, ...rest ] = shuffledChoices
802
808
  return [ second, first, ...rest ] as TBuildListChoice[]
803
809
  }
804
-
805
- return shuffledChoices
810
+
811
+ return shuffledChoices
806
812
  })
807
813
 
808
814
  const mpmcChoices = computed(() => {
@@ -830,7 +836,7 @@ const isMPMCQuestionCorrect = computed(() => {
830
836
 
831
837
  const isBuildListOrderCorrect = computed(() => {
832
838
  return showBuildListOrder.value
833
- && correctOrderBuildListAnswerKeys.value.length === selectedBuildListChoiceOrder.value.length
839
+ && correctOrderBuildListAnswerKeys.value.length === selectedBuildListChoiceOrder.value.length
834
840
  && correctOrderBuildListAnswerKeys.value.every(
835
841
  (item, index) => item === selectedBuildListChoiceOrder.value[index]
836
842
  )
@@ -873,8 +879,9 @@ const matrixChoiceScores = computed((): TMatrixChoiceScores => {
873
879
  const metrics = props.globalMetrics
874
880
 
875
881
  const scores: TMatrixChoiceScores = {
876
- totalAnswered: selectedMatrixChoices.value.length &&
877
- showMatrixAnswers && !props.reviewMode ? 1 : 0,
882
+ totalAnswered: selectedMatrixChoices.value.length && showMatrixAnswers && !props.reviewMode
883
+ ? 1
884
+ : 0,
878
885
  answeredCorrectly: isMatrixQuestionCorrect.value && !props.reviewMode ? 1 : 0,
879
886
  }
880
887
 
@@ -894,8 +901,7 @@ const mpmcChoiceScores = computed((): TChoiceScores => {
894
901
  const metrics = props.globalMetrics
895
902
 
896
903
  const scores: TChoiceScores = {
897
- totalAnswered: selectedMPMCChoices.value.length &&
898
- showMPMCAnswers && !props.reviewMode ? 1 : 0,
904
+ totalAnswered: selectedMPMCChoices.value.length && showMPMCAnswers && !props.reviewMode ? 1 : 0,
899
905
  answeredCorrectly: isMPMCQuestionCorrect.value && !props.reviewMode ? 1 : 0,
900
906
  }
901
907
 
@@ -915,8 +921,9 @@ const buildListChoiceScores = computed((): TBuildListChoiceScores => {
915
921
  const metrics = props.globalMetrics
916
922
 
917
923
  const scores: TBuildListChoiceScores = {
918
- totalAnswered: selectedBuildListChoiceOrder.value.length &&
919
- showBuildListOrder && !props.reviewMode ? 1 : 0,
924
+ totalAnswered: selectedBuildListChoiceOrder.value.length && showBuildListOrder && !props.reviewMode
925
+ ? 1
926
+ : 0,
920
927
  answeredCorrectly: isBuildListOrderCorrect.value && !props.reviewMode ? 1 : 0,
921
928
  }
922
929
 
@@ -989,8 +996,8 @@ const isUnanswered = computed(() => {
989
996
 
990
997
  const prompt = computed(() => {
991
998
  return highlightKeywordsInText({
992
- text: props.question.prompt,
993
- keywordDefinitions: props.keywordDefinitions,
999
+ text: props.question.prompt,
1000
+ keywordDefinitions: props.keywordDefinitions,
994
1001
  isDarkMode: props.isDarkMode,
995
1002
  location: 'prompt',
996
1003
  })
@@ -1020,7 +1027,7 @@ const keydownListener = (e: KeyboardEvent) => {
1020
1027
  case 'KeyD':
1021
1028
  if (!isTEIsQuestionType.value) {
1022
1029
  choices.value[3] && selectChoice(choices.value[3].key, true)
1023
- }
1030
+ }
1024
1031
  break
1025
1032
  case 'KeyE':
1026
1033
  if (!isTEIsQuestionType.value) {
@@ -1053,7 +1060,7 @@ const keydownListener = (e: KeyboardEvent) => {
1053
1060
  }
1054
1061
  break
1055
1062
  case 'KeyX':
1056
- (showAnswers.value || showMatrixAnswers.value || showBuildListOrder.value || showMPMCAnswers.value)
1063
+ (showAnswers.value || showMatrixAnswers.value || showBuildListOrder.value || showMPMCAnswers.value)
1057
1064
  && toggleExplanation()
1058
1065
  break
1059
1066
  case 'Escape':
@@ -1062,8 +1069,8 @@ const keydownListener = (e: KeyboardEvent) => {
1062
1069
  break
1063
1070
  case 'Enter':
1064
1071
  if (
1065
- !showAnswers.value
1066
- && selectedChoices.value.length
1072
+ !showAnswers.value
1073
+ && selectedChoices.value.length
1067
1074
  && focusChoiceKey.value === null
1068
1075
  && !isTEIsQuestionType.value
1069
1076
  ) {
@@ -1153,7 +1160,7 @@ const updateSelectedBuildListChoiceOrder = (buildListChoiceOrder: TBuildListChoi
1153
1160
  }
1154
1161
 
1155
1162
  // deterministic shuffling of choices so they don't change order everytime you reload the component
1156
- const shuffleChoices = (choicesToShuffle: TChoice[]): TChoice[]=> {
1163
+ const shuffleChoices = (choicesToShuffle: TChoice[]): TChoice[] => {
1157
1164
  const sortedChoices = choicesToShuffle.sort((a, b) => {
1158
1165
  const hashChar = (char: string, num: number) => ((num << 5) - num) + char.charCodeAt(0)
1159
1166
 
@@ -1177,7 +1184,7 @@ const shuffleChoices = (choicesToShuffle: TChoice[]): TChoice[]=> {
1177
1184
  : sortedChoices
1178
1185
  }
1179
1186
 
1180
- const shuffleBuildListChoices = (choicesToShuffle: TBuildListChoice[]): TBuildListChoice[]=> {
1187
+ const shuffleBuildListChoices = (choicesToShuffle: TBuildListChoice[]): TBuildListChoice[] => {
1181
1188
  const sortedChoices = choicesToShuffle.sort((a, b) => {
1182
1189
  const hashChar = (char: string, num: number) => ((num << 5) - num) + char.charCodeAt(0)
1183
1190
 
@@ -1201,7 +1208,7 @@ const shuffleBuildListChoices = (choicesToShuffle: TBuildListChoice[]): TBuildLi
1201
1208
  : sortedChoices
1202
1209
  }
1203
1210
 
1204
- const shuffleMPMCChoices = (choicesToShuffle: TMPMCChoice[]): TMPMCChoice[]=> {
1211
+ const shuffleMPMCChoices = (choicesToShuffle: TMPMCChoice[]): TMPMCChoice[] => {
1205
1212
  const sortedChoices = choicesToShuffle.sort((a, b) => {
1206
1213
  const hashChar = (char: string, num: number) => ((num << 5) - num) + char.charCodeAt(0)
1207
1214
 
@@ -1263,8 +1270,8 @@ const handleTouchMove = (event: TouchEvent) => {
1263
1270
  const changedY = event?.changedTouches[0]?.clientY || null
1264
1271
  const changedX = event?.changedTouches[0]?.clientX || null
1265
1272
  if (
1266
- changedY !== null
1267
- && changedX !== null
1273
+ changedY !== null
1274
+ && changedX !== null
1268
1275
  && swipeStart.value.y !== null
1269
1276
  && swipeStart.value.x !== null
1270
1277
  && Math.abs(changedX - swipeStart.value.x) > 26
@@ -1539,14 +1546,15 @@ watch(() => props.previousMatrixChoices, (previousMatrixChoices: TMatrixChoiceKe
1539
1546
  }
1540
1547
  }, { deep: true })
1541
1548
 
1542
- watch(() =>
1543
- props.previousMultiPartMultipleChoiceChoices,
1544
- (previousMultiPartMultipleChoiceChoices: TChoiceKey[] | undefined | null
1545
- ) => {
1546
- if (previousMultiPartMultipleChoiceChoices) {
1547
- updateSelectedMPMCChoices(previousMultiPartMultipleChoiceChoices)
1548
- }
1549
- }, { deep: true })
1549
+ watch(
1550
+ () => props.previousMultiPartMultipleChoiceChoices,
1551
+ (previousMultiPartMultipleChoiceChoices: TChoiceKey[] | undefined | null) => {
1552
+ if (previousMultiPartMultipleChoiceChoices) {
1553
+ updateSelectedMPMCChoices(previousMultiPartMultipleChoiceChoices)
1554
+ }
1555
+ },
1556
+ { deep: true }
1557
+ )
1550
1558
 
1551
1559
  watch(() => props.previousBuildListChoices, (previousBuildListChoices: TBuildListChoiceKey[] | undefined | null) => {
1552
1560
  if (previousBuildListChoices) {
@@ -1574,7 +1582,7 @@ watch(selectedMatrixChoices, () => {
1574
1582
 
1575
1583
  watch(selectedBuildListChoiceOrder, () => {
1576
1584
  emitSelectedChoices({
1577
- isCorrect: correctOrderBuildListAnswerKeys.value.length === selectedBuildListChoiceOrder.value.length
1585
+ isCorrect: correctOrderBuildListAnswerKeys.value.length === selectedBuildListChoiceOrder.value.length
1578
1586
  && correctOrderBuildListAnswerKeys.value.every(
1579
1587
  (item, index) => item === selectedBuildListChoiceOrder.value[index]),
1580
1588
  selectedChoices: selectedBuildListChoiceOrder.value,
@@ -1910,7 +1918,7 @@ provide(InjectionKeys.isTeachGroupReviewKey, isTeachGroupReview)
1910
1918
  cursor: pointer;
1911
1919
  font-size: 10px;
1912
1920
  line-height: 1;
1913
-
1921
+
1914
1922
  &[data-location="explanation"] {
1915
1923
  padding-top: 4.84px;
1916
1924
  background-color: $manilla;
@@ -214,4 +214,4 @@ onMounted(() => {
214
214
  }
215
215
  }
216
216
  }
217
- </style>
217
+ </style>