@pocketprep/ui-kit 3.6.0 → 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.
- package/dist/@pocketprep/ui-kit.css +1 -1
- package/dist/@pocketprep/ui-kit.js +11672 -11335
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +13 -12
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/lib/components/Forms/Radio.vue +1 -8
- package/lib/components/Quiz/Question/BuildListChoicesContainer.vue +7 -13
- package/lib/components/Quiz/Question/ChoicesContainer.vue +1 -9
- package/lib/components/Quiz/Question/MPMCChoicesContainer.vue +472 -0
- package/lib/components/Quiz/Question/MPMCRadioGroup.vue +169 -0
- package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +1 -9
- package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +1 -9
- package/lib/components/Quiz/Question/StatsSummary.vue +10 -2
- package/lib/components/Quiz/Question/Summary.vue +23 -6
- package/lib/components/Quiz/Question/composables.ts +8 -0
- package/lib/components/Quiz/Question/injectionSymbols.ts +6 -1
- package/lib/components/Quiz/Question.vue +199 -23
- package/lib/utils.ts +8 -0
- package/package.json +2 -2
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
'uikit-question__main--mcr': isMCR,
|
|
34
34
|
'uikit-question__main--mcr-review-mode': isMCR && reviewMode,
|
|
35
35
|
'uikit-question__main--matrix-question-review-mode': isMatrixQuestion && reviewMode,
|
|
36
|
+
'uikit-question__main--mpmc-question-review-mode': isMPMCQuestion && reviewMode,
|
|
37
|
+
'uikit-question__main--build-list-question-review-mode': isBuildListQuestion && reviewMode,
|
|
36
38
|
}"
|
|
37
39
|
>
|
|
38
40
|
<div v-if="!showPassageAndImage && !showExplanation && !showPaywall">
|
|
@@ -100,7 +102,7 @@
|
|
|
100
102
|
@upgradeClicked="emitUpgrade"
|
|
101
103
|
/>
|
|
102
104
|
<div
|
|
103
|
-
v-if="(showAnswers || showMatrixAnswers) && isTeachReview && isUnanswered"
|
|
105
|
+
v-if="(showAnswers || showMatrixAnswers || showMPMCAnswers) && isTeachReview && isUnanswered"
|
|
104
106
|
v-dark="isDarkMode"
|
|
105
107
|
class="uikit-question__unanswered-teach-review-label"
|
|
106
108
|
>
|
|
@@ -117,10 +119,11 @@
|
|
|
117
119
|
'uikit-question__choices--incorrect':
|
|
118
120
|
showAnswers && (isMCR || isUnanswered) && !isCorrect && !isTeachReview,
|
|
119
121
|
'uikit-question__choices--matrix': isMatrixQuestion,
|
|
122
|
+
'uikit-question__choices--mpmc': isMPMCQuestion,
|
|
120
123
|
'uikit-question__choices--unanswered': showAnswers && !isMCR && isUnanswered && !isCorrect,
|
|
121
124
|
'uikit-question__choices--show-stats': globalMetrics,
|
|
122
125
|
'uikit-question__choices--no-actions':
|
|
123
|
-
!(isMCR || isUnanswered || isMatrixQuestion || isBuildListQuestion)
|
|
126
|
+
!(isMCR || isUnanswered || isMatrixQuestion || isBuildListQuestion || isMPMCQuestion)
|
|
124
127
|
&& !globalMetrics
|
|
125
128
|
&& (
|
|
126
129
|
reviewMode
|
|
@@ -137,7 +140,16 @@
|
|
|
137
140
|
"
|
|
138
141
|
>
|
|
139
142
|
<div
|
|
140
|
-
v-if="
|
|
143
|
+
v-if="
|
|
144
|
+
showAnswers
|
|
145
|
+
&& !isMCR
|
|
146
|
+
&& !isMatrixQuestion
|
|
147
|
+
&& !isMPMCQuestion
|
|
148
|
+
&& !isBuildListQuestion
|
|
149
|
+
&& isUnanswered
|
|
150
|
+
&& !isCorrect
|
|
151
|
+
&& !isTeachReview
|
|
152
|
+
"
|
|
141
153
|
v-dark="isDarkMode"
|
|
142
154
|
class="uikit-question__unanswered-label"
|
|
143
155
|
>
|
|
@@ -152,6 +164,7 @@
|
|
|
152
164
|
v-if="
|
|
153
165
|
question.type !== 'Matrix Checkbox'
|
|
154
166
|
&& question.type !== 'Matrix Radio Button'
|
|
167
|
+
&& question.type !== 'Multi-Part Multiple Choice'
|
|
155
168
|
&& question.type !== 'Build List'"
|
|
156
169
|
ref="uikit-question__choices-container"
|
|
157
170
|
@emitChoiceMouseOver="choiceMouseOver"
|
|
@@ -247,6 +260,16 @@
|
|
|
247
260
|
<slot name="explanationBottomExperiment" />
|
|
248
261
|
</template>
|
|
249
262
|
</MobileMatrixChoicesContainer>
|
|
263
|
+
<MPMCChoicesContainer
|
|
264
|
+
v-if="question.type === 'Multi-Part Multiple Choice'"
|
|
265
|
+
class="uikit-question__mpmc-choices-container"
|
|
266
|
+
v-breakpoint="breakpointsWithEl"
|
|
267
|
+
@emitSelectedMPMCChoice="selectMPMCChoice"
|
|
268
|
+
>
|
|
269
|
+
<template #explanationBottomExperiment>
|
|
270
|
+
<slot name="explanationBottomExperiment" />
|
|
271
|
+
</template>
|
|
272
|
+
</MPMCChoicesContainer>
|
|
250
273
|
<BuildListChoicesContainer
|
|
251
274
|
v-if="question.type === 'Build List'"
|
|
252
275
|
class="uikit-question__build-list-choices-container"
|
|
@@ -260,8 +283,9 @@
|
|
|
260
283
|
</div>
|
|
261
284
|
<Summary
|
|
262
285
|
v-if="
|
|
263
|
-
((isMCR && showAnswers)
|
|
264
|
-
|| (isMatrixQuestion && showMatrixAnswers))
|
|
286
|
+
((isMCR && showAnswers)
|
|
287
|
+
|| (isMatrixQuestion && showMatrixAnswers))
|
|
288
|
+
|| (isMPMCQuestion && showMPMCAnswers)
|
|
265
289
|
|| (isBuildListQuestion && showBuildListOrder)
|
|
266
290
|
&& !showPaywall"
|
|
267
291
|
ref="uikit-question__summary"
|
|
@@ -317,7 +341,9 @@
|
|
|
317
341
|
&& !hideAnswer
|
|
318
342
|
&& (showCheckAnswer || isMCR)
|
|
319
343
|
&& !isMatrixQuestion
|
|
320
|
-
&& !isBuildListQuestion
|
|
344
|
+
&& !isBuildListQuestion
|
|
345
|
+
&& !isMPMCQuestion
|
|
346
|
+
"
|
|
321
347
|
:disabled="!selectedChoices.length"
|
|
322
348
|
:is-dark-mode="isDarkMode"
|
|
323
349
|
@click="clickCheckAnswer"
|
|
@@ -341,9 +367,22 @@
|
|
|
341
367
|
Check Answer
|
|
342
368
|
</PocketButton>
|
|
343
369
|
<PocketButton
|
|
344
|
-
v-else-if="
|
|
345
|
-
|
|
346
|
-
|
|
370
|
+
v-else-if="isMPMCQuestion && !showMPMCAnswers && !hideAnswer"
|
|
371
|
+
:disabled="!isMPMCQuestionAnswered"
|
|
372
|
+
:is-dark-mode="isDarkMode"
|
|
373
|
+
@click="clickCheckMPMCAnswer"
|
|
374
|
+
>
|
|
375
|
+
Check Answer
|
|
376
|
+
</PocketButton>
|
|
377
|
+
|
|
378
|
+
<PocketButton
|
|
379
|
+
v-else-if="(
|
|
380
|
+
showAnswers
|
|
381
|
+
|| showMatrixAnswers
|
|
382
|
+
|| showBuildListOrder
|
|
383
|
+
|| showMPMCAnswers
|
|
384
|
+
|| hideAnswer)
|
|
385
|
+
&& (questionNumber >= quizLength)
|
|
347
386
|
"
|
|
348
387
|
:is-dark-mode="isDarkMode"
|
|
349
388
|
@click="emitSubmitQuiz"
|
|
@@ -352,7 +391,7 @@
|
|
|
352
391
|
</PocketButton>
|
|
353
392
|
<PocketButton
|
|
354
393
|
v-else-if="
|
|
355
|
-
(showAnswers || showMatrixAnswers || showBuildListOrder || hideAnswer )
|
|
394
|
+
(showAnswers || showMatrixAnswers || showBuildListOrder || showMPMCAnswers || hideAnswer )
|
|
356
395
|
&& showNextQuestion
|
|
357
396
|
"
|
|
358
397
|
:is-dark-mode="isDarkMode"
|
|
@@ -378,6 +417,7 @@
|
|
|
378
417
|
:class="{
|
|
379
418
|
'uikit-question__right-side--explanation': showExplanation && !showPaywall,
|
|
380
419
|
'uikit-question__right-side--matrix-question-review-mode': isMatrixQuestion && reviewMode,
|
|
420
|
+
'uikit-question__right-side--mpmc-question-review-mode': isMPMCQuestion && reviewMode,
|
|
381
421
|
}"
|
|
382
422
|
>
|
|
383
423
|
<PassageAndImage
|
|
@@ -419,6 +459,7 @@ import Explanation from '../Quiz/Question/Explanation.vue'
|
|
|
419
459
|
import PassageAndImage from '../Quiz/Question/PassageAndImage.vue'
|
|
420
460
|
import MatrixChoicesContainer from '../Quiz/Question/MatrixChoicesContainer.vue'
|
|
421
461
|
import MobileMatrixChoicesContainer from '../Quiz/Question/MobileMatrixChoicesContainer.vue'
|
|
462
|
+
import MPMCChoicesContainer from '../Quiz/Question/MPMCChoicesContainer.vue'
|
|
422
463
|
import BuildListChoicesContainer from './Question/BuildListChoicesContainer.vue'
|
|
423
464
|
import type { Study } from '@pocketprep/types'
|
|
424
465
|
import { highlightKeywordsInText, studyModes } from '../../utils'
|
|
@@ -452,6 +493,7 @@ const props = withDefaults(defineProps<{
|
|
|
452
493
|
reviewMode?: boolean
|
|
453
494
|
previousChoices?: TChoiceKey[] | null
|
|
454
495
|
previousMatrixChoices?: TMatrixChoiceKey[] | null
|
|
496
|
+
previousMultiPartMultipleChoiceChoices?: TChoiceKey[] | null
|
|
455
497
|
previousBuildListChoices?: TBuildListChoiceKey[] | null
|
|
456
498
|
globalMetrics?: Study.Class.GlobalQuestionMetricJSON | null
|
|
457
499
|
showNames?: TViewNames | null
|
|
@@ -477,6 +519,7 @@ const props = withDefaults(defineProps<{
|
|
|
477
519
|
reviewMode: false,
|
|
478
520
|
previousChoices: null,
|
|
479
521
|
previousMatrixChoices: null,
|
|
522
|
+
previousMultiPartMultipleChoiceChoices: null,
|
|
480
523
|
previousBuildListChoices: null,
|
|
481
524
|
globalMetrics: null,
|
|
482
525
|
showNames: null,
|
|
@@ -531,9 +574,11 @@ const focusChoiceKey = ref<TChoiceKey | null>(null)
|
|
|
531
574
|
const choiceStrikes = ref<TChoiceKey[]>([])
|
|
532
575
|
const selectedChoices = ref<TChoiceKey[]>([])
|
|
533
576
|
const selectedMatrixChoices = ref<TMatrixChoiceKey[]>([])
|
|
577
|
+
const selectedMPMCChoices = ref<TChoiceKey[]>([])
|
|
534
578
|
const selectedBuildListChoiceOrder = ref<TBuildListChoiceKey[]>([])
|
|
535
579
|
const showAnswers = ref(false)
|
|
536
580
|
const showMatrixAnswers = ref(false)
|
|
581
|
+
const showMPMCAnswers = ref(false)
|
|
537
582
|
const showBuildListOrder = ref(false)
|
|
538
583
|
const showExplanation = ref(false)
|
|
539
584
|
const showPassageImageLongAlt = ref(false)
|
|
@@ -607,6 +652,10 @@ const isMatrixQuestion = computed(() => {
|
|
|
607
652
|
return props.question.type === 'Matrix Checkbox' || props.question.type === 'Matrix Radio Button'
|
|
608
653
|
})
|
|
609
654
|
|
|
655
|
+
const isMPMCQuestion = computed(() => {
|
|
656
|
+
return props.question.type === 'Multi-Part Multiple Choice'
|
|
657
|
+
})
|
|
658
|
+
|
|
610
659
|
const isBuildListQuestion = computed(() => {
|
|
611
660
|
return props.question.type === 'Build List'
|
|
612
661
|
})
|
|
@@ -765,6 +814,12 @@ const isMatrixQuestionCorrect = computed(() => {
|
|
|
765
814
|
&& !selectedMatrixChoices.value.join(' ').includes('d')
|
|
766
815
|
})
|
|
767
816
|
|
|
817
|
+
const isMPMCQuestionCorrect = computed(() => {
|
|
818
|
+
return showMPMCAnswers.value
|
|
819
|
+
&& selectedMPMCChoices.value.length === answerKeys.value.length
|
|
820
|
+
&& !selectedMPMCChoices.value.join(' ').includes('d')
|
|
821
|
+
})
|
|
822
|
+
|
|
768
823
|
const isBuildListOrderCorrect = computed(() => {
|
|
769
824
|
return showBuildListOrder.value
|
|
770
825
|
&& correctOrderBuildListAnswerKeys.value.length === selectedBuildListChoiceOrder.value.length
|
|
@@ -812,7 +867,28 @@ const matrixChoiceScores = computed((): TMatrixChoiceScores => {
|
|
|
812
867
|
const scores: TMatrixChoiceScores = {
|
|
813
868
|
totalAnswered: selectedMatrixChoices.value.length &&
|
|
814
869
|
showMatrixAnswers && !props.reviewMode ? 1 : 0,
|
|
815
|
-
answeredCorrectly:
|
|
870
|
+
answeredCorrectly: isMatrixQuestionCorrect.value && !props.reviewMode ? 1 : 0,
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
if (!metrics) {
|
|
874
|
+
return scores
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
scores.totalAnswered += (
|
|
878
|
+
(metrics.answeredCorrectlyCount || 0)
|
|
879
|
+
+ (metrics.answeredIncorrectlyCount || 0)
|
|
880
|
+
)
|
|
881
|
+
scores.answeredCorrectly += (metrics.answeredCorrectlyCount || 0)
|
|
882
|
+
return scores
|
|
883
|
+
})
|
|
884
|
+
|
|
885
|
+
const mpmcChoiceScores = computed((): TChoiceScores => {
|
|
886
|
+
const metrics = props.globalMetrics
|
|
887
|
+
|
|
888
|
+
const scores: TChoiceScores = {
|
|
889
|
+
totalAnswered: selectedMPMCChoices.value.length &&
|
|
890
|
+
showMPMCAnswers && !props.reviewMode ? 1 : 0,
|
|
891
|
+
answeredCorrectly: isMPMCQuestionCorrect.value && !props.reviewMode ? 1 : 0,
|
|
816
892
|
}
|
|
817
893
|
|
|
818
894
|
if (!metrics) {
|
|
@@ -869,11 +945,33 @@ const isMatrixQuestionAnswered = computed(() => {
|
|
|
869
945
|
return false
|
|
870
946
|
})
|
|
871
947
|
|
|
948
|
+
const isMPMCQuestionAnswered = computed(() => {
|
|
949
|
+
const mpmcLabels = question.value.mpmcLabels
|
|
950
|
+
const mpmcChoices = question.value.choices
|
|
951
|
+
const selectedMPMCLabelIndexes: number[] = []
|
|
952
|
+
|
|
953
|
+
selectedMPMCChoices.value.forEach(choice => {
|
|
954
|
+
const mpmcChoiceObj = mpmcChoices.find(c => c.id === choice)
|
|
955
|
+
if (
|
|
956
|
+
mpmcChoiceObj?.labelIndex !== undefined
|
|
957
|
+
&& !selectedMPMCLabelIndexes.includes(mpmcChoiceObj?.labelIndex)
|
|
958
|
+
) {
|
|
959
|
+
selectedMPMCLabelIndexes.push(mpmcChoiceObj?.labelIndex)
|
|
960
|
+
}
|
|
961
|
+
})
|
|
962
|
+
|
|
963
|
+
return mpmcLabels?.length === selectedMPMCLabelIndexes.length
|
|
964
|
+
})
|
|
965
|
+
|
|
872
966
|
const isUnanswered = computed(() => {
|
|
873
967
|
if (isBuildListQuestion.value) {
|
|
874
968
|
return selectedBuildListChoiceOrder.value.length === 0
|
|
875
969
|
}
|
|
876
970
|
|
|
971
|
+
if (isMPMCQuestion.value) {
|
|
972
|
+
return !isMPMCQuestionAnswered.value
|
|
973
|
+
}
|
|
974
|
+
|
|
877
975
|
if (isMatrixQuestion.value) {
|
|
878
976
|
return !isMatrixQuestionAnswered.value
|
|
879
977
|
}
|
|
@@ -978,6 +1076,9 @@ const startReviewMode = () => {
|
|
|
978
1076
|
if (isBuildListQuestion.value) {
|
|
979
1077
|
showBuildListOrder.value = true
|
|
980
1078
|
selectedBuildListChoiceOrder.value = correctOrderBuildListAnswerKeys.value
|
|
1079
|
+
} else if (isMPMCQuestion.value) {
|
|
1080
|
+
showMPMCAnswers.value = true
|
|
1081
|
+
selectedMPMCChoices.value = answerKeys.value
|
|
981
1082
|
} else if (isMatrixQuestion.value) {
|
|
982
1083
|
showMatrixAnswers.value = true
|
|
983
1084
|
selectedMatrixChoices.value = matrixAnswerKeys.value
|
|
@@ -990,6 +1091,7 @@ const startReviewMode = () => {
|
|
|
990
1091
|
const stopReviewMode = () => {
|
|
991
1092
|
showAnswers.value = false
|
|
992
1093
|
showMatrixAnswers.value = false
|
|
1094
|
+
showMPMCAnswers.value = false
|
|
993
1095
|
showBuildListOrder.value = false
|
|
994
1096
|
showExplanation.value = false
|
|
995
1097
|
selectedChoices.value = []
|
|
@@ -1004,6 +1106,10 @@ const updateSelectedMatrixChoices = (matrixChoices: TMatrixChoiceKey[]) => {
|
|
|
1004
1106
|
selectedMatrixChoices.value = [ ...matrixChoices ]
|
|
1005
1107
|
}
|
|
1006
1108
|
|
|
1109
|
+
const updateSelectedMPMCChoices = (updatedChoices: TChoiceKey[]) => {
|
|
1110
|
+
selectedMPMCChoices.value = [ ...updatedChoices ]
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1007
1113
|
const updateSelectedBuildListChoiceOrder = (buildListChoiceOrder: TBuildListChoiceKey[]) => {
|
|
1008
1114
|
selectedBuildListChoiceOrder.value = [ ...buildListChoiceOrder ]
|
|
1009
1115
|
}
|
|
@@ -1201,6 +1307,13 @@ const selectMatrixChoice = (matrixChoiceKeys: TMatrixChoiceKey[]) => {
|
|
|
1201
1307
|
selectedMatrixChoices.value = matrixChoiceKeys
|
|
1202
1308
|
}
|
|
1203
1309
|
|
|
1310
|
+
const selectMPMCChoice = (mpmcChoiceKeys: TChoiceKey[]) => {
|
|
1311
|
+
if (showMPMCAnswers.value) {
|
|
1312
|
+
return
|
|
1313
|
+
}
|
|
1314
|
+
selectedMPMCChoices.value = mpmcChoiceKeys
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1204
1317
|
const handleBuildListReorder = (reorderedChoices: TBuildListChoice[]) => {
|
|
1205
1318
|
if (showBuildListOrder.value) {
|
|
1206
1319
|
return
|
|
@@ -1310,6 +1423,23 @@ const clickCheckMatrixAnswer = () => {
|
|
|
1310
1423
|
}
|
|
1311
1424
|
}
|
|
1312
1425
|
|
|
1426
|
+
const clickCheckMPMCAnswer = () => {
|
|
1427
|
+
if (!props.hideAnswer) {
|
|
1428
|
+
showMPMCAnswers.value = true
|
|
1429
|
+
|
|
1430
|
+
emitCheckAnswer({
|
|
1431
|
+
isCorrect: isMPMCQuestionCorrect.value,
|
|
1432
|
+
selectedChoices: selectedMPMCChoices.value,
|
|
1433
|
+
questionSerial: props.question.serial,
|
|
1434
|
+
})
|
|
1435
|
+
|
|
1436
|
+
const summaryMatrixExplanationEl = questionSummaryRef?.value?.summaryMatrixExplanationEl
|
|
1437
|
+
if (summaryMatrixExplanationEl) {
|
|
1438
|
+
summaryMatrixExplanationEl?.focus()
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1313
1443
|
const clickCheckBuildListOrder = () => {
|
|
1314
1444
|
if (!props.hideAnswer) {
|
|
1315
1445
|
showBuildListOrder.value = true
|
|
@@ -1348,6 +1478,15 @@ watch(() => props.previousMatrixChoices, (previousMatrixChoices: TMatrixChoiceKe
|
|
|
1348
1478
|
}
|
|
1349
1479
|
}, { deep: true })
|
|
1350
1480
|
|
|
1481
|
+
watch(() =>
|
|
1482
|
+
props.previousMultiPartMultipleChoiceChoices,
|
|
1483
|
+
(previousMultiPartMultipleChoiceChoices: TChoiceKey[] | undefined | null
|
|
1484
|
+
) => {
|
|
1485
|
+
if (previousMultiPartMultipleChoiceChoices) {
|
|
1486
|
+
updateSelectedMPMCChoices(previousMultiPartMultipleChoiceChoices)
|
|
1487
|
+
}
|
|
1488
|
+
}, { deep: true })
|
|
1489
|
+
|
|
1351
1490
|
watch(() => props.previousBuildListChoices, (previousBuildListChoices: TBuildListChoiceKey[] | undefined | null) => {
|
|
1352
1491
|
if (previousBuildListChoices) {
|
|
1353
1492
|
updateSelectedBuildListChoiceOrder(previousBuildListChoices)
|
|
@@ -1372,6 +1511,25 @@ watch(selectedMatrixChoices, () => {
|
|
|
1372
1511
|
} as Study.Cloud.IQuizAnswer)
|
|
1373
1512
|
}, { deep: true })
|
|
1374
1513
|
|
|
1514
|
+
watch(selectedBuildListChoiceOrder, () => {
|
|
1515
|
+
emitSelectedChoices({
|
|
1516
|
+
isCorrect: correctOrderBuildListAnswerKeys.value.length === selectedBuildListChoiceOrder.value.length
|
|
1517
|
+
&& correctOrderBuildListAnswerKeys.value.every(
|
|
1518
|
+
(item, index) => item === selectedBuildListChoiceOrder.value[index]),
|
|
1519
|
+
selectedChoices: selectedBuildListChoiceOrder.value,
|
|
1520
|
+
questionSerial: props.question.serial,
|
|
1521
|
+
} as Study.Cloud.IQuizAnswer)
|
|
1522
|
+
}, { deep: true })
|
|
1523
|
+
|
|
1524
|
+
watch(selectedMPMCChoices, () => {
|
|
1525
|
+
emitSelectedChoices({
|
|
1526
|
+
isCorrect: selectedMPMCChoices.value.length === answerKeys.value.length
|
|
1527
|
+
&& !selectedMPMCChoices.value.join(' ').includes('d'),
|
|
1528
|
+
selectedChoices: selectedMPMCChoices.value,
|
|
1529
|
+
questionSerial: props.question.serial,
|
|
1530
|
+
} as Study.Cloud.IQuizAnswer)
|
|
1531
|
+
}, { deep: true })
|
|
1532
|
+
|
|
1375
1533
|
watch(showExplanation, () => {
|
|
1376
1534
|
emitUpdateShowExplanation()
|
|
1377
1535
|
})
|
|
@@ -1412,11 +1570,7 @@ if (props.reviewMode) {
|
|
|
1412
1570
|
startReviewMode()
|
|
1413
1571
|
}
|
|
1414
1572
|
|
|
1415
|
-
if (isBuildListQuestion.value && props.
|
|
1416
|
-
updateSelectedBuildListChoiceOrder(props.previousBuildListChoices)
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
if (!isMatrixQuestion.value && props.previousChoices) {
|
|
1573
|
+
if (!isMatrixQuestion.value && !isMPMCQuestion.value && !isBuildListQuestion.value && props.previousChoices) {
|
|
1420
1574
|
updateSelectedChoices(props.previousChoices)
|
|
1421
1575
|
}
|
|
1422
1576
|
|
|
@@ -1424,12 +1578,21 @@ if (isMatrixQuestion.value && props.previousMatrixChoices) {
|
|
|
1424
1578
|
updateSelectedMatrixChoices(props.previousMatrixChoices)
|
|
1425
1579
|
}
|
|
1426
1580
|
|
|
1581
|
+
if (isBuildListQuestion.value && props.previousBuildListChoices) {
|
|
1582
|
+
updateSelectedBuildListChoiceOrder(props.previousBuildListChoices)
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
if (isMPMCQuestion.value && props.previousMultiPartMultipleChoiceChoices) {
|
|
1586
|
+
updateSelectedMPMCChoices(props.previousMultiPartMultipleChoiceChoices)
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1427
1589
|
onMounted(() => {
|
|
1428
1590
|
questionEl.value = props.containerEl || questionRef.value
|
|
1429
1591
|
|
|
1430
1592
|
if (props.initialShowAnswers) {
|
|
1431
1593
|
showAnswers.value = props.initialShowAnswers
|
|
1432
1594
|
showMatrixAnswers.value = props.initialShowAnswers
|
|
1595
|
+
showMPMCAnswers.value = props.initialShowAnswers
|
|
1433
1596
|
showBuildListOrder.value = props.initialShowAnswers
|
|
1434
1597
|
}
|
|
1435
1598
|
|
|
@@ -1468,6 +1631,7 @@ provide(InjectionKeys.isCorrectKey, isCorrect)
|
|
|
1468
1631
|
provide(InjectionKeys.contextIconTypeKey, contextIconType)
|
|
1469
1632
|
provide(InjectionKeys.showAnswersKey, showAnswers)
|
|
1470
1633
|
provide(InjectionKeys.showMatrixAnswersKey, showMatrixAnswers)
|
|
1634
|
+
provide(InjectionKeys.showMPMCAnswersKey, showMPMCAnswers)
|
|
1471
1635
|
provide(InjectionKeys.showBuildListOrderKey, showBuildListOrder)
|
|
1472
1636
|
provide(InjectionKeys.imageUrlPrefixKey, imageUrlPrefix)
|
|
1473
1637
|
provide(InjectionKeys.passageImageUrlKey, passageImageUrl)
|
|
@@ -1497,13 +1661,17 @@ provide(InjectionKeys.keywordDefinitionsKey, keywordDefinitions)
|
|
|
1497
1661
|
provide(InjectionKeys.showPaywallKey, showPaywall)
|
|
1498
1662
|
provide(InjectionKeys.showPassageAndImageKey, showPassageAndImage)
|
|
1499
1663
|
provide(InjectionKeys.isMatrixQuestionKey, isMatrixQuestion)
|
|
1500
|
-
provide(InjectionKeys.
|
|
1664
|
+
provide(InjectionKeys.isMPMCQuestionKey, isMPMCQuestion)
|
|
1501
1665
|
provide(InjectionKeys.matrixChoiceScoresKey, matrixChoiceScores)
|
|
1502
|
-
provide(InjectionKeys.
|
|
1666
|
+
provide(InjectionKeys.mpmcChoiceScoresKey, mpmcChoiceScores)
|
|
1503
1667
|
provide(InjectionKeys.isMatrixQuestionCorrectKey, isMatrixQuestionCorrect)
|
|
1504
|
-
provide(InjectionKeys.
|
|
1668
|
+
provide(InjectionKeys.isMPMCQuestionCorrectKey, isMPMCQuestionCorrect)
|
|
1505
1669
|
provide(InjectionKeys.matrixAnswerKeysKey, matrixAnswerKeys)
|
|
1506
1670
|
provide(InjectionKeys.selectedMatrixChoicesKey, selectedMatrixChoices)
|
|
1671
|
+
provide(InjectionKeys.selectedMPMCChoicesKey, selectedMPMCChoices)
|
|
1672
|
+
provide(InjectionKeys.isBuildListQuestionKey, isBuildListQuestion)
|
|
1673
|
+
provide(InjectionKeys.buildListChoiceScoresKey, buildListChoiceScores)
|
|
1674
|
+
provide(InjectionKeys.isBuildListOrderCorrectKey, isBuildListOrderCorrect)
|
|
1507
1675
|
provide(InjectionKeys.selectedBuildListChoiceOrderKey, selectedBuildListChoiceOrder)
|
|
1508
1676
|
provide(InjectionKeys.isTeachGroupReviewKey, isTeachGroupReview)
|
|
1509
1677
|
</script>
|
|
@@ -1586,16 +1754,19 @@ provide(InjectionKeys.isTeachGroupReviewKey, isTeachGroupReview)
|
|
|
1586
1754
|
padding: 0 17px;
|
|
1587
1755
|
}
|
|
1588
1756
|
|
|
1589
|
-
&--matrix-question-review-mode#{&}--tablet-landscape:not(&--tablet-portrait)
|
|
1757
|
+
&--matrix-question-review-mode#{&}--tablet-landscape:not(&--tablet-portrait),
|
|
1758
|
+
&--mpmc-question-review-mode#{&}--tablet-landscape:not(&--tablet-portrait) {
|
|
1590
1759
|
width: 100%;
|
|
1591
1760
|
padding-right: 42px;
|
|
1592
1761
|
}
|
|
1593
1762
|
|
|
1594
|
-
&--matrix-question-review-mode#{&}--mobile
|
|
1763
|
+
&--matrix-question-review-mode#{&}--mobile,
|
|
1764
|
+
&--mpmc-question-review-mode#{&}--mobile {
|
|
1595
1765
|
overflow-y: scroll;
|
|
1596
1766
|
}
|
|
1597
1767
|
|
|
1598
|
-
&--mcr-review-mode#{&}--mobile
|
|
1768
|
+
&--mcr-review-mode#{&}--mobile,
|
|
1769
|
+
&--build-list-question-review-mode#{&}--mobile {
|
|
1599
1770
|
overflow-y: scroll;
|
|
1600
1771
|
width: 100%;
|
|
1601
1772
|
padding-right: 17px;
|
|
@@ -1615,7 +1786,8 @@ provide(InjectionKeys.isTeachGroupReviewKey, isTeachGroupReview)
|
|
|
1615
1786
|
display: none;
|
|
1616
1787
|
}
|
|
1617
1788
|
|
|
1618
|
-
&--matrix-question-review-mode#{&}--tablet-landscape
|
|
1789
|
+
&--matrix-question-review-mode#{&}--tablet-landscape,
|
|
1790
|
+
&--mpmc-question-review-mode#{&}--tablet-landscape {
|
|
1619
1791
|
display: none;
|
|
1620
1792
|
}
|
|
1621
1793
|
|
|
@@ -1921,6 +2093,10 @@ provide(InjectionKeys.isTeachGroupReviewKey, isTeachGroupReview)
|
|
|
1921
2093
|
&--matrix {
|
|
1922
2094
|
max-width: 518px;
|
|
1923
2095
|
}
|
|
2096
|
+
|
|
2097
|
+
&--mpmc {
|
|
2098
|
+
max-width: 518px;
|
|
2099
|
+
}
|
|
1924
2100
|
}
|
|
1925
2101
|
|
|
1926
2102
|
&__unanswered-label {
|
package/lib/utils.ts
CHANGED
|
@@ -157,3 +157,11 @@ export const highlightKeywordsInText = (params: {
|
|
|
157
157
|
return result
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
export const stripHtmlTags = (string?: string) => {
|
|
161
|
+
if (string) {
|
|
162
|
+
const div = document.createElement('div')
|
|
163
|
+
div.innerHTML = string
|
|
164
|
+
return div.textContent || ''
|
|
165
|
+
}
|
|
166
|
+
return ''
|
|
167
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pocketprep/ui-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"description": "Pocket Prep UI Kit",
|
|
5
5
|
"author": "pocketprep",
|
|
6
6
|
"scripts": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"vue-router": "4.5.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@pocketprep/types": "1.15.
|
|
85
|
+
"@pocketprep/types": "1.15.17",
|
|
86
86
|
"@stylistic/eslint-plugin-ts": "4.2.0",
|
|
87
87
|
"@tsconfig/node22": "22.0.0",
|
|
88
88
|
"@types/node": "22.13.10",
|