@pocketprep/ui-kit 3.5.30 → 3.7.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.
@@ -4,23 +4,35 @@
4
4
  class="uikit-question-stats-summary"
5
5
  >
6
6
  <div v-dark="isDarkMode" class="uikit-question-stats-summary__stats-summary-total">
7
- <div v-if="!isMatrixQuestion" class="uikit-question-stats-summary__stats-summary-value">
8
- {{ choiceScores.totalAnswered }}
7
+ <div v-if="isMPMCQuestion" class="uikit-question-stats-summary__stats-summary-value">
8
+ {{ mpmcChoiceScores.totalAnswered }}
9
9
  </div>
10
- <div v-else class="uikit-question-stats-summary__stats-summary-value">
10
+ <div v-else-if="isBuildListQuestion" class="uikit-question-stats-summary__stats-summary-value">
11
+ {{ buildListChoiceScores.totalAnswered }}
12
+ </div>
13
+ <div v-else-if="isMatrixQuestion" class="uikit-question-stats-summary__stats-summary-value">
11
14
  {{ matrixChoiceScores.totalAnswered }}
12
15
  </div>
16
+ <div v-else class="uikit-question-stats-summary__stats-summary-value">
17
+ {{ choiceScores.totalAnswered }}
18
+ </div>
13
19
  <div v-dark="isDarkMode" class="uikit-question-stats-summary__stats-summary-label">
14
20
  Studiers Answered
15
21
  </div>
16
22
  </div>
17
23
  <div v-dark="isDarkMode" class="uikit-question-stats-summary__stats-summary-correct">
18
- <div v-if="!isMatrixQuestion" class="uikit-question-stats-summary__stats-summary-value">
19
- {{ Math.round((choiceScores.answeredCorrectly / choiceScores.totalAnswered) * 100) }}%
24
+ <div v-if="isMPMCQuestion" class="uikit-question-stats-summary__stats-summary-value">
25
+ {{ Math.round((mpmcChoiceScores.answeredCorrectly / mpmcChoiceScores.totalAnswered) * 100) }}%
20
26
  </div>
21
- <div v-else class="uikit-question-stats-summary__stats-summary-value">
27
+ <div v-else-if="isBuildListQuestion" class="uikit-question-stats-summary__stats-summary-value">
28
+ {{ Math.round((buildListChoiceScores.answeredCorrectly / buildListChoiceScores.totalAnswered) * 100) }}%
29
+ </div>
30
+ <div v-else-if="isMatrixQuestion" class="uikit-question-stats-summary__stats-summary-value">
22
31
  {{ Math.round((matrixChoiceScores.answeredCorrectly / matrixChoiceScores.totalAnswered) * 100) }}%
23
32
  </div>
33
+ <div v-else class="uikit-question-stats-summary__stats-summary-value">
34
+ {{ Math.round((choiceScores.answeredCorrectly / choiceScores.totalAnswered) * 100) }}%
35
+ </div>
24
36
  <div v-dark="isDarkMode" class="uikit-question-stats-summary__stats-summary-label">
25
37
  Answered Correctly
26
38
  </div>
@@ -37,7 +49,11 @@ const {
37
49
  choiceScores,
38
50
  isDarkMode,
39
51
  isMatrixQuestion,
52
+ isMPMCQuestion,
40
53
  matrixChoiceScores,
54
+ mpmcChoiceScores,
55
+ buildListChoiceScores,
56
+ isBuildListQuestion,
41
57
  } = useQuestionContext()
42
58
  </script>
43
59
 
@@ -7,6 +7,10 @@
7
7
  :class="{
8
8
  'uikit-question-summary--matrix-question': isMatrixQuestion,
9
9
  'uikit-question-summary--matrix-question-review-mode': isMatrixQuestion && reviewMode,
10
+ 'uikit-question-summary--mpmc-question': isMPMCQuestion,
11
+ 'uikit-question-summary--mpmc-question-review-mode': isMPMCQuestion && reviewMode,
12
+ 'uikit-question-summary--build-list-question': isBuildListQuestion,
13
+ 'uikit-question-summary--build-list-question-review-mode': isBuildListQuestion && reviewMode,
10
14
  }"
