@pocketprep/ui-kit 3.4.7 → 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.
- package/dist/@pocketprep/ui-kit.js +7560 -7277
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +8 -8
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/lib/components/Quiz/Question/ChoicesContainer.vue +999 -0
- package/lib/components/Quiz/Question/DropdownExplanation.vue +1 -6
- package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +1 -1
- package/lib/components/Quiz/Question/Summary.vue +1 -1
- package/lib/components/Quiz/Question.vue +98 -620
- package/package.json +1 -1
|
@@ -147,273 +147,69 @@
|
|
|
147
147
|
type="incorrect"
|
|
148
148
|
/>
|
|
149
149
|
</div>
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
:
|
|
153
|
-
|
|
150
|
+
<ChoicesContainer
|
|
151
|
+
ref="uikit-question__choices-container"
|
|
152
|
+
:question="question"
|
|
153
|
+
:choices="choices"
|
|
154
|
+
:show-answers="showAnswers"
|
|
155
|
+
:show-explanation="showExplanation"
|
|
156
|
+
:is-MCR="isMCR"
|
|
157
|
+
:is-unanswered="isUnanswered"
|
|
158
|
+
:answer-keys="answerKeys"
|
|
159
|
+
:hover-choice-key="hoverChoiceKey"
|
|
160
|
+
:focus-choice-key="focusChoiceKey"
|
|
161
|
+
:selected-choices="selectedChoices"
|
|
162
|
+
:distractor-keys="distractorKeys"
|
|
163
|
+
:choice-strikes="choiceStrikes"
|
|
164
|
+
:choice-scores="choiceScores"
|
|
165
|
+
:passage-image-url="passageImageUrl"
|
|
166
|
+
:is-correct="isCorrect"
|
|
167
|
+
:global-metrics="globalMetrics"
|
|
168
|
+
:reviewMode="reviewMode"
|
|
169
|
+
:show-explanation-image-long-alt="showExplanationImageLongAlt"
|
|
170
|
+
:explanation-image-url="explanationImageUrl"
|
|
171
|
+
:explanation-image-alt="explanationImageAlt"
|
|
172
|
+
:explanation-image-long-alt="explanationImageLongAlt"
|
|
173
|
+
:reference="reference"
|
|
174
|
+
:hide-references="hideReferences"
|
|
175
|
+
:is-dark-mode="isDarkMode"
|
|
176
|
+
:question-el="questionEl"
|
|
177
|
+
:breakpoints="breakpoints"
|
|
178
|
+
@emitChoiceMouseOver="choiceMouseOver"
|
|
179
|
+
@emitChoiceMouseleave="choiceMouseLeave"
|
|
180
|
+
@emitChoiceFocusIn="choiceFocusIn"
|
|
181
|
+
@emitChoiceFocusOut="choiceFocusOut"
|
|
182
|
+
@emitHandleTouchStart="handleTouchStart"
|
|
183
|
+
@emitHandleTouchMove="handleTouchMove"
|
|
184
|
+
@emitHandleTouchEnd="handleTouchEnd"
|
|
185
|
+
@emitSelectedChoice="selectChoice"
|
|
186
|
+
@emitClickChoiceStrike="clickChoiceStrike"
|
|
187
|
+
@toggleChoiceExplanation="toggleExplanation"
|
|
188
|
+
@toggleDropdownExplanationImageLongAlt="toggleExplanationImageLongAlt"
|
|
154
189
|
>
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
@focusin="focusChoiceKey = choice.key"
|
|
179
|
-
@focusout="choiceFocusOut"
|
|
180
|
-
@click.stop="selectChoice(choice.key)"
|
|
181
|
-
@keydown.enter.stop="selectChoice(choice.key)"
|
|
182
|
-
@touchstart="handleTouchStart"
|
|
183
|
-
@touchmove="handleTouchMove"
|
|
184
|
-
@touchend="handleTouchEnd(choice.key, $event)"
|
|
185
|
-
>
|
|
186
|
-
<div
|
|
187
|
-
v-if="!reviewMode"
|
|
188
|
-
v-breakpoint:questionEl="breakpoints"
|
|
189
|
-
v-dark="isDarkMode"
|
|
190
|
-
class="uikit-question__choice-letter"
|
|
191
|
-
:class="!isMCR && {
|
|
192
|
-
'uikit-question__choice-letter--selected': selectedChoices.includes(choice.key),
|
|
193
|
-
'uikit-question__choice-letter--correct': showAnswers
|
|
194
|
-
&& answerKeys.includes(choice.key),
|
|
195
|
-
'uikit-question__choice-letter--incorrect': showAnswers
|
|
196
|
-
&& selectedChoices.includes(choice.key)
|
|
197
|
-
&& distractorKeys.includes(choice.key),
|
|
198
|
-
'uikit-question__choice-letter--big': !globalMetrics && (showAnswers
|
|
199
|
-
? answerKeys.includes(choice.key)
|
|
200
|
-
: selectedChoices.includes(choice.key)),
|
|
201
|
-
}"
|
|
202
|
-
>
|
|
203
|
-
{{ String.fromCharCode(index + 65) }}
|
|
204
|
-
</div>
|
|
205
|
-
<div
|
|
206
|
-
:ref="`choice-${choice.key}`"
|
|
207
|
-
v-dark="isDarkMode"
|
|
208
|
-
v-breakpoint:questionEl="breakpoints"
|
|
209
|
-
class="uikit-question__choice"
|
|
210
|
-
:class="{
|
|
211
|
-
'uikit-question__choice--strike': showAnswers
|
|
212
|
-
? isMCR
|
|
213
|
-
? distractorKeys.includes(choice.key)
|
|
214
|
-
: choiceStrikes.includes(choice.key) && !answerKeys.includes(choice.key)
|
|
215
|
-
: choiceStrikes.includes(choice.key),
|
|
216
|
-
'uikit-question__choice--big': !isMCR && !globalMetrics && (
|
|
217
|
-
showAnswers && !isUnanswered
|
|
218
|
-
? answerKeys.includes(choice.key)
|
|
219
|
-
: selectedChoices.includes(choice.key)
|
|
220
|
-
),
|
|
221
|
-
'uikit-question__choice--mcr': isMCR,
|
|
222
|
-
'uikit-question__choice--selected': !showAnswers &&
|
|
223
|
-
selectedChoices.includes(choice.key),
|
|
224
|
-
'uikit-question__choice--distractor': showAnswers
|
|
225
|
-
&& distractorKeys.includes(choice.key),
|
|
226
|
-
'uikit-question__choice--show-stats': globalMetrics,
|
|
227
|
-
'uikit-question__choice--review-mode': reviewMode,
|
|
228
|
-
}"
|
|
229
|
-
>
|
|
230
|
-
<div
|
|
231
|
-
v-if="isMCR"
|
|
232
|
-
v-dark="isDarkMode"
|
|
233
|
-
class="uikit-question__mcr-checkbox"
|
|
234
|
-
:class="{
|
|
235
|
-
'uikit-question__mcr-checkbox--selected': selectedChoices.includes(choice.key),
|
|
236
|
-
'uikit-question__mcr-checkbox--answer': showAnswers
|
|
237
|
-
&& answerKeys.includes(choice.key),
|
|
238
|
-
'uikit-question__mcr-checkbox--distractor': showAnswers
|
|
239
|
-
&& distractorKeys.includes(choice.key),
|
|
240
|
-
'uikit-question__mcr-checkbox--strike': !showAnswers
|
|
241
|
-
&& choiceStrikes.includes(choice.key),
|
|
242
|
-
}"
|
|
243
|
-
>
|
|
244
|
-
<Icon
|
|
245
|
-
v-if="selectedChoices.includes(choice.key) || (
|
|
246
|
-
showAnswers && answerKeys.includes(choice.key)
|
|
247
|
-
)"
|
|
248
|
-
class="uikit-question__mcr-check"
|
|
249
|
-
type="check"
|
|
250
|
-
/>
|
|
251
|
-
</div>
|
|
252
|
-
<div
|
|
253
|
-
class="uikit-question__choice-text"
|
|
254
|
-
:tabindex="showAnswers ? -1 : 0"
|
|
255
|
-
:role="isMCR
|
|
256
|
-
? 'checkbox'
|
|
257
|
-
: 'radio'
|
|
258
|
-
"
|
|
259
|
-
:aria-checked="selectedChoices.includes(choice.key) ? 'true' : 'false'"
|
|
260
|
-
:aria-label="`${
|
|
261
|
-
showAnswers
|
|
262
|
-
? answerKeys.includes(choice.key)
|
|
263
|
-
? 'Correct Answer, '
|
|
264
|
-
: 'Incorrect Answer, '
|
|
265
|
-
: ''
|
|
266
|
-
}${ stripText(choice.text) }`"
|
|
267
|
-
v-html="choice.text"
|
|
268
|
-
/>
|
|
269
|
-
<PocketButton
|
|
270
|
-
v-if="!isMCR && showAnswers && answerKeys.includes(choice.key)"
|
|
271
|
-
v-breakpoint:questionEl="breakpoints"
|
|
272
|
-
type="tertiary-small"
|
|
273
|
-
class="uikit-question__toggle-explanation"
|
|
274
|
-
:class="{ 'uikit-question__toggle-explanation--review-mode': reviewMode }"
|
|
275
|
-
:is-dark-mode="isDarkMode"
|
|
276
|
-
:aria-expanded="showExplanation ? 'true' : 'false'"
|
|
277
|
-
@click.stop="toggleExplanation"
|
|
278
|
-
@mousedown.prevent
|
|
279
|
-
>
|
|
280
|
-
<span
|
|
281
|
-
ref="uikit-question__toggle-explanation-text"
|
|
282
|
-
class="uikit-question__toggle-explanation-text"
|
|
283
|
-
tabindex="-1"
|
|
284
|
-
>{{ showExplanation ? 'Hide' : 'Show' }} Explanation</span>
|
|
285
|
-
<Icon
|
|
286
|
-
v-breakpoint:questionEl="breakpoints"
|
|
287
|
-
class="uikit-question__toggle-explanation-icon"
|
|
288
|
-
:class="{
|
|
289
|
-
'uikit-question__toggle-explanation-icon--up': showExplanation,
|
|
290
|
-
}"
|
|
291
|
-
type="accordionArrow"
|
|
292
|
-
/>
|
|
293
|
-
</PocketButton>
|
|
294
|
-
<DropdownExplanation
|
|
295
|
-
v-if="!isMCR && showAnswers && answerKeys.includes(choice.key) && showExplanation"
|
|
296
|
-
ref="uikit-question__dropdown-explanation"
|
|
297
|
-
class="uikit-question__dropdown-explanation"
|
|
298
|
-
:question="question"
|
|
299
|
-
:answer-keys="answerKeys"
|
|
300
|
-
:choice="choice"
|
|
301
|
-
:global-metrics="globalMetrics"
|
|
302
|
-
:show-answers="showAnswers"
|
|
303
|
-
:is-MCR="isMCR"
|
|
304
|
-
:show-explanation-image-long-alt="showExplanationImageLongAlt"
|
|
305
|
-
:explanation-image-url="explanationImageUrl"
|
|
306
|
-
:explanation-image-alt="explanationImageAlt"
|
|
307
|
-
:explanation-image-long-alt="explanationImageLongAlt"
|
|
308
|
-
:reference="reference"
|
|
309
|
-
:hide-references="hideReferences"
|
|
310
|
-
:is-dark-mode="isDarkMode"
|
|
311
|
-
:question-el="questionEl"
|
|
312
|
-
:breakpoints="breakpoints"
|
|
313
|
-
@toggleDropdownExplanationImageLongAlt="toggleExplanationImageLongAlt"
|
|
314
|
-
/>
|
|
315
|
-
</div>
|
|
316
|
-
<template v-if="!globalMetrics">
|
|
317
|
-
<div
|
|
318
|
-
v-if="!showAnswers"
|
|
319
|
-
v-breakpoint:questionEl="breakpoints"
|
|
320
|
-
v-dark="isDarkMode"
|
|
321
|
-
:tabindex="showAnswers ? -1 : 0"
|
|
322
|
-
class="uikit-question__strikethrough"
|
|
323
|
-
aria-label="Strikethrough"
|
|
324
|
-
role="switch"
|
|
325
|
-
:aria-checked="choiceStrikes.includes(choice.key) ? 'true' : 'false'"
|
|
326
|
-
:class="{
|
|
327
|
-
'uikit-question__strikethrough--visible': !showAnswers
|
|
328
|
-
&& [ hoverChoiceKey, focusChoiceKey ].includes(choice.key),
|
|
329
|
-
'uikit-question__strikethrough--active': choiceStrikes.includes(choice.key),
|
|
330
|
-
}"
|
|
331
|
-
@mousedown.prevent
|
|
332
|
-
@click.stop="clickChoiceStrike(choice.key)"
|
|
333
|
-
@keydown.enter.stop="clickChoiceStrike(choice.key)"
|
|
334
|
-
>
|
|
335
|
-
<Icon type="strike" />
|
|
336
|
-
</div>
|
|
337
|
-
<Icon
|
|
338
|
-
v-if="!isMCR
|
|
339
|
-
&& showAnswers
|
|
340
|
-
&& answerKeys.includes(choice.key)
|
|
341
|
-
&& (isCorrect || isUnanswered)
|
|
342
|
-
"
|
|
343
|
-
v-dark="isDarkMode"
|
|
344
|
-
type="correct"
|
|
345
|
-
class="uikit-question__correct-icon"
|
|
346
|
-
:class="{
|
|
347
|
-
'uikit-question__correct-icon--review-mode': reviewMode,
|
|
348
|
-
}"
|
|
349
|
-
/>
|
|
350
|
-
<Icon
|
|
351
|
-
v-if="showAnswers && (
|
|
352
|
-
(
|
|
353
|
-
selectedChoices.includes(choice.key)
|
|
354
|
-
&& distractorKeys.includes(choice.key)
|
|
355
|
-
) || (
|
|
356
|
-
isMCR
|
|
357
|
-
&& !selectedChoices.includes(choice.key)
|
|
358
|
-
&& answerKeys.includes(choice.key)
|
|
359
|
-
)
|
|
360
|
-
)"
|
|
361
|
-
v-dark="isDarkMode"
|
|
362
|
-
type="incorrect"
|
|
363
|
-
class="uikit-question__incorrect-icon"
|
|
364
|
-
:class="{
|
|
365
|
-
'uikit-question__incorrect-icon--mcr': isMCR,
|
|
366
|
-
}"
|
|
367
|
-
/>
|
|
368
|
-
</template>
|
|
369
|
-
<template v-else>
|
|
370
|
-
<div
|
|
371
|
-
v-dark="isDarkMode"
|
|
372
|
-
class="uikit-question__choice-stats-pct"
|
|
373
|
-
>
|
|
374
|
-
{{ choiceScores[choice.key] }} %
|
|
375
|
-
</div>
|
|
376
|
-
<div v-dark="isDarkMode" class="uikit-question__choice-stats-bar">
|
|
377
|
-
<div
|
|
378
|
-
v-dark="isDarkMode"
|
|
379
|
-
class="uikit-question__choice-stats-bar-fill"
|
|
380
|
-
:class="{
|
|
381
|
-
'uikit-question__choice-stats-bar-fill--correct': showAnswers
|
|
382
|
-
&& answerKeys.includes(choice.key),
|
|
383
|
-
'uikit-question__choice-stats-bar-fill--incorrect': showAnswers
|
|
384
|
-
&& distractorKeys.includes(choice.key)
|
|
385
|
-
&& selectedChoices.includes(choice.key),
|
|
386
|
-
}"
|
|
387
|
-
:style="{
|
|
388
|
-
'width': `${(choiceScores[choice.key]) || 0}%`
|
|
389
|
-
}"
|
|
390
|
-
/>
|
|
391
|
-
</div>
|
|
392
|
-
</template>
|
|
393
|
-
<div
|
|
394
|
-
v-breakpoint:questionEl="breakpoints"
|
|
395
|
-
class="uikit-question__motivational-moment"
|
|
396
|
-
:class="{
|
|
397
|
-
'uikit-question__motivational-moment--mcr': isMCR,
|
|
398
|
-
'uikit-question__motivational-moment--explanation': showExplanation,
|
|
399
|
-
'uikit-question__motivational-moment--passage-and-image': question.passage
|
|
400
|
-
|| passageImageUrl,
|
|
401
|
-
}"
|
|
402
|
-
>
|
|
403
|
-
<slot
|
|
404
|
-
name="motivationalMoment"
|
|
405
|
-
:showAnswers="showAnswers"
|
|
406
|
-
:answerKeys="answerKeys"
|
|
407
|
-
:choiceKey="choice.key"
|
|
408
|
-
:isCorrect="isCorrect"
|
|
409
|
-
/>
|
|
410
|
-
</div>
|
|
411
|
-
</div>
|
|
412
|
-
<slot
|
|
413
|
-
name="showNamesTable"
|
|
414
|
-
:choice-key="choice.key"
|
|
415
|
-
/>
|
|
416
|
-
</div>
|
|
190
|
+
<template #motivationalMoment="{
|
|
191
|
+
isCorrect,
|
|
192
|
+
choiceKey,
|
|
193
|
+
showAnswers,
|
|
194
|
+
answerKeys,
|
|
195
|
+
}">
|
|
196
|
+
<slot
|
|
197
|
+
name="motivationalMoment"
|
|
198
|
+
:showAnswers="showAnswers"
|
|
199
|
+
:answerKeys="answerKeys"
|
|
200
|
+
:choiceKey="choiceKey"
|
|
201
|
+
:isCorrect="isCorrect"
|
|
202
|
+
/>
|
|
203
|
+
</template>
|
|
204
|
+
<template #showNamesTable="{
|
|
205
|
+
choiceKey,
|
|
206
|
+
}" >
|
|
207
|
+
<slot
|
|
208
|
+
name="showNamesTable"
|
|
209
|
+
:choiceKey="choiceKey"
|
|
210
|
+
/>
|
|
211
|
+
</template>
|
|
212
|
+
</ChoicesContainer>
|
|
417
213
|
<slot name="unansweredFlaggedNamesTable" />
|
|
418
214
|
</div>
|
|
419
215
|
<Summary
|
|
@@ -688,6 +484,7 @@ import PassageAndImageDropdown from '../Quiz/Question/PassageAndImageDropdown.vu
|
|
|
688
484
|
import DropdownExplanation from '../Quiz/Question/DropdownExplanation.vue'
|
|
689
485
|
import Paywall from '../Quiz/Question/Paywall.vue'
|
|
690
486
|
import Summary from '../Quiz/Question/Summary.vue'
|
|
487
|
+
import ChoicesContainer from '../Quiz/Question/ChoicesContainer.vue'
|
|
691
488
|
import type { Study } from '@pocketprep/types'
|
|
692
489
|
import { breakpoint, dark } from '../../directives'
|
|
693
490
|
import { studyModes } from '../../utils'
|
|
@@ -704,6 +501,7 @@ import type { Ref, TQuizMode, TChoiceKey, TChoice, TChoiceScores, TNamesRow, TVi
|
|
|
704
501
|
Paywall,
|
|
705
502
|
DropdownExplanation,
|
|
706
503
|
Summary,
|
|
504
|
+
ChoicesContainer,
|
|
707
505
|
},
|
|
708
506
|
directives: {
|
|
709
507
|
breakpoint,
|
|
@@ -1025,10 +823,6 @@ export default class Question extends Vue {
|
|
|
1025
823
|
}, 0)
|
|
1026
824
|
}
|
|
1027
825
|
|
|
1028
|
-
stripText (string?: string) {
|
|
1029
|
-
return string?.replace(/<[^\s>]+[^>]*>/gi, ' ').trim()
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
826
|
startReviewMode () {
|
|
1033
827
|
this.showAnswers = true
|
|
1034
828
|
this.showExplanation = this.defaultShowExplanation === null ? true : this.defaultShowExplanation
|
|
@@ -1077,13 +871,25 @@ export default class Question extends Vue {
|
|
|
1077
871
|
) {
|
|
1078
872
|
const classesString = relatedTarget.getAttribute('class') || ''
|
|
1079
873
|
const classes = classesString.split(' ')
|
|
1080
|
-
if (classes.includes('uikit-
|
|
874
|
+
if (classes.includes('uikit-question-choices-container__strikethrough')) {
|
|
1081
875
|
return // Don't set focusChoiceKey = null
|
|
1082
876
|
}
|
|
1083
877
|
}
|
|
1084
878
|
this.focusChoiceKey = null
|
|
1085
879
|
}
|
|
1086
880
|
|
|
881
|
+
choiceFocusIn (choiceKey: TChoiceKey) {
|
|
882
|
+
this.focusChoiceKey = choiceKey
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
choiceMouseOver (choiceKey: TChoiceKey) {
|
|
886
|
+
this.hoverChoiceKey = choiceKey
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
choiceMouseLeave () {
|
|
890
|
+
this.hoverChoiceKey = null
|
|
891
|
+
}
|
|
892
|
+
|
|
1087
893
|
handleTouchStart (event: TouchEvent) {
|
|
1088
894
|
this.swipeStart = {
|
|
1089
895
|
x: event?.touches[0]?.clientX || null,
|
|
@@ -1108,7 +914,9 @@ export default class Question extends Vue {
|
|
|
1108
914
|
}
|
|
1109
915
|
}
|
|
1110
916
|
|
|
1111
|
-
handleTouchEnd (choiceKey: TChoiceKey
|
|
917
|
+
handleTouchEnd (option: {choiceKey: TChoiceKey; event: TouchEvent}) {
|
|
918
|
+
const choiceKey = option.choiceKey
|
|
919
|
+
const event = option.event
|
|
1112
920
|
const targetEl = event.target as Ref
|
|
1113
921
|
const swipeEnd = {
|
|
1114
922
|
x: event?.changedTouches[0]?.clientX || null,
|
|
@@ -1167,7 +975,6 @@ export default class Question extends Vue {
|
|
|
1167
975
|
if (this.showAnswers) {
|
|
1168
976
|
return
|
|
1169
977
|
}
|
|
1170
|
-
|
|
1171
978
|
const selectedChoices = this.selectedChoices
|
|
1172
979
|
const indexOfSelectedChoice = selectedChoices.indexOf(choiceKey)
|
|
1173
980
|
if (indexOfSelectedChoice !== -1) {
|
|
@@ -1191,7 +998,9 @@ export default class Question extends Vue {
|
|
|
1191
998
|
}
|
|
1192
999
|
|
|
1193
1000
|
if (focusChoice) {
|
|
1194
|
-
const
|
|
1001
|
+
const choiceContainerComp =
|
|
1002
|
+
this.$refs['uikit-question__choices-container'] as ComponentPublicInstance | undefined
|
|
1003
|
+
const choiceEl = choiceContainerComp?.$refs[`choice-${choiceKey}`] as HTMLElement | HTMLElement[];
|
|
1195
1004
|
('length' in choiceEl)
|
|
1196
1005
|
? choiceEl[0]?.focus()
|
|
1197
1006
|
: choiceEl.focus()
|
|
@@ -1230,17 +1039,21 @@ export default class Question extends Vue {
|
|
|
1230
1039
|
// eslint-disable-next-line max-len
|
|
1231
1040
|
mcrLongAltComp?.$refs['uikit-question-summary__summary-dropdown-explanation-img-description'] as HTMLElement | undefined
|
|
1232
1041
|
|
|
1233
|
-
const
|
|
1234
|
-
this.$refs['uikit-
|
|
1235
|
-
if (
|
|
1236
|
-
const
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1042
|
+
const choiceContainerComp =
|
|
1043
|
+
this.$refs['uikit-question__choices-container'] as ComponentPublicInstance | undefined
|
|
1044
|
+
if (choiceContainerComp) {
|
|
1045
|
+
const dropdownExplanationComp =
|
|
1046
|
+
// eslint-disable-next-line max-len
|
|
1047
|
+
choiceContainerComp.$refs['uikit-question-choices-container__dropdown-explanation'] as Ref[]
|
|
1048
|
+
if (dropdownExplanationComp) {
|
|
1049
|
+
const dropdownEl = dropdownExplanationComp[0] as ComponentPublicInstance | undefined
|
|
1050
|
+
const mobileImgDropdownImgDescription =
|
|
1051
|
+
// eslint-disable-next-line max-len
|
|
1052
|
+
dropdownEl?.$refs['uikit-question-dropdown-explanation__dropdown-explanation-img-description'] as HTMLElement | undefined
|
|
1053
|
+
|
|
1054
|
+
if (mobileImgDropdownImgDescription?.offsetParent) {
|
|
1055
|
+
mobileImgDropdownImgDescription.focus()
|
|
1056
|
+
}
|
|
1244
1057
|
}
|
|
1245
1058
|
}
|
|
1246
1059
|
|
|
@@ -2026,341 +1839,6 @@ export default class Question extends Vue {
|
|
|
2026
1839
|
}
|
|
2027
1840
|
}
|
|
2028
1841
|
|
|
2029
|
-
&__choices-container {
|
|
2030
|
-
display: contents;
|
|
2031
|
-
|
|
2032
|
-
&:not(:last-child) .uikit-question__choice-container {
|
|
2033
|
-
margin-bottom: 9px;
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
&__choice-container {
|
|
2038
|
-
display: flex;
|
|
2039
|
-
align-items: center;
|
|
2040
|
-
width: 100%;
|
|
2041
|
-
border-radius: 6px;
|
|
2042
|
-
cursor: default;
|
|
2043
|
-
position: relative;
|
|
2044
|
-
outline: none;
|
|
2045
|
-
transition: 0.1s width ease;
|
|
2046
|
-
|
|
2047
|
-
&::after {
|
|
2048
|
-
content: '';
|
|
2049
|
-
position: absolute;
|
|
2050
|
-
top: -1px;
|
|
2051
|
-
bottom: -1px;
|
|
2052
|
-
left: -1px;
|
|
2053
|
-
right: -1px;
|
|
2054
|
-
border: 1px solid rgba($pewter, 0.85);
|
|
2055
|
-
box-shadow: 0 1px 4px 0 rgba($ash, 0.3);
|
|
2056
|
-
border-radius: 6px;
|
|
2057
|
-
pointer-events: none;
|
|
2058
|
-
}
|
|
2059
|
-
|
|
2060
|
-
&--dark {
|
|
2061
|
-
&::after {
|
|
2062
|
-
border-color: $slate;
|
|
2063
|
-
box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
&--big {
|
|
2068
|
-
width: calc(100% + 10px);
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
&--hover {
|
|
2072
|
-
cursor: pointer;
|
|
2073
|
-
|
|
2074
|
-
&::after {
|
|
2075
|
-
display: block;
|
|
2076
|
-
top: -2px;
|
|
2077
|
-
bottom: -2px;
|
|
2078
|
-
left: -2px;
|
|
2079
|
-
right: -2px;
|
|
2080
|
-
border: 2px solid $slate;
|
|
2081
|
-
border-radius: 7px;
|
|
2082
|
-
}
|
|
2083
|
-
|
|
2084
|
-
&--dark::after {
|
|
2085
|
-
border-color: rgba($white, 0.6);
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
&--focus {
|
|
2090
|
-
&::after {
|
|
2091
|
-
display: block;
|
|
2092
|
-
border: 1px solid $brand-blue;
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
&--dark::after {
|
|
2096
|
-
border-color: $banana-bread;
|
|
2097
|
-
}
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
&--selected {
|
|
2101
|
-
&::after {
|
|
2102
|
-
display: block;
|
|
2103
|
-
border: 2px solid $brand-blue;
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
&:focus::before {
|
|
2107
|
-
content: '';
|
|
2108
|
-
position: absolute;
|
|
2109
|
-
top: -3px;
|
|
2110
|
-
bottom: -3px;
|
|
2111
|
-
left: -3px;
|
|
2112
|
-
right: -3px;
|
|
2113
|
-
border-radius: 7px;
|
|
2114
|
-
border: 1px solid $brand-blue;
|
|
2115
|
-
pointer-events: none;
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
&--dark::after {
|
|
2119
|
-
border-color: $banana-bread;
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
&--dark:hover::after {
|
|
2123
|
-
border-color: $butterscotch;
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
&--dark:focus::before {
|
|
2127
|
-
border-color: $banana-bread;
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
&--incorrect {
|
|
2132
|
-
&::after {
|
|
2133
|
-
display: block;
|
|
2134
|
-
border: 1px solid $pepper;
|
|
2135
|
-
}
|
|
2136
|
-
|
|
2137
|
-
&--dark::after {
|
|
2138
|
-
border-color: $rosa;
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
&--correct {
|
|
2143
|
-
&::after {
|
|
2144
|
-
display: block;
|
|
2145
|
-
border: 2px solid $cadaverous;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
&--dark::after {
|
|
2149
|
-
border-color: $jungle-green;
|
|
2150
|
-
}
|
|
2151
|
-
|
|
2152
|
-
.uikit-question__choice--big.uikit-question__choice--tablet-portrait {
|
|
2153
|
-
padding: 11px 38px 11px 17px;
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
.uikit-question__choice--big.uikit-question__choice--mobile {
|
|
2157
|
-
padding: 11px 21px 9px;
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
&__choice-letter {
|
|
2163
|
-
position: absolute;
|
|
2164
|
-
left: -26px;
|
|
2165
|
-
top: 50%;
|
|
2166
|
-
transform: translateY(calc(-50% + 2px));
|
|
2167
|
-
color: $slate-01;
|
|
2168
|
-
font-size: 14px;
|
|
2169
|
-
line-height: 17px;
|
|
2170
|
-
transition: 0.1s left ease;
|
|
2171
|
-
|
|
2172
|
-
&--dark {
|
|
2173
|
-
color: rgba($white, 0.6);
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
|
-
&--selected {
|
|
2177
|
-
color: $brand-blue;
|
|
2178
|
-
|
|
2179
|
-
&--dark {
|
|
2180
|
-
color: $banana-bread;
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
|
|
2184
|
-
&--correct {
|
|
2185
|
-
color: $victoria-green;
|
|
2186
|
-
|
|
2187
|
-
&--dark {
|
|
2188
|
-
color: $jungle-green;
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
|
-
&--incorrect {
|
|
2193
|
-
color: $lust;
|
|
2194
|
-
|
|
2195
|
-
&--dark {
|
|
2196
|
-
color: $rosa;
|
|
2197
|
-
}
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
|
-
&--big {
|
|
2201
|
-
left: -21px;
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2204
|
-
&--mobile {
|
|
2205
|
-
display: none;
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
&__choice {
|
|
2210
|
-
width: 100%;
|
|
2211
|
-
background-color: $white;
|
|
2212
|
-
border-radius: 5px;
|
|
2213
|
-
padding: 11px 46px 11px 15px;
|
|
2214
|
-
font-size: 16.5px;
|
|
2215
|
-
font-weight: 500;
|
|
2216
|
-
letter-spacing: -0.1px;
|
|
2217
|
-
line-height: 23px;
|
|
2218
|
-
position: relative;
|
|
2219
|
-
transition: 0.1s padding ease;
|
|
2220
|
-
|
|
2221
|
-
&--tablet-portrait {
|
|
2222
|
-
font-size: 16px;
|
|
2223
|
-
font-weight: 500;
|
|
2224
|
-
letter-spacing: -0.1px;
|
|
2225
|
-
line-height: 23px;
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
|
-
&--review-mode#{&}--distractor {
|
|
2229
|
-
color: $slate;
|
|
2230
|
-
|
|
2231
|
-
&--dark {
|
|
2232
|
-
color: $fog;
|
|
2233
|
-
}
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
|
-
&--strike {
|
|
2237
|
-
text-decoration: line-through;
|
|
2238
|
-
|
|
2239
|
-
&--dark:not(&--mcr) {
|
|
2240
|
-
color: #c5cbd1 !important;
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
|
|
2244
|
-
&--strike:not(&--mcr) {
|
|
2245
|
-
color: $pewter;
|
|
2246
|
-
}
|
|
2247
|
-
|
|
2248
|
-
&--strike#{&}--distractor#{&}--mcr {
|
|
2249
|
-
background-color: rgba($barely-background, 0.5);
|
|
2250
|
-
color: $ash;
|
|
2251
|
-
box-shadow: 0 1px 4px 0 rgba($fog, 0.4);
|
|
2252
|
-
|
|
2253
|
-
&--dark {
|
|
2254
|
-
background-color: rgba($moonlit-ocean, 0.5);
|
|
2255
|
-
box-shadow: 0 1px 4px 0 rgba($charcoal, 0.2);
|
|
2256
|
-
}
|
|
2257
|
-
}
|
|
2258
|
-
|
|
2259
|
-
&--selected {
|
|
2260
|
-
box-shadow: 0 1px 4px 0 rgba($brand-black, 0.12);
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
&--big {
|
|
2264
|
-
padding: 11px 51px 11px 20px;
|
|
2265
|
-
}
|
|
2266
|
-
|
|
2267
|
-
&--mcr {
|
|
2268
|
-
padding: 13px 46px 15px 50px;
|
|
2269
|
-
}
|
|
2270
|
-
|
|
2271
|
-
&--show-stats {
|
|
2272
|
-
padding-bottom: 23px;
|
|
2273
|
-
padding-right: 66px;
|
|
2274
|
-
}
|
|
2275
|
-
|
|
2276
|
-
&--dark {
|
|
2277
|
-
background-color: $brand-black;
|
|
2278
|
-
color: $gray-background;
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
p {
|
|
2282
|
-
margin: 0;
|
|
2283
|
-
}
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
&__mcr-checkbox {
|
|
2287
|
-
display: flex;
|
|
2288
|
-
justify-content: center;
|
|
2289
|
-
align-items: center;
|
|
2290
|
-
position: absolute;
|
|
2291
|
-
top: 15px;
|
|
2292
|
-
left: 15px;
|
|
2293
|
-
width: 21px;
|
|
2294
|
-
height: 21px;
|
|
2295
|
-
border: 1px solid rgba($slate-01, 0.5);
|
|
2296
|
-
border-radius: 2px;
|
|
2297
|
-
box-sizing: border-box;
|
|
2298
|
-
|
|
2299
|
-
&--dark {
|
|
2300
|
-
background: $barely-background;
|
|
2301
|
-
border-color: $barely-background;
|
|
2302
|
-
}
|
|
2303
|
-
|
|
2304
|
-
&--distractor--dark {
|
|
2305
|
-
background: transparent;
|
|
2306
|
-
border: 1px solid $pewter;
|
|
2307
|
-
}
|
|
2308
|
-
|
|
2309
|
-
&--selected {
|
|
2310
|
-
background-color: $brand-black;
|
|
2311
|
-
color: $white;
|
|
2312
|
-
|
|
2313
|
-
&--dark {
|
|
2314
|
-
background: $barely-background;
|
|
2315
|
-
color: $brand-black;
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
|
-
&--selected#{&}--distractor {
|
|
2320
|
-
background-color: rgba($slate-01, 0.5);
|
|
2321
|
-
color: $white;
|
|
2322
|
-
border: none;
|
|
2323
|
-
|
|
2324
|
-
&--dark {
|
|
2325
|
-
background-color: rgba($barely-background, 0.4);
|
|
2326
|
-
color: $brand-black;
|
|
2327
|
-
}
|
|
2328
|
-
}
|
|
2329
|
-
|
|
2330
|
-
&--selected#{&}--answer {
|
|
2331
|
-
background-color: $cadaverous;
|
|
2332
|
-
color: $white;
|
|
2333
|
-
border: none;
|
|
2334
|
-
|
|
2335
|
-
&--dark {
|
|
2336
|
-
background: $jungle-green;
|
|
2337
|
-
}
|
|
2338
|
-
}
|
|
2339
|
-
|
|
2340
|
-
&--answer:not(&--selected) {
|
|
2341
|
-
color: $cadaverous;
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
&--answer--dark:not(&--selected) {
|
|
2345
|
-
color: $jungle-green;
|
|
2346
|
-
background: transparent;
|
|
2347
|
-
border: 1px solid $pewter;
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
&--strike {
|
|
2351
|
-
border-color: $pewter;
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
|
-
&__mcr-check {
|
|
2356
|
-
width: 13px;
|
|
2357
|
-
height: 11px;
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
&__choice-text {
|
|
2361
|
-
outline: none;
|
|
2362
|
-
}
|
|
2363
|
-
|
|
2364
1842
|
&__toggle-explanation {
|
|
2365
1843
|
margin-top: 8px;
|
|
2366
1844
|
margin-bottom: 8px;
|