@pocketprep/ui-kit 3.4.6 → 3.4.8

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,999 @@
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 && choiceKeyHover === choice.key,
15
+ 'uikit-question-choices-container__choice-container--focus':
16
+ !showAnswers && choiceKeyFocus === 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
+ && [ choiceKeyHover, choiceKeyFocus ].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
+ choiceKeyHover: TChoiceKey | null = null
328
+ choiceKeyFocus: TChoiceKey | null = null
329
+
330
+ mounted () {
331
+ this.choiceKeyHover = this.hoverChoiceKey
332
+ this.choiceKeyFocus = this.focusChoiceKey
333
+ }
334
+
335
+ stripText (string?: string) {
336
+ return string?.replace(/<[^\s>]+[^>]*>/gi, ' ').trim()
337
+ }
338
+
339
+
340
+ @Emit('emitChoiceFocusIn')
341
+ emitChoiceFocusIn (choiceKey: TChoiceKey) {
342
+ this.choiceKeyFocus = choiceKey
343
+ return choiceKey
344
+ }
345
+
346
+ @Emit('emitChoiceFocusOut')
347
+ emitChoiceFocusOut (event: FocusEvent) {
348
+ this.choiceKeyFocus = null
349
+ return event
350
+ }
351
+
352
+ @Emit('emitChoiceMouseOver')
353
+ emitChoiceMouseOver (choiceKey: TChoiceKey) {
354
+ this.choiceKeyHover = choiceKey
355
+ return choiceKey
356
+ }
357
+
358
+ @Emit('emitChoiceMouseleave')
359
+ emitChoiceMouseleave () {
360
+ this.choiceKeyHover = null
361
+ return
362
+ }
363
+
364
+ @Emit('emitHandleTouchStart')
365
+ emitHandleTouchStart (event: TouchEvent) {
366
+ return event
367
+ }
368
+
369
+ @Emit('emitHandleTouchMove')
370
+ emitHandleTouchMove (event: TouchEvent) {
371
+ return event
372
+ }
373
+
374
+ @Emit('emitHandleTouchEnd')
375
+ emitHandleTouchEnd (choiceKey: TChoiceKey, event: TouchEvent) {
376
+ return { choiceKey, event }
377
+ }
378
+
379
+ @Emit('emitSelectedChoice')
380
+ emitSelectedChoice (choiceKey: TChoiceKey) {
381
+ return choiceKey
382
+ }
383
+
384
+ @Emit('emitClickChoiceStrike')
385
+ emitClickChoiceStrike (choiceKey: TChoiceKey) {
386
+ return choiceKey
387
+ }
388
+
389
+ @Emit('toggleChoiceExplanation')
390
+ toggleChoiceExplanation () {
391
+ return
392
+ }
393
+
394
+ @Emit('toggleDropdownExplanationImageLongAlt')
395
+ toggleDropdownExplanationImageLongAlt () {
396
+ return
397
+ }
398
+ }
399
+ </script>
400
+
401
+ <style lang="scss">
402
+ @import '../../../styles/colors';
403
+ @import '../../../styles/breakpoints';
404
+
405
+ .uikit-question-choices-container {
406
+ display: contents;
407
+
408
+ &:not(:last-child) .uikit-question-choices-container__choice-container {
409
+ margin-bottom: 9px;
410
+ }
411
+
412
+ &__choice-container {
413
+ display: flex;
414
+ align-items: center;
415
+ width: 100%;
416
+ border-radius: 6px;
417
+ cursor: default;
418
+ position: relative;
419
+ outline: none;
420
+ transition: 0.1s width ease;
421
+
422
+ &::after {
423
+ content: '';
424
+ position: absolute;
425
+ top: -1px;
426
+ bottom: -1px;
427
+ left: -1px;
428
+ right: -1px;
429
+ border: 1px solid rgba($pewter, 0.85);
430
+ box-shadow: 0 1px 4px 0 rgba($ash, 0.3);
431
+ border-radius: 6px;
432
+ pointer-events: none;
433
+ }
434
+
435
+ &--dark {
436
+ &::after {
437
+ border-color: $slate;
438
+ box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
439
+ }
440
+ }
441
+
442
+ &--big {
443
+ width: calc(100% + 10px);
444
+ }
445
+
446
+ &--hover {
447
+ cursor: pointer;
448
+
449
+ &::after {
450
+ display: block;
451
+ top: -2px;
452
+ bottom: -2px;
453
+ left: -2px;
454
+ right: -2px;
455
+ border: 2px solid $slate;
456
+ border-radius: 7px;
457
+ }
458
+
459
+ &--dark::after {
460
+ border-color: rgba($white, 0.6);
461
+ }
462
+ }
463
+
464
+ &--focus {
465
+ &::after {
466
+ display: block;
467
+ border: 1px solid $brand-blue;
468
+ }
469
+
470
+ &--dark::after {
471
+ border-color: $banana-bread;
472
+ }
473
+ }
474
+
475
+ &--selected {
476
+ &::after {
477
+ display: block;
478
+ border: 2px solid $brand-blue;
479
+ }
480
+
481
+ &:focus::before {
482
+ content: '';
483
+ position: absolute;
484
+ top: -3px;
485
+ bottom: -3px;
486
+ left: -3px;
487
+ right: -3px;
488
+ border-radius: 7px;
489
+ border: 1px solid $brand-blue;
490
+ pointer-events: none;
491
+ }
492
+
493
+ &--dark::after {
494
+ border-color: $banana-bread;
495
+ }
496
+
497
+ &--dark:hover::after {
498
+ border-color: $butterscotch;
499
+ }
500
+
501
+ &--dark:focus::before {
502
+ border-color: $banana-bread;
503
+ }
504
+ }
505
+
506
+ &--incorrect {
507
+ &::after {
508
+ display: block;
509
+ border: 1px solid $pepper;
510
+ }
511
+
512
+ &--dark::after {
513
+ border-color: $rosa;
514
+ }
515
+ }
516
+
517
+ &--correct {
518
+ &::after {
519
+ display: block;
520
+ border: 2px solid $cadaverous;
521
+ }
522
+
523
+ &--dark::after {
524
+ border-color: $jungle-green;
525
+ }
526
+
527
+ .uikit-question-choices-container__choice--big.uikit-question-choices-container__choice--tablet-portrait {
528
+ padding: 11px 38px 11px 17px;
529
+ }
530
+
531
+ .uikit-question-choices-container__choice--big.uikit-question-choices-container__choice--mobile {
532
+ padding: 11px 21px 9px;
533
+ }
534
+ }
535
+ }
536
+
537
+ &__choice-letter {
538
+ position: absolute;
539
+ left: -26px;
540
+ top: 50%;
541
+ transform: translateY(calc(-50% + 2px));
542
+ color: $slate-01;
543
+ font-size: 14px;
544
+ line-height: 17px;
545
+ transition: 0.1s left ease;
546
+
547
+ &--dark {
548
+ color: rgba($white, 0.6);
549
+ }
550
+
551
+ &--selected {
552
+ color: $brand-blue;
553
+
554
+ &--dark {
555
+ color: $banana-bread;
556
+ }
557
+ }
558
+
559
+ &--correct {
560
+ color: $victoria-green;
561
+
562
+ &--dark {
563
+ color: $jungle-green;
564
+ }
565
+ }
566
+
567
+ &--incorrect {
568
+ color: $lust;
569
+
570
+ &--dark {
571
+ color: $rosa;
572
+ }
573
+ }
574
+
575
+ &--big {
576
+ left: -21px;
577
+ }
578
+
579
+ &--mobile {
580
+ display: none;
581
+ }
582
+ }
583
+
584
+ &__choice {
585
+ width: 100%;
586
+ background-color: $white;
587
+ border-radius: 5px;
588
+ padding: 11px 46px 11px 15px;
589
+ font-size: 16.5px;
590
+ font-weight: 500;
591
+ letter-spacing: -0.1px;
592
+ line-height: 23px;
593
+ position: relative;
594
+ transition: 0.1s padding ease;
595
+
596
+ &--tablet-portrait {
597
+ font-size: 16px;
598
+ font-weight: 500;
599
+ letter-spacing: -0.1px;
600
+ line-height: 23px;
601
+ }
602
+
603
+ &--review-mode#{&}--distractor {
604
+ color: $slate;
605
+
606
+ &--dark {
607
+ color: $fog;
608
+ }
609
+ }
610
+
611
+ &--strike {
612
+ text-decoration: line-through;
613
+
614
+ &--dark:not(&--mcr) {
615
+ color: #c5cbd1 !important;
616
+ }
617
+ }
618
+
619
+ &--strike:not(&--mcr) {
620
+ color: $pewter;
621
+ }
622
+
623
+ &--strike#{&}--distractor#{&}--mcr {
624
+ background-color: rgba($barely-background, 0.5);
625
+ color: $ash;
626
+ box-shadow: 0 1px 4px 0 rgba($fog, 0.4);
627
+
628
+ &--dark {
629
+ background-color: rgba($moonlit-ocean, 0.5);
630
+ box-shadow: 0 1px 4px 0 rgba($charcoal, 0.2);
631
+ }
632
+ }
633
+
634
+ &--selected {
635
+ box-shadow: 0 1px 4px 0 rgba($brand-black, 0.12);
636
+ }
637
+
638
+ &--big {
639
+ padding: 11px 51px 11px 20px;
640
+ }
641
+
642
+ &--mcr {
643
+ padding: 13px 46px 15px 50px;
644
+ }
645
+
646
+ &--show-stats {
647
+ padding-bottom: 23px;
648
+ padding-right: 66px;
649
+ }
650
+
651
+ &--dark {
652
+ background-color: $brand-black;
653
+ color: $gray-background;
654
+ }
655
+
656
+ p {
657
+ margin: 0;
658
+ }
659
+ }
660
+
661
+ &__mcr-checkbox {
662
+ display: flex;
663
+ justify-content: center;
664
+ align-items: center;
665
+ position: absolute;
666
+ top: 15px;
667
+ left: 15px;
668
+ width: 21px;
669
+ height: 21px;
670
+ border: 1px solid rgba($slate-01, 0.5);
671
+ border-radius: 2px;
672
+ box-sizing: border-box;
673
+
674
+ &--dark {
675
+ background: $barely-background;
676
+ border-color: $barely-background;
677
+ }
678
+
679
+ &--distractor--dark {
680
+ background: transparent;
681
+ border: 1px solid $pewter;
682
+ }
683
+
684
+ &--selected {
685
+ background-color: $brand-black;
686
+ color: $white;
687
+
688
+ &--dark {
689
+ background: $barely-background;
690
+ color: $brand-black;
691
+ }
692
+ }
693
+
694
+ &--selected#{&}--distractor {
695
+ background-color: rgba($slate-01, 0.5);
696
+ color: $white;
697
+ border: none;
698
+
699
+ &--dark {
700
+ background-color: rgba($barely-background, 0.4);
701
+ color: $brand-black;
702
+ }
703
+ }
704
+
705
+ &--selected#{&}--answer {
706
+ background-color: $cadaverous;
707
+ color: $white;
708
+ border: none;
709
+
710
+ &--dark {
711
+ background: $jungle-green;
712
+ }
713
+ }
714
+
715
+ &--answer:not(&--selected) {
716
+ color: $cadaverous;
717
+ }
718
+
719
+ &--answer--dark:not(&--selected) {
720
+ color: $jungle-green;
721
+ background: transparent;
722
+ border: 1px solid $pewter;
723
+ }
724
+
725
+ &--strike {
726
+ border-color: $pewter;
727
+ }
728
+ }
729
+
730
+ &__mcr-check {
731
+ width: 13px;
732
+ height: 11px;
733
+ }
734
+
735
+ &__choice-text {
736
+ outline: none;
737
+ }
738
+
739
+ &__toggle-explanation {
740
+ margin-top: 8px;
741
+ margin-bottom: 8px;
742
+ padding: 0;
743
+ z-index: 2;
744
+
745
+ &--review-mode {
746
+ display: none;
747
+ }
748
+
749
+ &--tablet-portrait,
750
+ &--mobile {
751
+ display: block;
752
+ }
753
+ }
754
+
755
+ &__toggle-explanation-text {
756
+ outline: none;
757
+ }
758
+
759
+ &__toggle-explanation-icon {
760
+ margin-left: 5px;
761
+ display: none;
762
+
763
+ &--tablet-portrait {
764
+ display: initial;
765
+ }
766
+
767
+ &--up {
768
+ transform: rotate(180deg);
769
+ }
770
+ }
771
+
772
+ &__strikethrough {
773
+ display: flex;
774
+ align-items: center;
775
+ justify-content: center;
776
+ position: absolute;
777
+ width: 20px;
778
+ height: 22px;
779
+ right: 12px;
780
+ background-color: $gray-background;
781
+ border-radius: 2px;
782
+ z-index: 2;
783
+ outline: none;
784
+ opacity: 0;
785
+
786
+ &--visible {
787
+ opacity: 1;
788
+ }
789
+
790
+ &:hover:not(&--active) {
791
+ background-color: rgba($sky-blue, 0.674);
792
+ color: $brand-blue;
793
+ }
794
+
795
+ &:focus:not(&--active) {
796
+ background-color: $gray-background;
797
+ color: $brand-blue;
798
+
799
+ &::after {
800
+ content: '';
801
+ position: absolute;
802
+ top: 0;
803
+ bottom: 0;
804
+ left: 0;
805
+ right: 0;
806
+ border: 1px solid $brand-blue;
807
+ border-radius: 2px;
808
+ }
809
+ }
810
+
811
+ &--dark {
812
+ background-color: $ash;
813
+ color: $white;
814
+
815
+ &:hover:not(&--active) {
816
+ background-color: rgba($banana-bread, 0.15);
817
+ color: $banana-bread;
818
+ }
819
+
820
+ &:focus:not(&--active) {
821
+ background-color: rgba($white, 0.15);
822
+ color: $banana-bread;
823
+
824
+ &::after {
825
+ border-color: $banana-bread;
826
+ }
827
+ }
828
+ }
829
+
830
+ &--active {
831
+ background-color: $brand-blue;
832
+ color: $white;
833
+
834
+ &:hover {
835
+ background-color: mix($brand-blue, black, 90%);
836
+ }
837
+
838
+ &:focus {
839
+ &::before {
840
+ content: '';
841
+ position: absolute;
842
+ top: -2px;
843
+ bottom: -2px;
844
+ left: -2px;
845
+ right: -2px;
846
+ border: 1px solid $brand-blue;
847
+ border-radius: 2px;
848
+ }
849
+ }
850
+
851
+ &--dark {
852
+ background-color: $banana-bread;
853
+ color: $brand-black;
854
+
855
+ &:hover {
856
+ background-color: $banana-bread;
857
+ color: $brand-black;
858
+ }
859
+
860
+ &:focus {
861
+ background-color: $banana-bread !important;
862
+ color: $brand-black !important;
863
+
864
+ &::before {
865
+ border-color: $banana-bread;
866
+ }
867
+ }
868
+ }
869
+ }
870
+
871
+ &--tablet-landscape {
872
+ display: none;
873
+ }
874
+ }
875
+
876
+ &__correct-icon {
877
+ position: absolute;
878
+ top: 12px;
879
+ right: 15px;
880
+ width: 22px;
881
+ height: 22px;
882
+ color: $cadaverous;
883
+
884
+ &--dark {
885
+ color: $jungle-green;
886
+ }
887
+
888
+ &--review-mode {
889
+ top: 11px;
890
+ }
891
+ }
892
+
893
+ &__incorrect-icon {
894
+ position: absolute;
895
+ top: 12px;
896
+ right: 10px;
897
+ width: 22px;
898
+ height: 22px;
899
+ color: $pepper;
900
+
901
+ &--mcr {
902
+ top: 11px;
903
+ }
904
+
905
+ &--dark {
906
+ color: $rosa;
907
+ }
908
+ }
909
+
910
+ &__choice-stats-pct {
911
+ position: absolute;
912
+ top: 50%;
913
+ right: 10px;
914
+ transform: translateY(-50%);
915
+ color: $ash;
916
+ font-size: 15.5px;
917
+ letter-spacing: -0.2px;
918
+ line-height: 19px;
919
+ font-weight: 600;
920
+ transition: 0.1s right ease;
921
+
922
+ &--dark {
923
+ color: $fog;
924
+ }
925
+
926
+ &--big {
927
+ right: 15px;
928
+ }
929
+ }
930
+
931
+ &__choice-stats-bar {
932
+ position: absolute;
933
+ bottom: 0;
934
+ width: 100%;
935
+ height: 12px;
936
+ box-sizing: border-box;
937
+ background-color: $fog;
938
+ border-radius: 0 0 5px 5px;
939
+ overflow: hidden;
940
+
941
+ &--dark {
942
+ background-color: $ash;
943
+ }
944
+ }
945
+
946
+ &__choice-stats-bar-fill {
947
+ background-color: $slate-01;
948
+ height: 100%;
949
+
950
+ &--dark {
951
+ background-color: $pewter;
952
+ }
953
+
954
+ &--correct {
955
+ background-color: $cadaverous;
956
+
957
+ &--dark {
958
+ background-color: $jungle-green;
959
+ }
960
+ }
961
+
962
+ &--incorrect {
963
+ background-color: $pepper;
964
+
965
+ &--dark {
966
+ background-color: $rosa;
967
+ }
968
+ }
969
+ }
970
+
971
+ &__motivational-moment {
972
+ position: absolute;
973
+ right: -150px;
974
+ top: 20px;
975
+
976
+ &--mcr {
977
+ display: none;
978
+ }
979
+
980
+ &--passage-and-image {
981
+ display: none;
982
+ }
983
+
984
+ &--explanation {
985
+ display: none;
986
+ }
987
+
988
+ &--tablet-portrait {
989
+ display: none;
990
+ }
991
+ }
992
+
993
+ &__dropdown-explanation {
994
+ p {
995
+ margin: 6px 0 8pt 0;
996
+ }
997
+ }
998
+ }
999
+ </style>