@pocketprep/ui-kit 3.0.38 → 3.1.0

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.
@@ -160,13 +160,30 @@ export default class EmptyState extends Vue {
160
160
  position: relative;
161
161
  }
162
162
 
163
+ &__icon {
164
+ width: 22px;
165
+ height: 22px;
166
+
167
+ @include breakpoint(black-bear) {
168
+ width: 30px;
169
+ height: 30px;
170
+ }
171
+ }
172
+
163
173
  &__blob {
164
174
  position: absolute;
165
175
  top: 3.5px;
166
- left: 1px;
167
- width: 38px;
176
+ left: 2px;
177
+ width: 37px;
168
178
  height: 33px;
169
179
  z-index: -1;
180
+
181
+ @include breakpoint(black-bear) {
182
+ width: 48px;
183
+ height: 43px;
184
+ top: auto;
185
+ left: auto;
186
+ }
170
187
  }
171
188
  }
172
189
  </style>
@@ -102,7 +102,7 @@
102
102
  :class="{
103
103
  'uikit-question__prompt--passage-and-image': question.passage || passageImageUrl,
104
104
  }"
105
- v-html="question.question"
105
+ v-html="question.prompt"
106
106
  />
107
107
  <PocketButton
108
108
  v-if="question.passage || passageImageUrl"
@@ -461,7 +461,7 @@
461
461
  'uikit-question__toggle-dropdown-explanation-img-description--open':
462
462
  showExplanationImageLongAlt,
463
463
  'uikit-question__toggle-dropdown-explanation-img-description--no-reference':
464
- !question.reference || hideReferences,
464
+ !reference || hideReferences,
465
465
  }"
466
466
  :is-dark-mode="isDarkMode"
467
467
  :aria-expanded="showExplanationImageLongAlt ? 'true' : 'false'"
@@ -490,12 +490,12 @@
490
490
  v-html="explanationImageLongAlt"
491
491
  />
492
492
  <div
493
- v-if="question.reference && !hideReferences"
493
+ v-if="reference && !hideReferences"
494
494
  v-dark="isDarkMode"
495
495
  class="uikit-question__dropdown-reference"
496
496
  >
497
497
  <span class="uikit-question__dropdown-reference-label">Reference: </span>
498
- <div v-html="question.reference" />
498
+ <div v-html="reference" />
499
499
  </div>
500
500
  </div>
501
501
  </div>
@@ -661,7 +661,7 @@
661
661
  'uikit-question__toggle-summary-dropdown-explanation-img-description--open':
662
662
  showExplanationImageLongAlt,
663
663
  'uikit-question__toggle-summary-dropdown-explanation-img-description--no-reference':
664
- !question.reference || hideReferences,
664
+ !reference || hideReferences,
665
665
  }"
666
666
  :is-dark-mode="isDarkMode"
667
667
  :aria-expanded="showExplanationImageLongAlt ? 'true' : 'false'"
@@ -690,12 +690,12 @@
690
690
  v-html="explanationImageLongAlt"
691
691
  />
692
692
  <div
693
- v-if="question.reference && !hideReferences"
693
+ v-if="reference && !hideReferences"
694
694
  v-dark="isDarkMode"
695
695
  class="uikit-question__summary-dropdown-reference"
696
696
  >
697
697
  <span class="uikit-question__summary-dropdown-reference-label">Reference: </span>
698
- <div v-html="question.reference" />
698
+ <div v-html="reference" />
699
699
  </div>
700
700
  </div>
701
701
  <Icon
@@ -924,12 +924,12 @@
924
924
  v-html="explanationImageLongAlt"
925
925
  />
926
926
  <div
927
- v-if="question.reference && !hideReferences"
927
+ v-if="reference && !hideReferences"
928
928
  v-dark="isDarkMode"
929
929
  class="uikit-question__reference"
930
930
  >
931
931
  <span class="uikit-question__reference-label">Reference: </span>
932
- <div v-html="question.reference" />
932
+ <div v-html="reference" />
933
933
  </div>
934
934
  <div
935
935
  v-if="!reviewMode"
@@ -1001,7 +1001,7 @@ type TViewNames = {
1001
1001
  },
1002
1002
  })
