@pocketprep/ui-kit 3.4.7 → 3.4.9

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,987 @@
1
+ <template>
2
+ <div
3
+ class="uikit-question-choices-container"
4
+ v-for="(choice, index) in choices"
5
+ :key="choice.key"
6
+ ref="uikit-question-choices-container"
7
+ >
8
+ <div
9
+ ref="choices"
10
+ v-dark="isDarkMode"
11
+ class="uikit-question-choices-container__choice-container"
12
+ :class="{
13
+ 'uikit-question-choices-container__choice-container--hover':
14
+ !showAnswers && hoverChoiceKey === choice.key,
15
+ 'uikit-question-choices-container__choice-container--focus':
16
+ !showAnswers && focusChoiceKey === choice.key,
17
+ 'uikit-question-choices-container__choice-container--selected': !showAnswers
18
+ && selectedChoices.includes(choice.key),
19
+ 'uikit-question-choices-container__choice-container--correct':
20
+ !isMCR && showAnswers && !isUnanswered && answerKeys.includes(choice.key),
21
+ 'uikit-question-choices-container__choice-container--incorrect': !isMCR && showAnswers
22
+ && selectedChoices.includes(choice.key)
23
+ && distractorKeys.includes(choice.key),
24
+ 'uikit-question-choices-container__choice-container--big': !isMCR && !globalMetrics && (
25
+ showAnswers && !isUnanswered
26
+ ? answerKeys.includes(choice.key)
27
+ : selectedChoices.includes(choice.key)
28
+ ),
29
+ }"
30
+ @mousedown.prevent
31
+ @mouseover="emitChoiceMouseOver(choice.key)"
32
+ @mouseleave="emitChoiceMouseLeave"
33
+ @focusin="emitChoiceFocusIn(choice.key)"
34
+ @focusout="emitChoiceFocusOut($event)"
35
+ @click.stop="emitSelectedChoice(choice.key)"
36
+ @keydown.enter.stop="emitSelectedChoice(choice.key)"
37
+ @touchstart="emitHandleTouchStart($event)"
38
+ @touchmove="emitHandleTouchMove($event)"
39
+ @touchend="emitHandleTouchEnd(choice.key, $event)"
40
+ >
41
+ <div
42
+ v-if="!reviewMode"
43
+ v-breakpoint:questionEl="breakpoints"
44
+ v-dark="isDarkMode"
45
+ class="uikit-question-choices-container__choice-letter"
46
+ :class="!isMCR && {
47
+ 'uikit-question-choices-container__choice-letter--selected': selectedChoices.includes(choice.key),
48
+ 'uikit-question-choices-container__choice-letter--correct': showAnswers
49
+ && answerKeys.includes(choice.key),
50
+ 'uikit-question-choices-container__choice-letter--incorrect': showAnswers
51
+ && selectedChoices.includes(choice.key)
52
+ && distractorKeys.includes(choice.key),
53
+ 'uikit-question-choices-container__choice-letter--big': !globalMetrics && (showAnswers
54
+ ? answerKeys.includes(choice.key)
55
+ : selectedChoices.includes(choice.key)),
56
+ }"
57
+ >
58
+ {{ String.fromCharCode(index + 65) }}
59
+ </div>
60
+ <div
61
+ :ref="`choice-${choice.key}`"
62
+ v-dark="isDarkMode"
63
+ v-breakpoint:questionEl="breakpoints"
64
+ class="uikit-question-choices-container__choice"
65
+ :class="{
66
+ 'uikit-question-choices-container__choice--strike': showAnswers
67
+ ? isMCR
68
+ ? distractorKeys.includes(choice.key)
69
+ : choiceStrikes.includes(choice.key) && !answerKeys.includes(choice.key)
70
+ : choiceStrikes.includes(choice.key),
71
+ 'uikit-question-choices-container__choice--big': !isMCR && !globalMetrics && (
72
+ showAnswers && !isUnanswered
73
+ ? answerKeys.includes(choice.key)
74
+ : selectedChoices.includes(choice.key)
75
+ ),
76
+ 'uikit-question-choices-container__choice--mcr': isMCR,
77
+ 'uikit-question-choices-container__choice--selected': !showAnswers &&
78
+ selectedChoices.includes(choice.key),
79
+ 'uikit-question-choices-container__choice--distractor': showAnswers
80
+ && distractorKeys.includes(choice.key),
81
+ 'uikit-question-choices-container__choice--show-stats': globalMetrics,
82
+ 'uikit-question-choices-container__choice--review-mode': reviewMode,
83
+ }"
84
+ >
85
+ <div
86
+ v-if="isMCR"
87
+ v-dark="isDarkMode"
88
+ class="uikit-question-choices-container__mcr-checkbox"
89
+ :class="{
90
+ 'uikit-question-choices-container__mcr-checkbox--selected':
91
+ selectedChoices.includes(choice.key),
92
+ 'uikit-question-choices-container__mcr-checkbox--answer': showAnswers
93
+ && answerKeys.includes(choice.key),
94
+ 'uikit-question-choices-container__mcr-checkbox--distractor': showAnswers
95
+ && distractorKeys.includes(choice.key),
96
+ 'uikit-question-choices-container__mcr-checkbox--strike': !showAnswers
97
+ && choiceStrikes.includes(choice.key),
98
+ }"
99
+ >
100
+ <Icon
101
+ v-if="selectedChoices.includes(choice.key) || (
102
+ showAnswers && answerKeys.includes(choice.key)
103
+ )"
104
+ class="uikit-question-choices-container__mcr-check"
105
+ type="check"
106
+ />
107
+ </div>
108
+ <div
109
+ class="uikit-question-choices-container__choice-text"
110
+ :tabindex="showAnswers ? -1 : 0"
111
+ :role="isMCR
112
+ ? 'checkbox'
113
+ : 'radio'
114
+ "
115
+ :aria-checked="selectedChoices.includes(choice.key) ? 'true' : 'false'"
116
+ :aria-label="`${
117
+ showAnswers
118
+ ? answerKeys.includes(choice.key)
119
+ ? 'Correct Answer, '
120
+ : 'Incorrect Answer, '
121
+ : ''
122
+ }${ stripText(choice.text) }`"
123
+ v-html="choice.text"
124
+ />
125
+ <PocketButton
126
+ v-if="!isMCR && showAnswers && answerKeys.includes(choice.key)"
127
+ v-breakpoint:questionEl="breakpoints"
128
+ type="tertiary-small"
129
+ class="uikit-question-choices-container__toggle-explanation"
130
+ :class="{ 'uikit-question-choices-container__toggle-explanation--review-mode': reviewMode }"
131
+ :is-dark-mode="isDarkMode"
132
+ :aria-expanded="showExplanation ? 'true' : 'false'"
133
+ @click.stop="toggleChoiceExplanation"
134
+ @mousedown.prevent
135
+ >
136
+ <span
137
+ ref="uikit-question-choices-container__toggle-explanation-text"
138
+ class="uikit-question-choices-container__toggle-explanation-text"
139
+ tabindex="-1"
140
+ >{{ showExplanation ? 'Hide' : 'Show' }} Explanation</span>
141
+ <Icon
142
+ v-breakpoint:questionEl="breakpoints"
143
+ class="uikit-question-choices-container__toggle-explanation-icon"
144
+ :class="{
145
+ 'uikit-question-choices-container__toggle-explanation-icon--up': showExplanation,
146
+ }"
147
+ type="accordionArrow"
148
+ />
149
+ </PocketButton>
150
+ <DropdownExplanation
151
+ v-if="!isMCR && showAnswers && answerKeys.includes(choice.key) && showExplanation"
152
+ ref="uikit-question-choices-container__dropdown-explanation"
153
+ class="uikit-question-choices-container__dropdown-explanation"
154
+ :question="question"
155
+ :answer-keys="answerKeys"
156
+ :choice="choice"
157
+ :global-metrics="globalMetrics"
158
+ :show-answers="showAnswers"
159
+ :is-MCR="isMCR"
160
+ :show-explanation-image-long-alt="showExplanationImageLongAlt"
161
+ :explanation-image-url="explanationImageUrl"
162
+ :explanation-image-alt="explanationImageAlt"
163
+ :explanation-image-long-alt="explanationImageLongAlt"
164
+ :reference="reference"
165
+ :hide-references="hideReferences"
166
+ :is-dark-mode="isDarkMode"
167
+ :question-el="questionEl"
168
+ :breakpoints="breakpoints"
169
+ @toggleDropdownExplanationImageLongAlt="toggleDropdownExplanationImageLongAlt"
170
+ />
171
+ </div>
172
+ <template v-if="!globalMetrics">
173
+ <div
174
+ v-if="!showAnswers"
175
+ v-breakpoint:questionEl="breakpoints"
176
+ v-dark="isDarkMode"
177
+ :tabindex="showAnswers ? -1 : 0"
178
+ class="uikit-question-choices-container__strikethrough"
179
+ aria-label="Strikethrough"
180
+ role="switch"
181
+ :aria-checked="choiceStrikes.includes(choice.key) ? 'true' : 'false'"
182
+ :class="{
183
+ 'uikit-question-choices-container__strikethrough--visible': !showAnswers
184
+ && [ hoverChoiceKey, focusChoiceKey ].includes(choice.key),
185
+ 'uikit-question-choices-container__strikethrough--active': choiceStrikes.includes(choice.key),
186
+ }"
187
+ @mousedown.prevent
188
+ @click.stop="emitClickChoiceStrike(choice.key)"
189
+ @keydown.enter.stop="emitClickChoiceStrike(choice.key)"
190
+ >
191
+ <Icon type="strike" />
192
+ </div>
193
+ <Icon
194
+ v-if="!isMCR
195
+ && showAnswers
196
+ && answerKeys.includes(choice.key)
197
+ && (isCorrect || isUnanswered)
198
+ "
199
+ v-dark="isDarkMode"
200
+ type="correct"
201
+ class="uikit-question-choices-container__correct-icon"
202
+ :class="{
203
+ 'uikit-question-choices-container__correct-icon--review-mode': reviewMode,
204
+ }"
205
+ />
206
+ <Icon
207
+ v-if="showAnswers && (
208
+ (
209
+ selectedChoices.includes(choice.key)
210
+ && distractorKeys.includes(choice.key)
211
+ ) || (
212
+ isMCR
213
+ && !selectedChoices.includes(choice.key)
214
+ && answerKeys.includes(choice.key)
215
+ )
216
+ )"
217
+ v-dark="isDarkMode"
218
+ type="incorrect"
219
+ class="uikit-question-choices-container__incorrect-icon"
220
+ :class="{
221
+ 'uikit-question-choices-container__incorrect-icon--mcr': isMCR,
222
+ }"
223
+ />
224
+ </template>
225
+ <template v-else>
226
+ <div
227
+ v-dark="isDarkMode"
228
+ class="uikit-question-choices-container__choice-stats-pct"
229
+ >
230
+ {{ choiceScores[choice.key] }} %
231
+ </div>
232
+ <div v-dark="isDarkMode" class="uikit-question-choices-container__choice-stats-bar">
233
+ <div
234
+ v-dark="isDarkMode"
235
+ class="uikit-question-choices-container__choice-stats-bar-fill"
236
+ :class="{
237
+ 'uikit-question-choices-container__choice-stats-bar-fill--correct': showAnswers
238
+ && answerKeys.includes(choice.key),
239
+ 'uikit-question-choices-container__choice-stats-bar-fill--incorrect': showAnswers
240
+ && distractorKeys.includes(choice.key)
241
+ && selectedChoices.includes(choice.key),
242
+ }"
243
+ :style="{
244
+ 'width': `${(choiceScores[choice.key]) || 0}%`
245
+ }"
246
+ />
247
+ </div>
248
+ </template>
249
+ <div
250
+ v-breakpoint:questionEl="breakpoints"
251
+ class="uikit-question-choices-container__motivational-moment"
252
+ :class="{
253
+ 'uikit-question-choices-container__motivational-moment--mcr': isMCR,
254
+ 'uikit-question-choices-container__motivational-moment--explanation': showExplanation,
255
+ 'uikit-question-choices-container__motivational-moment--passage-and-image': question.passage
256
+ || passageImageUrl,
257
+ }"
258
+ >
259
+ <slot
260
+ name="motivationalMoment"
261
+ :showAnswers="showAnswers"
262
+ :answerKeys="answerKeys"
263
+ :choiceKey="choice.key"
264
+ :isCorrect="isCorrect"
265
+ />
266
+ </div>
267
+ </div>
268
+ <slot
269
+ name="showNamesTable"
270
+ :choiceKey="choice.key"
271
+ />
272
+ </div>
273
+ </template>
274
+
275
+ <script lang="ts">
276
+ import { Component, Vue, Prop, Emit } from 'vue-facing-decorator'
277
+ import type { Study } from '@pocketprep/types'
278
+ import DropdownExplanation from './DropdownExplanation.vue'
279
+ import Icon from '../../Icons/Icon.vue'
280
+ import PocketButton from '../../Buttons/Button.vue'
281
+ import { dark, breakpoint } from '../../../directives'
282
+ import type { TBreakPointsObject, TChoice, TChoiceKey, TChoiceScores } from './../question'
283
+
284
+ @Component({
285
+ components: {
286
+ Icon,
287
+ PocketButton,
288
+ DropdownExplanation,
289
+ },
290
+ directives: {
291
+ dark,
292
+ breakpoint,
293
+ },
294
+ })
295
+ export default class ChoicesContainer extends Vue {
296
+ @Prop() question!: Study.Class.QuestionJSON
297
+ @Prop({ default: [] }) choices!: TChoice[]
298
+ @Prop({ default: false }) showAnswers!: boolean
299
+ @Prop({ default: false }) showExplanation!: boolean
300
+ @Prop({ default: false }) isMCR!: boolean
301
+ @Prop({ default: false }) isUnanswered!: boolean
302
+ @Prop({ default: [] }) answerKeys!: TChoiceKey[]
303
+ @Prop({ default: null }) hoverChoiceKey!: TChoiceKey | null
304
+ @Prop({ default: null }) focusChoiceKey!: TChoiceKey | null
305
+ @Prop({ default: [] }) selectedChoices!: TChoiceKey[]
306
+ @Prop({ default: [] }) distractorKeys!: TChoiceKey[]
307
+ @Prop({ default: [] }) choiceStrikes!: TChoiceKey[]
308
+ @Prop() choiceScores!: TChoiceScores
309
+ @Prop({ default: null }) passageImageUrl!: string | null
310
+ @Prop({ default: false }) isCorrect!: boolean
311
+ @Prop({ default: null }) globalMetrics!: Study.Class.GlobalQuestionMetricJSON | null
312
+ @Prop({ default: false }) reviewMode!: boolean
313
+ @Prop({ default: false }) showExplanationImageLongAlt!: boolean
314
+ @Prop({ default: null }) explanationImageUrl!: string | null
315
+ @Prop({ default: undefined }) explanationImageAlt!: string | undefined
316
+ @Prop({ default: undefined }) explanationImageLongAlt!: string | undefined
317
+ @Prop({ default: undefined }) reference!: string | undefined
318
+ @Prop({ default: false }) hideReferences!: boolean
319
+ @Prop({ default: false }) isDarkMode!: boolean
320
+ @Prop({ default: null }) questionEl!: Element | null
321
+ @Prop({ default: {
322
+ 'mobile': 767,
323
+ 'tablet-portrait': 1023,
324
+ 'tablet-landscape': 1439,
325
+ } }) breakpoints!: TBreakPointsObject
326
+
327
+ stripText (string?: string) {
328
+ return string?.replace(/<[^\s>]+[^>]*>/gi, ' ').trim()
329
+ }
330
+
331
+
332
+ @Emit('emitChoiceFocusIn')
333
+ emitChoiceFocusIn (choiceKey: TChoiceKey) {
334
+ return choiceKey
335
+ }
336
+
337
+ @Emit('emitChoiceFocusOut')
338
+ emitChoiceFocusOut (event: FocusEvent) {
339
+ return event
340
+ }
341
+
342
+ @Emit('emitChoiceMouseOver')
343
+ emitChoiceMouseOver (choiceKey: TChoiceKey) {
344
+ return choiceKey
345
+ }
346
+
347
+ @Emit('emitChoiceMouseLeave')
348
+ emitChoiceMouseLeave () {
349
+ return
350
+ }
351
+
352
+ @Emit('emitHandleTouchStart')
353
+ emitHandleTouchStart (event: TouchEvent) {
354
+ return event
355
+ }
356
+
357
+ @Emit('emitHandleTouchMove')
358
+ emitHandleTouchMove (event: TouchEvent) {
359
+ return event
360
+ }
361
+
362
+ @Emit('emitHandleTouchEnd')
363
+ emitHandleTouchEnd (choiceKey: TChoiceKey, event: TouchEvent) {
364
+ return { choiceKey, event }
365
+ }
366
+
367
+ @Emit('emitSelectedChoice')
368
+ emitSelectedChoice (choiceKey: TChoiceKey) {
369
+ return choiceKey
370
+ }
371
+
372
+ @Emit('emitClickChoiceStrike')
373
+ emitClickChoiceStrike (choiceKey: TChoiceKey) {
374
+ return choiceKey
375
+ }
376
+
377
+ @Emit('toggleChoiceExplanation')
378
+ toggleChoiceExplanation () {
379
+ return
380
+ }
381
+
382
+ @Emit('toggleDropdownExplanationImageLongAlt')
383
+ toggleDropdownExplanationImageLongAlt () {
384
+ return
385
+ }
386
+ }
387
+ </script>
388
+
389
+ <style lang="scss">
390
+ @import '../../../styles/colors';
391
+ @import '../../../styles/breakpoints';
392
+
393
+ .uikit-question-choices-container {
394
+ display: contents;
395
+
396
+ &:not(:last-child) .uikit-question-choices-container__choice-container {
397
+ margin-bottom: 9px;
398
+ }
399
+
400
+ &__choice-container {
401
+ display: flex;
402
+ align-items: center;
403
+ width: 100%;
404
+ border-radius: 6px;
405
+ cursor: default;
406
+ position: relative;
407
+ outline: none;
408
+ transition: 0.1s width ease;
409
+
410
+ &::after {
411
+ content: '';
412
+ position: absolute;
413
+ top: -1px;
414
+ bottom: -1px;
415
+ left: -1px;
416
+ right: -1px;
417
+ border: 1px solid rgba($pewter, 0.85);
418
+ box-shadow: 0 1px 4px 0 rgba($ash, 0.3);
419
+ border-radius: 6px;
420
+ pointer-events: none;
421
+ }
422
+
423
+ &--dark {
424
+ &::after {
425
+ border-color: $slate;
426
+ box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
427
+ }
428
+ }
429
+
430
+ &--big {
431
+ width: calc(100% + 10px);
432
+ }
433
+
434
+ &--hover {
435
+ cursor: pointer;
436
+
437
+ &::after {
438
+ display: block;
439
+ top: -2px;
440
+ bottom: -2px;
441
+ left: -2px;
442
+ right: -2px;
443
+ border: 2px solid $slate;
444
+ border-radius: 7px;
445
+ }
446
+
447
+ &--dark::after {
448
+ border-color: rgba($white, 0.6);
449
+ }
450
+ }
451
+
452
+ &--focus {
453
+ &::after {
454
+ display: block;
455
+ border: 1px solid $brand-blue;
456
+ }
457
+
458
+ &--dark::after {
459
+ border-color: $banana-bread;
460
+ }
461
+ }
462
+
463
+ &--selected {
464
+ &::after {
465
+ display: block;
466
+ border: 2px solid $brand-blue;
467
+ }
468
+
469
+ &:focus::before {
470
+ content: '';
471
+ position: absolute;
472
+ top: -3px;
473
+ bottom: -3px;
474
+ left: -3px;
475
+ right: -3px;
476
+ border-radius: 7px;
477
+ border: 1px solid $brand-blue;
478
+ pointer-events: none;
479
+ }
480
+
481
+ &--dark::after {
482
+ border-color: $banana-bread;
483
+ }
484
+
485
+ &--dark:hover::after {
486
+ border-color: $butterscotch;
487
+ }
488
+
489
+ &--dark:focus::before {
490
+ border-color: $banana-bread;
491
+ }
492
+ }
493
+
494
+ &--incorrect {
495
+ &::after {
496
+ display: block;
497
+ border: 1px solid $pepper;
498
+ }
499
+
500
+ &--dark::after {
501
+ border-color: $rosa;
502
+ }
503
+ }
504
+
505
+ &--correct {
506
+ &::after {
507
+ display: block;
508
+ border: 2px solid $cadaverous;
509
+ }
510
+
511
+ &--dark::after {
512
+ border-color: $jungle-green;
513
+ }
514
+
515
+ .uikit-question-choices-container__choice--big.uikit-question-choices-container__choice--tablet-portrait {
516
+ padding: 11px 38px 11px 17px;
517
+ }
518
+
519
+ .uikit-question-choices-container__choice--big.uikit-question-choices-container__choice--mobile {
520
+ padding: 11px 21px 9px;
521
+ }
522
+ }
523
+ }
524
+
525
+ &__choice-letter {
526
+ position: absolute;
527
+ left: -26px;
528
+ top: 50%;
529
+ transform: translateY(calc(-50% + 2px));
530
+ color: $slate-01;
531
+ font-size: 14px;
532
+ line-height: 17px;
533
+ transition: 0.1s left ease;
534
+
535
+ &--dark {
536
+ color: rgba($white, 0.6);
537
+ }
538
+
539
+ &--selected {
540
+ color: $brand-blue;
541
+
542
+ &--dark {
543
+ color: $banana-bread;
544
+ }
545
+ }
546
+
547
+ &--correct {
548
+ color: $victoria-green;
549
+
550
+ &--dark {
551
+ color: $jungle-green;
552
+ }
553
+ }
554
+
555
+ &--incorrect {
556
+ color: $lust;
557
+
558
+ &--dark {
559
+ color: $rosa;
560
+ }
561
+ }
562
+
563
+ &--big {
564
+ left: -21px;
565
+ }
566
+
567
+ &--mobile {
568
+ display: none;
569
+ }
570
+ }
571
+
572
+ &__choice {
573
+ width: 100%;
574
+ background-color: $white;
575
+ border-radius: 5px;
576
+ padding: 11px 46px 11px 15px;
577
+ font-size: 16.5px;
578
+ font-weight: 500;
579
+ letter-spacing: -0.1px;
580
+ line-height: 23px;
581
+ position: relative;
582
+ transition: 0.1s padding ease;
583
+
584
+ &--tablet-portrait {
585
+ font-size: 16px;
586
+ font-weight: 500;
587
+ letter-spacing: -0.1px;
588
+ line-height: 23px;
589
+ }
590
+
591
+ &--review-mode#{&}--distractor {
592
+ color: $slate;
593
+
594
+ &--dark {
595
+ color: $fog;
596
+ }
597
+ }
598
+
599
+ &--strike {
600
+ text-decoration: line-through;
601
+
602
+ &--dark:not(&--mcr) {
603
+ color: #c5cbd1 !important;
604
+ }
605
+ }
606
+
607
+ &--strike:not(&--mcr) {
608
+ color: $pewter;
609
+ }
610
+
611
+ &--strike#{&}--distractor#{&}--mcr {
612
+ background-color: rgba($barely-background, 0.5);
613
+ color: $ash;
614
+ box-shadow: 0 1px 4px 0 rgba($fog, 0.4);
615
+
616
+ &--dark {
617
+ background-color: rgba($moonlit-ocean, 0.5);
618
+ box-shadow: 0 1px 4px 0 rgba($charcoal, 0.2);
619
+ }
620
+ }
621
+
622
+ &--selected {
623
+ box-shadow: 0 1px 4px 0 rgba($brand-black, 0.12);
624
+ }
625
+
626
+ &--big {
627
+ padding: 11px 51px 11px 20px;
628
+ }
629
+
630
+ &--mcr {
631
+ padding: 13px 46px 15px 50px;
632
+ }
633
+
634
+ &--show-stats {
635
+ padding-bottom: 23px;
636
+ padding-right: 66px;
637
+ }
638
+
639
+ &--dark {
640
+ background-color: $brand-black;
641
+ color: $gray-background;
642
+ }
643
+
644
+ p {
645
+ margin: 0;
646
+ }
647
+ }
648
+
649
+ &__mcr-checkbox {
650
+ display: flex;
651
+ justify-content: center;
652
+ align-items: center;
653
+ position: absolute;
654
+ top: 15px;
655
+ left: 15px;
656
+ width: 21px;
657
+ height: 21px;
658
+ border: 1px solid rgba($slate-01, 0.5);
659
+ border-radius: 2px;
660
+ box-sizing: border-box;
661
+
662
+ &--dark {
663
+ background: $barely-background;
664
+ border-color: $barely-background;
665
+ }
666
+
667
+ &--distractor--dark {
668
+ background: transparent;
669
+ border: 1px solid $pewter;
670
+ }
671
+
672
+ &--selected {
673
+ background-color: $brand-black;
674
+ color: $white;
675
+
676
+ &--dark {
677
+ background: $barely-background;
678
+ color: $brand-black;
679
+ }
680
+ }
681
+
682
+ &--selected#{&}--distractor {
683
+ background-color: rgba($slate-01, 0.5);
684
+ color: $white;
685
+ border: none;
686
+
687
+ &--dark {
688
+ background-color: rgba($barely-background, 0.4);
689
+ color: $brand-black;
690
+ }
691
+ }
692
+
693
+ &--selected#{&}--answer {
694
+ background-color: $cadaverous;
695
+ color: $white;
696
+ border: none;
697
+
698
+ &--dark {
699
+ background: $jungle-green;
700
+ }
701
+ }
702
+
703
+ &--answer:not(&--selected) {
704
+ color: $cadaverous;
705
+ }
706
+
707
+ &--answer--dark:not(&--selected) {
708
+ color: $jungle-green;
709
+ background: transparent;
710
+ border: 1px solid $pewter;
711
+ }
712
+
713
+ &--strike {
714
+ border-color: $pewter;
715
+ }
716
+ }
717
+
718
+ &__mcr-check {
719
+ width: 13px;
720
+ height: 11px;
721
+ }
722
+
723
+ &__choice-text {
724
+ outline: none;
725
+ }
726
+
727
+ &__toggle-explanation {
728
+ margin-top: 8px;
729
+ margin-bottom: 8px;
730
+ padding: 0;
731
+ z-index: 2;
732
+
733
+ &--review-mode {
734
+ display: none;
735
+ }
736
+
737
+ &--tablet-portrait,
738
+ &--mobile {
739
+ display: block;
740
+ }
741
+ }
742
+
743
+ &__toggle-explanation-text {
744
+ outline: none;
745
+ }
746
+
747
+ &__toggle-explanation-icon {
748
+ margin-left: 5px;
749
+ display: none;
750
+
751
+ &--tablet-portrait {
752
+ display: initial;
753
+ }
754
+
755
+ &--up {
756
+ transform: rotate(180deg);
757
+ }
758
+ }
759
+
760
+ &__strikethrough {
761
+ display: flex;
762
+ align-items: center;
763
+ justify-content: center;
764
+ position: absolute;
765
+ width: 20px;
766
+ height: 22px;
767
+ right: 12px;
768
+ background-color: $gray-background;
769
+ border-radius: 2px;
770
+ z-index: 2;
771
+ outline: none;
772
+ opacity: 0;
773
+
774
+ &--visible {
775
+ opacity: 1;
776
+ }
777
+
778
+ &:hover:not(&--active) {
779
+ background-color: rgba($sky-blue, 0.674);
780
+ color: $brand-blue;
781
+ }
782
+
783
+ &:focus:not(&--active) {
784
+ background-color: $gray-background;
785
+ color: $brand-blue;
786
+
787
+ &::after {
788
+ content: '';
789
+ position: absolute;
790
+ top: 0;
791
+ bottom: 0;
792
+ left: 0;
793
+ right: 0;
794
+ border: 1px solid $brand-blue;
795
+ border-radius: 2px;
796
+ }
797
+ }
798
+
799
+ &--dark {
800
+ background-color: $ash;
801
+ color: $white;
802
+
803
+ &:hover:not(&--active) {
804
+ background-color: rgba($banana-bread, 0.15);
805
+ color: $banana-bread;
806
+ }
807
+
808
+ &:focus:not(&--active) {
809
+ background-color: rgba($white, 0.15);
810
+ color: $banana-bread;
811
+
812
+ &::after {
813
+ border-color: $banana-bread;
814
+ }
815
+ }
816
+ }
817
+
818
+ &--active {
819
+ background-color: $brand-blue;
820
+ color: $white;
821
+
822
+ &:hover {
823
+ background-color: mix($brand-blue, black, 90%);
824
+ }
825
+
826
+ &:focus {
827
+ &::before {
828
+ content: '';
829
+ position: absolute;
830
+ top: -2px;
831
+ bottom: -2px;
832
+ left: -2px;
833
+ right: -2px;
834
+ border: 1px solid $brand-blue;
835
+ border-radius: 2px;
836
+ }
837
+ }
838
+
839
+ &--dark {
840
+ background-color: $banana-bread;
841
+ color: $brand-black;
842
+
843
+ &:hover {
844
+ background-color: $banana-bread;
845
+ color: $brand-black;
846
+ }
847
+
848
+ &:focus {
849
+ background-color: $banana-bread !important;
850
+ color: $brand-black !important;
851
+
852
+ &::before {
853
+ border-color: $banana-bread;
854
+ }
855
+ }
856
+ }
857
+ }
858
+
859
+ &--tablet-landscape {
860
+ display: none;
861
+ }
862
+ }
863
+
864
+ &__correct-icon {
865
+ position: absolute;
866
+ top: 12px;
867
+ right: 15px;
868
+ width: 22px;
869
+ height: 22px;
870
+ color: $cadaverous;
871
+
872
+ &--dark {
873
+ color: $jungle-green;
874
+ }
875
+
876
+ &--review-mode {
877
+ top: 11px;
878
+ }
879
+ }
880
+
881
+ &__incorrect-icon {
882
+ position: absolute;
883
+ top: 12px;
884
+ right: 10px;
885
+ width: 22px;
886
+ height: 22px;
887
+ color: $pepper;
888
+
889
+ &--mcr {
890
+ top: 11px;
891
+ }
892
+
893
+ &--dark {
894
+ color: $rosa;
895
+ }
896
+ }
897
+
898
+ &__choice-stats-pct {
899
+ position: absolute;
900
+ top: 50%;
901
+ right: 10px;
902
+ transform: translateY(-50%);
903
+ color: $ash;
904
+ font-size: 15.5px;
905
+ letter-spacing: -0.2px;
906
+ line-height: 19px;
907
+ font-weight: 600;
908
+ transition: 0.1s right ease;
909
+
910
+ &--dark {
911
+ color: $fog;
912
+ }
913
+
914
+ &--big {
915
+ right: 15px;
916
+ }
917
+ }
918
+
919
+ &__choice-stats-bar {
920
+ position: absolute;
921
+ bottom: 0;
922
+ width: 100%;
923
+ height: 12px;
924
+ box-sizing: border-box;
925
+ background-color: $fog;
926
+ border-radius: 0 0 5px 5px;
927
+ overflow: hidden;
928
+
929
+ &--dark {
930
+ background-color: $ash;
931
+ }
932
+ }
933
+
934
+ &__choice-stats-bar-fill {
935
+ background-color: $slate-01;
936
+ height: 100%;
937
+
938
+ &--dark {
939
+ background-color: $pewter;
940
+ }
941
+
942
+ &--correct {
943
+ background-color: $cadaverous;
944
+
945
+ &--dark {
946
+ background-color: $jungle-green;
947
+ }
948
+ }
949
+
950
+ &--incorrect {
951
+ background-color: $pepper;
952
+
953
+ &--dark {
954
+ background-color: $rosa;
955
+ }
956
+ }
957
+ }
958
+
959
+ &__motivational-moment {
960
+ position: absolute;
961
+ right: -150px;
962
+ top: 20px;
963
+
964
+ &--mcr {
965
+ display: none;
966
+ }
967
+
968
+ &--passage-and-image {
969
+ display: none;
970
+ }
971
+
972
+ &--explanation {
973
+ display: none;
974
+ }
975
+
976
+ &--tablet-portrait {
977
+ display: none;
978
+ }
979
+ }
980
+
981
+ &__dropdown-explanation {
982
+ p {
983
+ margin: 6px 0 8pt 0;
984
+ }
985
+ }
986
+ }
987
+ </style>