@pocketprep/ui-kit 3.4.52 → 3.4.53

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.
@@ -0,0 +1,614 @@
1
+ <template>
2
+ <div
3
+ v-dark="isDarkMode"
4
+ class="uikit-question-matrix-choices-container"
5
+ ref="uikit-question-matrix-choices-container"
6
+ >
7
+ <div
8
+ v-dark="isDarkMode"
9
+ v-breakpoint:questionEl="breakpoints"
10
+ class="uikit-question-matrix-choices-container__columns"
11
+ >
12
+ <div
13
+ v-dark="isDarkMode"
14
+ v-breakpoint:questionEl="breakpoints"
15
+ class="uikit-question-matrix-choices-container__column-row-header"
16
+ :class="{
17
+ 'uikit-question-matrix-choices-container__column-row-header--two-columns':
18
+ numberOfMatrixColumnLabels === 2
19
+ }"
20
+ v-html="matrixColumnLabelsForRows"
21
+ />
22
+ <div
23
+ class="uikit-question-matrix-choices-container__column-header"
24
+ :class="{
25
+ 'uikit-question-matrix-choices-container__column-header--two-columns':
26
+ numberOfMatrixColumnLabels === 2
27
+ }"
28
+ lang="de"
29
+ v-for="(columnLabel, index) in matrixColumnLabels"
30
+ :key="index"
31
+ v-dark="isDarkMode"
32
+ v-breakpoint:questionEl="breakpoints"
33
+ v-html="columnLabel"
34
+ />
35
+ </div>
36
+ <div
37
+ class="uikit-question-matrix-choices-container__choices-container"
38
+ :class="{
39
+ 'uikit-question-matrix-choices-container__choices-container--correct':
40
+ (showMatrixAnswers || reviewMode) && isMatrixQuestionCorrect,
41
+ 'uikit-question-matrix-choices-container__choices-container--incorrect':
42
+ (showMatrixAnswers || reviewMode) && !isMatrixQuestionCorrect,
43
+
44
+ }"
45
+ v-dark="isDarkMode"
46
+ v-breakpoint:questionEl="breakpoints"
47
+ >
48
+ <div
49
+ class="uikit-question-matrix-choices-container__choices"
50
+ :class="{
51
+ 'uikit-question-matrix-choices-container__choices--two-columns':
52
+ numberOfMatrixColumnLabels === 2
53
+ }"
54
+ v-dark="isDarkMode"
55
+ v-breakpoint:questionEl="breakpoints"
56
+ v-for="(rowLabel, rowIndex) in matrixRowLabels"
57
+ :key="rowIndex"
58
+ >
59
+ <div
60
+ class="uikit-question-matrix-choices-container__choice-text"
61
+ :class="{
62
+ 'uikit-question-matrix-choices-container__choice-text--two-columns':
63
+ numberOfMatrixColumnLabels === 2
64
+ }"
65
+ v-dark="isDarkMode"
66
+ v-breakpoint:questionEl="breakpoints"
67
+ v-html="rowLabel"
68
+ />
69
+ <template
70
+ v-if="
71
+ question.type === 'Matrix Checkbox' &&
72
+ matrixCheckboxGrid &&
73
+ matrixCheckboxGrid[rowIndex]"
74
+ >
75
+ <div
76
+ class="uikit-question-matrix-choices-container__checkbox"
77
+ :class="{
78
+ 'uikit-question-matrix-choices-container__checkbox--two-columns':
79
+ numberOfMatrixColumnLabels === 2
80
+ }"
81
+ v-for="(columnLabel, columnIndex) in matrixColumnLabels"
82
+ :key="columnIndex"
83
+ v-dark="isDarkMode"
84
+ v-breakpoint:questionEl="breakpoints"
85
+ >
86
+ <Checkbox
87
+ v-if="(showMatrixAnswers || reviewMode) &&
88
+ correctAnswerButNotSelected(rowIndex, columnIndex)"
89
+ :model-value="true"
90
+ :is-dark-mode="isDarkMode"
91
+ :disabled="showMatrixAnswers || reviewMode"
92
+ :checkbox-check-styles="checkboxCheckStyling(rowIndex, columnIndex)"
93
+ />
94
+ <Checkbox
95
+ v-else
96
+ v-model="matrixCheckboxGrid[rowIndex][columnIndex]"
97
+ :is-dark-mode="isDarkMode"
98
+ :disabled="showMatrixAnswers || reviewMode"
99
+ :checkbox-styles="checkboxContainerStyling(rowIndex, columnIndex)"
100
+ />
101
+ <Icon
102
+ v-if="
103
+ (showMatrixAnswers || reviewMode) &&
104
+ (incorrectlySelectedChoice(rowIndex, columnIndex) ||
105
+ correctAnswerButNotSelected(rowIndex, columnIndex))"
106
+ class="uikit-question-matrix-choices-container__incorrect-answer-icon"
107
+ type="incorrect"
108
+ />
109
+ </div>
110
+ </template>
111
+ <template
112
+ v-if="
113
+ question.type === 'Matrix Radio Button' &&
114
+ matrixRadioGrid &&
115
+ matrixRadioGrid[rowIndex]"
116
+ >
117
+ <MatrixRadioGroup
118
+ :modelValue="getRadioRowSelection(rowIndex)"
119
+ :review-mode="reviewMode"
120
+ :show-answers="showMatrixAnswers"
121
+ class="uikit-question-matrix-choices-container__radio-btns"
122
+ :choices="getRadioRowChoices(rowIndex)"
123
+ :is-dark-mode="isDarkMode"
124
+ :disabled="false"
125
+ :question-el="questionEl"
126
+ :breakpoints="breakpoints"
127
+ @update:modelValue="updateRadioRowSelection(rowIndex, $event)"
128
+ >
129
+ <template #optionIcon="{ optionIcon }">
130
+ <template v-if="optionIcon.isVisible">
131
+ <Icon
132
+ v-if="optionIcon.isCorrect"
133
+ type="correct"
134
+ class="uikit-question-matrix-choices-container__correct-answer-icon"
135
+ />
136
+ <Icon
137
+ v-else
138
+ type="incorrect"
139
+ class="uikit-question-matrix-choices-container__incorrect-answer-icon"
140
+ />
141
+ </template>
142
+ </template>
143
+ </MatrixRadioGroup>
144
+ </template>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ </template>
149
+
150
+ <script lang="ts">
151
+ import { Component, Vue, Prop, Emit, Watch } from 'vue-facing-decorator'
152
+ import Icon from '../../Icons/Icon.vue'
153
+ import PocketButton from '../../Buttons/Button.vue'
154
+ import Checkbox from '../../Forms/Checkbox.vue'
155
+ import MatrixRadioGroup from './MatrixRadioGroup.vue'
156
+ import { dark, breakpoint } from '../../../directives'
157
+ import type { TBreakPointsObject, IRadioOptions, TMatrixChoiceKey } from './../question'
158
+ import type { Study } from '@pocketprep/types'
159
+ import BrandColors from '../../../pocketprep-export.module.scss'
160
+
161
+ @Component({
162
+ components: {
163
+ Icon,
164
+ Checkbox,
165
+ MatrixRadioGroup,
166
+ PocketButton,
167
+ },
168
+ directives: {
169
+ dark,
170
+ breakpoint,
171
+ },
172
+ })
173
+ export default class MatrixChoicesContainer extends Vue {
174
+ @Prop({ default: false }) reviewMode!: boolean
175
+ @Prop({ default: false }) isDarkMode!: boolean
176
+ @Prop({ default: null }) questionEl!: Element | null
177
+ @Prop({ default: {
178
+ 'mobile': 767,
179
+ 'tablet-portrait': 1023,
180
+ 'tablet-landscape': 1439,
181
+ } }) breakpoints!: TBreakPointsObject
182
+ @Prop() question!: Study.Class.QuestionJSON
183
+ @Prop() matrixChoiceLayout!: string[][]
184
+ @Prop({ default: false }) showMatrixAnswers!: boolean
185
+ @Prop({ default: false }) isUnanswered!: boolean
186
+ @Prop({ default: false }) isMatrixQuestionCorrect!: boolean
187
+ @Prop() matrixAnswerKeys!: TMatrixChoiceKey[]
188
+ @Prop() matrixDistractorKeys!: TMatrixChoiceKey[]
189
+ @Prop() selectedMatrixChoices!: TMatrixChoiceKey[]
190
+
191
+ matrixCheckboxGrid: boolean[][] | undefined = undefined
192
+ matrixRadioGrid: IRadioOptions[] | undefined = undefined
193
+ columnIndex = 0
194
+ rowIndex = 0
195
+ brandColors = BrandColors
196
+
197
+ get defaultCheckboxGrid () {
198
+ return this.matrixChoiceLayout?.map(row => {
199
+ const choiceRow = row.map(() => false)
200
+ return choiceRow
201
+ })
202
+ }
203
+
204
+ get defaultRadioButtonGrid () {
205
+ return this.matrixChoiceLayout?.map(row => {
206
+ return {
207
+ choices: row as TMatrixChoiceKey[],
208
+ value: null,
209
+ }
210
+ })
211
+ }
212
+
213
+ get matrixRowLabels () {
214
+ return this.question.matrixLabels?.rows
215
+ }
216
+
217
+ get matrixColumnLabels () {
218
+ return this.question.matrixLabels?.columns
219
+ }
220
+
221
+ get numberOfMatrixColumnLabels () {
222
+ return this.question.matrixLabels?.columns.length || 0
223
+ }
224
+
225
+ get matrixColumnLabelsForRows () {
226
+ return this.question.matrixLabels?.columnLabelForRows
227
+ }
228
+
229
+ mounted () {
230
+ if (this.question.type === 'Matrix Checkbox') {
231
+ this.matrixCheckboxGrid = this.defaultCheckboxGrid
232
+ }
233
+
234
+ if (this.question.type === 'Matrix Radio Button') {
235
+ this.matrixRadioGrid = this.defaultRadioButtonGrid
236
+ }
237
+ }
238
+
239
+ convertSelectedMatrixChoiceToCheckboxGrid () {
240
+ const checkboxGrid = this.defaultCheckboxGrid
241
+ this.selectedMatrixChoices.forEach(choice => {
242
+ const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
243
+ const colIndex = Number(choice.split('_').pop()) - 1
244
+ if (checkboxGrid && checkboxGrid[rowIndex]) {
245
+ checkboxGrid[rowIndex][colIndex] = true
246
+ }
247
+ })
248
+ return checkboxGrid
249
+ }
250
+
251
+ convertSelectedMatrixChoiceToRadioBtnGrid () {
252
+ const radioBtnGrid = this.matrixRadioGrid
253
+ this.selectedMatrixChoices.forEach(choice => {
254
+ const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
255
+ if (radioBtnGrid && radioBtnGrid[rowIndex]) {
256
+ radioBtnGrid[rowIndex].value = choice
257
+ }
258
+ })
259
+ return radioBtnGrid
260
+ }
261
+
262
+ getRadioRowSelection (rowIndex: number) {
263
+ return this.matrixRadioGrid?.[rowIndex]?.value
264
+ }
265
+
266
+ getRadioRowChoices (rowIndex: number) {
267
+ const choices = this.matrixRadioGrid?.[rowIndex]?.choices
268
+ return choices
269
+ }
270
+
271
+ updateRadioRowSelection (rowIndex: number, choiceKey: TMatrixChoiceKey) {
272
+ const row = this.matrixRadioGrid?.[rowIndex]
273
+ if (row) {
274
+ row.value = choiceKey
275
+ }
276
+ }
277
+
278
+ selectedChoiceKey (rowIndex: number, colIndex: number) {
279
+ const row = rowIndex += 1
280
+ const column = colIndex += 1
281
+ if (this.selectedMatrixChoices && this.matrixAnswerKeys) {
282
+ const matrixSelectedChoiceKey = this.selectedMatrixChoices.find((choice) => {
283
+ const substring = choice.substring(1)
284
+ return substring === `${row}_${column}`
285
+ })
286
+ return matrixSelectedChoiceKey
287
+ }
288
+ return undefined
289
+ }
290
+
291
+ correctlySelectedChoice (rowIndex: number, colIndex: number) {
292
+ if (this.selectedMatrixChoices && this.matrixAnswerKeys) {
293
+ const selectedChoice = this.selectedChoiceKey(rowIndex, colIndex)
294
+ if (selectedChoice && selectedChoice.startsWith('a') && this.matrixAnswerKeys.includes(selectedChoice)) {
295
+ return true
296
+ }
297
+ }
298
+ return false
299
+ }
300
+
301
+ incorrectlySelectedChoice (rowIndex: number, colIndex: number) {
302
+ if (this.selectedMatrixChoices && this.matrixAnswerKeys) {
303
+ const selectedChoice = this.selectedChoiceKey(rowIndex, colIndex)
304
+ if (selectedChoice && selectedChoice.startsWith('d')) {
305
+ return true
306
+ }
307
+ }
308
+ return false
309
+ }
310
+
311
+ correctAnswerButNotSelected (rowIndex: number, colIndex: number) {
312
+ const selectedChoice = this.selectedChoiceKey(rowIndex, colIndex)
313
+ const answerKey = this.matrixAnswerKeys.find(choice => choice === `a${rowIndex + 1}_${colIndex + 1}`)
314
+ return answerKey && !selectedChoice
315
+ }
316
+
317
+ checkboxContainerStyling (rowIndex: number, columnIndex: number) {
318
+ const isReviewMode = this.showMatrixAnswers || this.reviewMode
319
+ const incorrectlySelectedChoice = this.incorrectlySelectedChoice(rowIndex, columnIndex)
320
+
321
+ // check box is correctlySelected
322
+ if (isReviewMode && this.correctlySelectedChoice(rowIndex, columnIndex)) {
323
+ const borderColor = this.isDarkMode ? this.brandColors.jungleGreen : this.brandColors.cadaverous
324
+ return {
325
+ borderColor: `${borderColor} !important`,
326
+ background: `${borderColor} !important`,
327
+ }
328
+ }
329
+
330
+ if (isReviewMode && incorrectlySelectedChoice) {
331
+ return {
332
+ background: `${this.brandColors.steel} !important`,
333
+ border: `1px solid ${this.brandColors.steel} !important`,
334
+ }
335
+ }
336
+ }
337
+
338
+ checkboxCheckStyling (rowIndex: number, columnIndex: number) {
339
+ const isReviewMode = this.showMatrixAnswers || this.reviewMode
340
+ if (isReviewMode && this.correctAnswerButNotSelected(rowIndex, columnIndex)) {
341
+ const color = this.isDarkMode ? this.brandColors.jungleGreen : this.brandColors.cadaverous
342
+ return {
343
+ color: `${color} !important`,
344
+ }
345
+ }
346
+ }
347
+
348
+ @Emit('emitSelectedMatrixChoice')
349
+ emitSelectedMatrixChoice (matrixChoiceKeys: TMatrixChoiceKey[]) {
350
+ return matrixChoiceKeys
351
+ }
352
+
353
+ @Emit('emitAnsweredMatrixRowIndex')
354
+ emitAnsweredMatrixRowIndex (answeredRowIndexes: number[]) {
355
+ return answeredRowIndexes
356
+ }
357
+
358
+ @Watch('matrixCheckboxGrid', { deep: true })
359
+ matrixCheckboxGridChange () {
360
+ if (this.matrixChoiceLayout && this.matrixCheckboxGrid) {
361
+ const selectedCheckboxChoices: TMatrixChoiceKey[] = []
362
+ const answeredCheckBoxRowIndexes: number[] = []
363
+
364
+ this.matrixCheckboxGrid.forEach((row, rowIndex) => {
365
+ row.forEach((choice, choiceIndex) => {
366
+ if (
367
+ choice &&
368
+ this.matrixChoiceLayout[rowIndex] &&
369
+ this.matrixChoiceLayout[rowIndex][choiceIndex]
370
+ ) {
371
+ const choiceKey = this.matrixChoiceLayout[rowIndex][choiceIndex] as TMatrixChoiceKey
372
+ selectedCheckboxChoices.push(choiceKey)
373
+ if (!answeredCheckBoxRowIndexes.some(index => index === rowIndex)) {
374
+ answeredCheckBoxRowIndexes.push(rowIndex)
375
+ }
376
+ }
377
+ })
378
+ })
379
+ this.emitSelectedMatrixChoice(selectedCheckboxChoices)
380
+ this.emitAnsweredMatrixRowIndex(answeredCheckBoxRowIndexes)
381
+ }
382
+ }
383
+
384
+ @Watch('matrixRadioGrid', { deep: true })
385
+ matrixRadioGridChange () {
386
+ if (this.matrixChoiceLayout && this.matrixRadioGrid) {
387
+ const selectedRadioButtonChoices: TMatrixChoiceKey[] = []
388
+ const answeredRadioBtnRowIndexes: number[] = []
389
+
390
+ this.matrixRadioGrid.forEach((row, rowIndex) => {
391
+ const choiceKey = row.value
392
+ if (choiceKey && this.matrixChoiceLayout[rowIndex]) {
393
+ selectedRadioButtonChoices.push(choiceKey)
394
+ if (!answeredRadioBtnRowIndexes.some(index => index === rowIndex)) {
395
+ answeredRadioBtnRowIndexes.push(rowIndex)
396
+ }
397
+ this.emitAnsweredMatrixRowIndex(answeredRadioBtnRowIndexes)
398
+ }
399
+ })
400
+ this.emitSelectedMatrixChoice(selectedRadioButtonChoices)
401
+ }
402
+ }
403
+
404
+ @Watch('selectedMatrixChoices')
405
+ selectedMatrixChoicesChange () {
406
+ if ((this.reviewMode || this.showMatrixAnswers) && this.question.type === 'Matrix Checkbox') {
407
+ const selectedCheckboxGrid = this.convertSelectedMatrixChoiceToCheckboxGrid()
408
+ this.matrixCheckboxGrid = selectedCheckboxGrid ? selectedCheckboxGrid : this.defaultCheckboxGrid
409
+ }
410
+
411
+ if ((this.reviewMode || this.showMatrixAnswers) && this.question.type === 'Matrix Radio Button') {
412
+ const selectedRadioBtnGrid = this.convertSelectedMatrixChoiceToRadioBtnGrid()
413
+ this.matrixRadioGrid = selectedRadioBtnGrid
414
+ }
415
+ }
416
+ }
417
+
418
+ </script>
419
+
420
+ <style lang="scss">
421
+ @import '../../../styles/colors';
422
+ @import '../../../styles/breakpoints';
423
+
424
+ .uikit-question-matrix-choices-container {
425
+ width: 100%;
426
+ &__columns {
427
+ display: flex;
428
+ padding: 0px 1px 0px 14px;
429
+ align-items: center;
430
+ width: 100%;
431
+ height: 32px;
432
+ margin-bottom: 16px;
433
+ color: $brand-black;
434
+ font-size: 12px;
435
+ line-height: 16px;
436
+
437
+ &--dark {
438
+ color: $white;
439
+ }
440
+
441
+ &--mobile {
442
+ display: none;
443
+ }
444
+ }
445
+
446
+ &__column-row-header {
447
+ width: 284px;
448
+
449
+ &--tablet-landscape {
450
+ width: 285px;
451
+ }
452
+
453
+ &--tablet-portrait {
454
+ width: 275px;
455
+ }
456
+
457
+ &--two-columns {
458
+ width: 303px;
459
+ }
460
+ }
461
+
462
+ &__column-header {
463
+ width: 56px;
464
+ hyphens: auto;
465
+
466
+ &:not(:last-child) {
467
+ margin-right: 8px;
468
+ }
469
+
470
+ &--tablet-landscape {
471
+ &:not(:last-child) {
472
+ margin-right: 10px;
473
+ }
474
+ }
475
+
476
+ &--two-columns {
477
+ &:not(:last-child) {
478
+ margin-right: 24px;
479
+ }
480
+ }
481
+ }
482
+
483
+ &__choices-container {
484
+ cursor: default;
485
+ position: relative;
486
+ outline: none;
487
+ transition: 0.1s width ease;
488
+
489
+ &::after {
490
+ content: '';
491
+ position: absolute;
492
+ top: -8px;
493
+ bottom: -8px;
494
+ left: -8px;
495
+ right: -8px;
496
+ border-radius: 11px;
497
+ pointer-events: none;
498
+ }
499
+
500
+ &--incorrect {
501
+ &::after {
502
+ display: block;
503
+ border: 2px solid $pepper;
504
+ }
505
+
506
+ &--dark::after {
507
+ border-color: $rosa;
508
+ }
509
+ }
510
+
511
+ &--correct {
512
+ &::after {
513
+ display: block;
514
+ border: 2px solid $cadaverous;
515
+ }
516
+
517
+ &--dark::after {
518
+ border-color: $jungle-green;
519
+ }
520
+ }
521
+
522
+ &--mobile {
523
+ display: none;
524
+ }
525
+ }
526
+
527
+ &__choices {
528
+ border-radius: 5px;
529
+ border: 1px solid rgba($pewter, 0.85);
530
+ background: $white;
531
+ box-shadow: 0px 1px 4px 0px rgba(71, 89, 103, 0.30);
532
+ display: flex;
533
+ padding: 12px 10px 12px 14px;
534
+ position: relative;
535
+ transition: 0.1s padding ease;
536
+ align-items: center;
537
+ gap: 16px;
538
+ margin-bottom: 9px;
539
+
540
+ &--two-columns {
541
+ gap: 0;
542
+ }
543
+
544
+ &--dark {
545
+ border: 1px solid rgba(136, 163, 182, 0.85);
546
+ background: $brand-black;
547
+ }
548
+
549
+ &--mobile {
550
+ display: none;
551
+ }
552
+ }
553
+
554
+ &__choice-text {
555
+ width: 303px;
556
+ min-height: fit-content;
557
+ color: $brand-black;
558
+ font-size: 16.5px;
559
+ font-weight: 500;
560
+ line-height: 23px;
561
+ letter-spacing: -0.1px;
562
+
563
+ &--two-columns {
564
+ width: 279px;
565
+ margin-right: 24px;
566
+ }
567
+
568
+ &--dark {
569
+ color: $barely-background;
570
+ }
571
+
572
+ &--tablet-portrait {
573
+ width: 279px;
574
+ }
575
+
576
+ &--mobile {
577
+ font-size: 16px;
578
+ font-weight: 600;
579
+ }
580
+ }
581
+
582
+ &__mobile-choices {
583
+ margin-bottom: 9px;
584
+ }
585
+
586
+ &__checkbox {
587
+ width: 56px;
588
+ display: flex;
589
+ align-items: center;
590
+
591
+ &--two-columns {
592
+ width: 80px;
593
+ }
594
+
595
+ .uikit-checkbox--disabled {
596
+ background: transparent;
597
+ }
598
+ }
599
+
600
+ &__correct-answer-icon {
601
+ margin-left: 6px;
602
+ width: 21px;
603
+ height: 22px;
604
+ color: $cadaverous;
605
+ }
606
+
607
+ &__incorrect-answer-icon {
608
+ margin-left: 6px;
609
+ width: 21px;
610
+ height: 22px;
611
+ color: $pepper;
612
+ }
613
+ }
614
+ </style>
@@ -0,0 +1,98 @@
1
+ <script setup lang="ts">
2
+ import RadioButton from '../../Forms/RadioButton.vue'
3
+ import { dark as vDark } from '../../../directives'
4
+
5
+ defineProps<{
6
+ isDarkMode: boolean
7
+ choices: string[]
8
+ labels?: string[]
9
+ showAnswers: boolean
10
+ disabled: boolean
11
+ }>()
12
+
13
+ const selectedChoice = defineModel<string>()
14
+
15
+ const selectChoice = (choiceKey: string) => {
16
+ selectedChoice.value = choiceKey
17
+ }
18
+ </script>
19
+
20
+ <template>
21
+ <ul
22
+ v-if="choices.length"
23
+ class="uikit-matrix-radio-group"
24
+ v-dark="isDarkMode"
25
+ role="radiogroup"
26
+ >
27
+ <li
28
+ class="uikit-matrix-radio-group__option"
29
+ :class="{
30
+ 'uikit-matrix-radio-group__option--two-options':
31
+ choices.length === 2
32
+ }"
33
+ v-dark="isDarkMode"
34
+ role="radio"
35
+ v-for="(choice) in choices"
36
+ :key="choice"
37
+ >
38
+ <RadioButton
39
+ class="uikit-matrix-radio-group__radio-btn"
40
+ :selected="choice === selectedChoice"
41
+ :disabled="disabled"
42
+ :isDarkMode="isDarkMode"
43
+ :color="showAnswers
44
+ ? selectedChoice?.startsWith('a')
45
+ ? 'green'
46
+ : 'gray'
47
+ : 'blue'
48
+ "
49
+ @click="!disabled && !showAnswers && selectChoice(choice)"
50
+ />
51
+ <div class="uikit-matrix-radio-group__option-icon">
52
+ <slot
53
+ name="optionIcon"
54
+ :optionIcon="{
55
+ isVisible: showAnswers
56
+ && !selectedChoice?.startsWith('a')
57
+ && (
58
+ choice.startsWith('a')
59
+ || (choice === selectedChoice)
60
+ ),
61
+ isCorrect: choice.startsWith('a')
62
+ }"
63
+ />
64
+ </div>
65
+ </li>
66
+ </ul>
67
+ </template>
68
+
69
+ <style lang="scss" scoped>
70
+ @import '../../../styles/breakpoints';
71
+ @import '../../../styles/colors';
72
+
73
+ .uikit-matrix-radio-group {
74
+ display: flex;
75
+ list-style: none;
76
+ margin: 0;
77
+ padding: 0;
78
+
79
+ &__option {
80
+ display: flex;
81
+ align-items: center;
82
+ width: 72px;
83
+
84
+ &--two-options {
85
+ width: 80px;
86
+ }
87
+
88
+ &:last-child {
89
+ width: 59px;
90
+ }
91
+ }
92
+
93
+ &__option-icon {
94
+ display: flex;
95
+ align-items: center;
96
+ }
97
+ }
98
+ </style>