1003
1003
  export default class Question extends Vue {
1004
- @Prop() question!: Study.Class.ExamDataJSON
1004
+ @Prop() question!: Study.Class.QuestionJSON
1005
1005
  @Prop() questionNumber!: number
1006
1006
  @Prop() quizLength!: number
1007
1007
  @Prop({ default: '' }) imageUrlPrefix!: string
@@ -1094,33 +1094,31 @@ export default class Question extends Vue {
1094
1094
  }
1095
1095
 
1096
1096
  get passageImageUrl () {
1097
- const imageUrl = this.question.images?.passage?.url
1098
- || this.question.images?.Question // Legacy support - TODO: remove when `Question` is deprecated
1097
+ const imageUrl = this.question.passageImage?.url
1099
1098
 
1100
1099
  return imageUrl ? `${this.imageUrlPrefix}${imageUrl}` : null
1101
1100
  }
1102
1101
 
1103
1102
  get passageImageAlt () {
1104
- return this.question.images?.passage?.altText
1103
+ return this.question.passageImage?.altText
1105
1104
  }
1106
1105
 
1107
1106
  get passageImageLongAlt () {
1108
- return this.question.images?.passage?.longAltText
1107
+ return this.question.passageImage?.longAltText
1109
1108
  }
1110
1109
 
1111
1110
  get explanationImageUrl () {
1112
- const imageUrl = this.question.images?.explanation?.url
1113
- || this.question.images?.Explanation // Legacy support - TODO: remove when `Explanation` is deprecated
1111
+ const imageUrl = this.question.explanationImage?.url
1114
1112
 
1115
1113
  return imageUrl ? `${this.imageUrlPrefix}${imageUrl}` : null
1116
1114
  }
1117
1115
 
1118
1116
  get explanationImageAlt () {
1119
- return this.question.images?.explanation?.altText
1117
+ return this.question.explanationImage?.altText
1120
1118
  }
1121
1119
 
1122
1120
  get explanationImageLongAlt () {
1123
- return this.question.images?.explanation?.longAltText
1121
+ return this.question.explanationImage?.longAltText
1124
1122
  }
1125
1123
 
1126
1124
  get showPassageAndImage () {
@@ -1137,18 +1135,15 @@ export default class Question extends Vue {
1137
1135
  }
1138
1136
  }
1139
1137
 
1138
+ get reference () {
1139
+ return this.question.references?.length ? this.question.references.join('') : undefined
1140
+ }
1141
+
1140
1142
  get answers (): TChoice[] {
1141
- const answers = [
1142
- { text: this.question.answer, key: 'a1' },
1143
- { text: this.question.answer2, key: 'a2' },
1144
- { text: this.question.answer3, key: 'a3' },
1145
- { text: this.question.answer4, key: 'a4' },
1146
- { text: this.question.answer5, key: 'a5' },
1147
- { text: this.question.answer6, key: 'a6' },
1148
- { text: this.question.answer7, key: 'a7' },
1149
- { text: this.question.answer8, key: 'a8' },
1150
- { text: this.question.answer9, key: 'a9' },
1151
- ] as const
1143
+ const answers = this.question.choices.filter(choice => choice.isCorrect).map((choice, index) => ({
1144
+ text: choice.text,
1145
+ key: `a${index + 1}` as `a${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`,
1146
+ }))
1152
1147
 
1153
1148
  return answers.filter(choice => !!choice.text)
1154
1149
  }
@@ -1158,17 +1153,10 @@ export default class Question extends Vue {
1158
1153
  }
1159
1154
 
1160
1155
  get distractors (): TChoice[] {
1161
- const distractors = [
1162
- { text: this.question.distractor1, key: 'd1' },
1163
- { text: this.question.distractor2, key: 'd2' },
1164
- { text: this.question.distractor3, key: 'd3' },
1165
- { text: this.question.distractor4, key: 'd4' },
1166
- { text: this.question.distractor5, key: 'd5' },
1167
- { text: this.question.distractor6, key: 'd6' },
1168
- { text: this.question.distractor7, key: 'd7' },
1169
- { text: this.question.distractor8, key: 'd8' },
1170
- { text: this.question.distractor9, key: 'd9' },
1171
- ] as const
1156
+ const distractors = this.question.choices.filter(choice => !choice.isCorrect).map((choice, index) => ({
1157
+ text: choice.text,
1158
+ key: `d${index + 1}` as `d${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}`,
1159
+ }))
1172
1160
 
1173
1161
  return distractors.filter(choice => !!choice.text)
1174
1162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/ui-kit",
3
- "version": "3.0.38",
3
+ "version": "3.1.0",
4
4
  "description": "Pocket Prep UI Kit",
5
5
  "author": "pocketprep",
6
6
  "scripts": {
@@ -77,7 +77,7 @@
77
77
  "vue-facing-decorator": "2.1.20"
78
78
  },
79
79
  "devDependencies": {
80
- "@pocketprep/types": "1.8.10",
80
+ "@pocketprep/types": "1.11.1",
81
81
  "@tsconfig/node16": "1.0.3",
82
82
  "@types/node": "16.18.25",
83
83
  "@vitejs/plugin-vue": "4.2.1",