@pocketprep/ui-kit 3.4.63 → 3.4.65
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.js +350 -344
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +2 -2
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +13 -1
- package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +28 -23
- package/lib/components/Quiz/Question.vue +2 -0
- package/package.json +1 -1
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
(showMatrixAnswers || reviewMode) && isMatrixQuestionCorrect,
|
|
41
41
|
'uikit-question-matrix-choices-container__choices-container--incorrect':
|
|
42
42
|
(showMatrixAnswers || reviewMode) && !isMatrixQuestionCorrect,
|
|
43
|
-
|
|
43
|
+
'uikit-question-matrix-choices-container__choices-container--teach-group-review':
|
|
44
|
+
(showMatrixAnswers || reviewMode) && isTeachGroupReview,
|
|
44
45
|
}"
|
|
45
46
|
v-dark="isDarkMode"
|
|
46
47
|
v-breakpoint:questionEl="breakpoints"
|
|
@@ -202,6 +203,7 @@ export default class MatrixChoicesContainer extends Vue {
|
|
|
202
203
|
@Prop() matrixAnswerKeys!: TMatrixChoiceKey[]
|
|
203
204
|
@Prop() matrixDistractorKeys!: TMatrixChoiceKey[]
|
|
204
205
|
@Prop() selectedMatrixChoices!: TMatrixChoiceKey[]
|
|
206
|
+
@Prop({ default: false }) isTeachGroupReview!: boolean
|
|
205
207
|
|
|
206
208
|
matrixCheckboxGrid: boolean[][] | undefined = undefined
|
|
207
209
|
matrixRadioGrid: IRadioOptions[] | undefined = undefined
|
|
@@ -556,6 +558,16 @@ export default class MatrixChoicesContainer extends Vue {
|
|
|
556
558
|
&--mobile {
|
|
557
559
|
display: none;
|
|
558
560
|
}
|
|
561
|
+
|
|
562
|
+
&--teach-group-review {
|
|
563
|
+
&::after {
|
|
564
|
+
display: none;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
&--dark::after {
|
|
568
|
+
display: none;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
559
571
|
}
|
|
560
572
|
|
|
561
573
|
&__choices {
|
|
@@ -396,6 +396,19 @@ export default class MobileMatrixChoicesContainer extends Vue {
|
|
|
396
396
|
|
|
397
397
|
convertSelectedMatrixChoiceToCheckboxGrid () {
|
|
398
398
|
const checkboxGrid = this.defaultCheckboxGrid
|
|
399
|
+
|
|
400
|
+
// Reset this.selectedColumnHeaders string[][] in case in headers are still in the arrays
|
|
401
|
+
// Let selectedMatrixChoices set those columns
|
|
402
|
+
const columnMatrixLabels = this.question.matrixLabels?.rows
|
|
403
|
+
const defaultSelectedColumnLabels: string[][] = []
|
|
404
|
+
if (columnMatrixLabels) {
|
|
405
|
+
columnMatrixLabels.forEach(() => {
|
|
406
|
+
defaultSelectedColumnLabels.push([])
|
|
407
|
+
})
|
|
408
|
+
|
|
409
|
+
this.selectedColumnHeaders = defaultSelectedColumnLabels
|
|
410
|
+
}
|
|
411
|
+
|
|
399
412
|
this.selectedMatrixChoices.forEach(choice => {
|
|
400
413
|
const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
|
|
401
414
|
const columnIndex = Number(choice.split('_').pop()) - 1
|
|
@@ -417,6 +430,9 @@ export default class MobileMatrixChoicesContainer extends Vue {
|
|
|
417
430
|
const columnIndex = Number(choice.split('_').pop()) - 1
|
|
418
431
|
if (this.selectedColumnHeaders[rowIndex] && this.question.matrixLabels?.columns[columnIndex]) {
|
|
419
432
|
const columnHeader = this.question.matrixLabels?.columns[columnIndex]
|
|
433
|
+
// In case a column header is still in selectedColumnHeaders, remove it first and let
|
|
434
|
+
// selectedMatrixChoices add selected column header based on selected choices
|
|
435
|
+
this.selectedColumnHeaders[rowIndex].pop()
|
|
420
436
|
this.selectedColumnHeaders[rowIndex].push(columnHeader)
|
|
421
437
|
}
|
|
422
438
|
if (radioBtnGrid && radioBtnGrid[rowIndex]) {
|
|
@@ -429,6 +445,18 @@ export default class MobileMatrixChoicesContainer extends Vue {
|
|
|
429
445
|
checkboxRowClicked (rowIndex: number, columnIndex: number) {
|
|
430
446
|
if (this.matrixCheckboxGrid && this.matrixCheckboxGrid[rowIndex]) {
|
|
431
447
|
this.matrixCheckboxGrid[rowIndex][columnIndex] = !this.matrixCheckboxGrid[rowIndex][columnIndex]
|
|
448
|
+
const columnHeader = this.question.matrixLabels?.columns[columnIndex]
|
|
449
|
+
|
|
450
|
+
if (this.selectedColumnHeaders && this.selectedColumnHeaders[rowIndex] && columnHeader) {
|
|
451
|
+
if (this.selectedColumnHeaders[rowIndex].includes(columnHeader)) {
|
|
452
|
+
const columnHeaderIndex = this.selectedColumnHeaders[rowIndex].indexOf(columnHeader)
|
|
453
|
+
if (columnHeaderIndex !== -1) {
|
|
454
|
+
this.selectedColumnHeaders[rowIndex].splice(columnHeaderIndex, 1)
|
|
455
|
+
}
|
|
456
|
+
} else {
|
|
457
|
+
this.selectedColumnHeaders[rowIndex].push(columnHeader)
|
|
458
|
+
}
|
|
459
|
+
}
|
|
432
460
|
}
|
|
433
461
|
}
|
|
434
462
|
|
|
@@ -469,29 +497,6 @@ export default class MobileMatrixChoicesContainer extends Vue {
|
|
|
469
497
|
}
|
|
470
498
|
}
|
|
471
499
|
|
|
472
|
-
@Watch('matrixCheckboxGrid', { deep: true })
|
|
473
|
-
addRemoveCheckboxColumnHeaders () {
|
|
474
|
-
if (this.matrixCheckboxGrid) {
|
|
475
|
-
const selectedCheckboxColumnLabels: string[][] = []
|
|
476
|
-
this.matrixCheckboxGrid.forEach((row, rowIndex) => {
|
|
477
|
-
selectedCheckboxColumnLabels.push([])
|
|
478
|
-
row.forEach((choice, choiceIndex) => {
|
|
479
|
-
if (
|
|
480
|
-
choice
|
|
481
|
-
&& this.question.matrixLabels?.columns
|
|
482
|
-
&& this.question.matrixLabels?.columns[choiceIndex]
|
|
483
|
-
) {
|
|
484
|
-
const columnLabel = this.question.matrixLabels?.columns[choiceIndex]
|
|
485
|
-
if (selectedCheckboxColumnLabels[rowIndex]) {
|
|
486
|
-
selectedCheckboxColumnLabels[rowIndex].push(columnLabel)
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
})
|
|
490
|
-
this.selectedColumnHeaders = selectedCheckboxColumnLabels
|
|
491
|
-
})
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
|
|
495
500
|
@Watch('matrixRadioGrid', { deep: true })
|
|
496
501
|
matrixRadioGridChange () {
|
|
497
502
|
if (this.matrixChoiceLayout && this.matrixRadioGrid && (!this.reviewMode || !this.showMatrixAnswers)) {
|
|
@@ -255,6 +255,7 @@
|
|
|
255
255
|
:is-dark-mode="isDarkMode"
|
|
256
256
|
:question-el="questionEl"
|
|
257
257
|
:breakpoints="breakpoints"
|
|
258
|
+
:is-teach-group-review="isTeachGroupReview"
|
|
258
259
|
@emitSelectedMatrixChoice="selectMatrixChoice"
|
|
259
260
|
@emitAnsweredMatrixRowIndex="answeredMatrixRowIndex"
|
|
260
261
|
>
|
|
@@ -570,6 +571,7 @@ export default class Question extends Vue {
|
|
|
570
571
|
@Prop({ default: false }) showPaywall!: boolean
|
|
571
572
|
@Prop({ default: false }) hideReferences!: boolean
|
|
572
573
|
@Prop({ default: false }) isTeachReview!: boolean
|
|
574
|
+
@Prop({ default: false }) isTeachGroupReview!: boolean
|
|
573
575
|
@Prop({ default: [] }) keywordDefinitions!: { keyword: string; definition: string }[]
|
|
574
576
|
|
|
575
577
|
hoverChoiceKey: TChoiceKey | null = null
|