11
15
  >
12
16
  <div class="uikit-question-summary__summary-title">
@@ -44,6 +48,10 @@
44
48
  :class="{
45
49
  'uikit-question-summary__summary-dropdown-explanation--matrix-question-review-mode':
46
50
  isMatrixQuestion && reviewMode,
51
+ 'uikit-question-summary__summary-dropdown-explanation--mpmc-question-review-mode':
52
+ isMPMCQuestion && reviewMode,
53
+ 'uikit-question-summary__summary-dropdown-explanation--build-list-question-review-mode':
54
+ isBuildListQuestion && reviewMode,
47
55
  }"
48
56
  >
49
57
  <slot name="explanationTopExperiment"></slot>
@@ -148,17 +156,23 @@ const {
148
156
  hideReferences,
149
157
  isCorrect,
150
158
  isMatrixQuestionCorrect,
159
+ isMPMCQuestionCorrect,
160
+ isBuildListOrderCorrect,
151
161
  isUnanswered,
152
162
  reviewMode,
153
163
  isDarkMode,
154
164
  isMatrixQuestion,
165
+ isMPMCQuestion,
166
+ isBuildListQuestion,
155
167
  breakpointsWithEl,
156
168
  keywordDefinitions,
157
169
  } = useQuestionContext()
158
170
 
159
171
  const isQuestionCorrect = computed(() => {
160
- return (!isMatrixQuestion.value && isCorrect.value) ||
161
- (isMatrixQuestion.value && isMatrixQuestionCorrect.value && !isUnanswered.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)
162
176
  })
163
177
 
164
178
  const summary = computed(() => {
@@ -204,14 +218,24 @@ const toggleSummaryExplanationImageLongAlt = () => {
204
218
  max-width: 518px;
205
219
  }
206
220
 
207
- &--matrix-question-review-mode#{&}--tablet-landscape {
221
+ &--build-list-question {
222
+ max-width: 452px;
223
+ margin-left: 38px;
208
224
  display: inline-block;
209
225
  }
210
226
 
211
- &--tablet-portrait {
227
+ &--matrix-question-review-mode#{&}--tablet-landscape,
228
+ &--mpmc-question-review-mode#{&}--tablet-landscape {
212
229
  display: inline-block;
213
230
  }
214
231
 
232
+ &--mpmc-question {
233
+ max-width: 492px;
234
+ }
235
+
236
+ &--tablet-portrait {
237
+ display: inline-block;
238
+ }
215
239
 
216
240
  &__summary-title {
217
241
  font-weight: 600;
@@ -295,7 +319,9 @@ const toggleSummaryExplanationImageLongAlt = () => {
295
319
  &__summary-dropdown-explanation {
296
320
  display: none;
297
321
 
298
- &--matrix-question-review-mode#{&}--tablet-landscape {
322
+ &--matrix-question-review-mode#{&}--tablet-landscape,
323
+ &--mpmc-question-review-mode#{&}--tablet-landscape,
324
+ &--build-list-question-review-mode#{&}--tablet-landscape {
299
325
  display: inline-block;
300
326
  }
301
327
 
@@ -1,6 +1,6 @@
1
1
  import { inject, ref } from 'vue'
2
2
  import * as InjectionKeys from './injectionSymbols'
3
- import type { TChoice, TChoiceKey, TMatrixChoiceKey } from '../question'
3
+ import type { TChoice, TChoiceKey, TMatrixChoiceKey, TBuildListChoice } from '../question'
4
4
 
5
5
  export const useQuestionContext = () => {
6
6
  const question = inject(InjectionKeys.questionKey)
@@ -15,6 +15,7 @@ export const useQuestionContext = () => {
15
15
  question,
16
16
  choiceScores,
17
17
  choices: inject(InjectionKeys.choicesKey, ref<TChoice[]>([])),
18
+ buildListChoices: inject(InjectionKeys.buildListChoicesKey, ref<TBuildListChoice[]>([])),
18
19
  questionEl: inject(InjectionKeys.questionElKey, ref(null)),
19
20
  breakpointsWithEl: inject(InjectionKeys.breakpointsWithElKey, ref({
20
21
  breakpoints: {
@@ -32,6 +33,8 @@ export const useQuestionContext = () => {
32
33
  contextIconType: inject(InjectionKeys.contextIconTypeKey),
33
34
  showAnswers: inject(InjectionKeys.showAnswersKey, ref(false)),
34
35
  showMatrixAnswers: inject(InjectionKeys.showMatrixAnswersKey, ref(false)),
36
+ showMPMCAnswers: inject(InjectionKeys.showMPMCAnswersKey, ref(false)),
37
+ showBuildListOrder: inject(InjectionKeys.showBuildListOrderKey, ref(false)),
35
38
  imageUrlPrefix: inject(InjectionKeys.imageUrlPrefixKey, ref('')),
36
39
  passageImageUrl: inject(InjectionKeys.passageImageUrlKey, ref<string | null>(null)),
37
40
  passageImageAlt: inject(InjectionKeys.passageImageAltKey, ref<string | undefined>('')),
@@ -59,13 +62,27 @@ export const useQuestionContext = () => {
59
62
  showPaywall: inject(InjectionKeys.showPaywallKey, ref(false)),
60
63
  showPassageAndImage: inject(InjectionKeys.showPassageAndImageKey, ref(false)),
61
64
  isMatrixQuestion: inject(InjectionKeys.isMatrixQuestionKey, ref(false)),
65
+ isMPMCQuestion: inject(InjectionKeys.isMPMCQuestionKey, ref(false)),
66
+ isBuildListQuestion: inject(InjectionKeys.isBuildListQuestionKey, ref(false)),
62
67
  matrixChoiceScores: inject(InjectionKeys.matrixChoiceScoresKey, ref({
63
68
  totalAnswered: 0,
64
69
  answeredCorrectly: 0,
65
70
  })),
71
+ mpmcChoiceScores: inject(InjectionKeys.mpmcChoiceScoresKey, ref({
72
+ totalAnswered: 0,
73
+ answeredCorrectly: 0,
74
+ })),
75
+ buildListChoiceScores: inject(InjectionKeys.buildListChoiceScoresKey, ref({
76
+ totalAnswered: 0,
77
+ answeredCorrectly: 0,
78
+ })),
66
79
  isMatrixQuestionCorrect: inject(InjectionKeys.isMatrixQuestionCorrectKey, ref(false)),
80
+ isMPMCQuestionCorrect: inject(InjectionKeys.isMPMCQuestionCorrectKey, ref(false)),
81
+ isBuildListOrderCorrect: inject(InjectionKeys.isBuildListOrderCorrectKey, ref(false)),
67
82
  matrixAnswerKeys: inject(InjectionKeys.matrixAnswerKeysKey, ref<TMatrixChoiceKey[]>([])),
68
83
  selectedMatrixChoices: inject(InjectionKeys.selectedMatrixChoicesKey, ref([])),
84
+ selectedMPMCChoices: inject(InjectionKeys.selectedMPMCChoicesKey, ref([])),
85
+ selectedBuildListChoiceOrder: inject(InjectionKeys.selectedBuildListChoiceOrderKey, ref([])),
69
86
  isTeachGroupReview: inject(InjectionKeys.isTeachGroupReviewKey, ref(false)),
70
87
  }
71
88
  }
@@ -1,17 +1,22 @@
1
+ /* eslint-disable max-len */
1
2
  import type { Study } from '@pocketprep/types'
2
3
  import type {
4
+ TBuildListChoice,
3
5
  TChoice,
4
6
  TChoiceKey,
5
7
  TChoiceScores,
6
8
  TContextIcon,
7
9
  TMatrixChoiceKey,
10
+ TBuildListChoiceKey,
8
11
  TMatrixChoiceScores,
12
+ TBuildListChoiceScores,
9
13
  TQuizMode,
10
14
  } from '../question'
11
15
  import type { ComputedRef, InjectionKey, Ref } from 'vue'
12
16
 
13
17
  export const questionKey = Symbol('question') as InjectionKey<ComputedRef<Study.Class.QuestionJSON>>
14
18
  export const choicesKey = Symbol('choices') as InjectionKey<ComputedRef<TChoice[]>>
19
+ export const buildListChoicesKey = Symbol('choices') as InjectionKey<ComputedRef<TBuildListChoice[]>>
15
20
  export const questionElKey = Symbol('questionEl') as InjectionKey<Ref<Element | null>>
16
21
  export const breakpointsWithElKey = Symbol('breakpointsWithEl') as InjectionKey<Ref<{
17
22
  breakpoints: {
@@ -29,6 +34,8 @@ export const isCorrectKey = Symbol('isCorrect') as InjectionKey<ComputedRef<bool
29
34
  export const contextIconTypeKey = Symbol('contextIconType') as InjectionKey<ComputedRef<TContextIcon>>
30
35
  export const showAnswersKey = Symbol('showAnswers') as InjectionKey<Ref<boolean>>
31
36
  export const showMatrixAnswersKey = Symbol('showMatrixAnswers') as InjectionKey<Ref<boolean>>
37
+ export const showMPMCAnswersKey = Symbol('showMPMCAnswers') as InjectionKey<Ref<boolean>>
38
+ export const showBuildListOrderKey = Symbol('showBuildListOrder') as InjectionKey<Ref<boolean>>
32
39
  export const imageUrlPrefixKey = Symbol('imageUrlPrefix') as InjectionKey<Ref<string>>
33
40
  export const passageImageUrlKey = Symbol('passageImageUrl') as InjectionKey<ComputedRef<string | null>>
34
41
  export const passageImageAltKey = Symbol('passageImageAlt') as InjectionKey<ComputedRef<string | undefined>>
@@ -62,8 +69,16 @@ export const keywordDefinitionsKey = Symbol('keywordDefinitions') as InjectionKe
62
69
  export const showPaywallKey = Symbol('showPaywall') as InjectionKey<Ref<boolean>>
63
70
  export const showPassageAndImageKey = Symbol('showPassageAndImage') as InjectionKey<ComputedRef<boolean>>
64
71
  export const isMatrixQuestionKey = Symbol('isMatrixQuestion') as InjectionKey<ComputedRef<boolean>>
72
+ export const isMPMCQuestionKey = Symbol('isMPMCQuestion') as InjectionKey<ComputedRef<boolean>>
73
+ export const isBuildListQuestionKey = Symbol('isBuildListQuestion') as InjectionKey<ComputedRef<boolean>>
65
74
  export const matrixChoiceScoresKey = Symbol('matrixChoiceScores') as InjectionKey<ComputedRef<TMatrixChoiceScores>>
75
+ export const mpmcChoiceScoresKey = Symbol('mpmcChoiceScores') as InjectionKey<ComputedRef<TChoiceScores>>
76
+ export const buildListChoiceScoresKey = Symbol('buildListChoiceScores') as InjectionKey<ComputedRef<TBuildListChoiceScores>>
66
77
  export const isMatrixQuestionCorrectKey = Symbol('isMatrixQuestionCorrect') as InjectionKey<ComputedRef<boolean>>
78
+ export const isMPMCQuestionCorrectKey = Symbol('isMPMCQuestionCorrect') as InjectionKey<ComputedRef<boolean>>
79
+ export const isBuildListOrderCorrectKey = Symbol('isBuildListOrderCorrect') as InjectionKey<ComputedRef<boolean>>
67
80
  export const matrixAnswerKeysKey = Symbol('matrixAnswerKeys') as InjectionKey<ComputedRef<TMatrixChoiceKey[]>>
68
81
  export const selectedMatrixChoicesKey = Symbol('selectedMatrixChoices') as InjectionKey<Ref<TMatrixChoiceKey[]>>
82
+ export const selectedMPMCChoicesKey = Symbol('selectedMPMCChoices') as InjectionKey<Ref<TChoiceKey[]>>
83
+ export const selectedBuildListChoiceOrderKey = Symbol('selectedBuildListChoiceOrder') as InjectionKey<Ref<TBuildListChoiceKey[]>>
69
84
  export const isTeachGroupReviewKey = Symbol('isTeachGroupReview') as InjectionKey<Ref<boolean>>