eat-js-sdk 1.0.17 → 1.0.19

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.
@@ -4437,17 +4437,23 @@
4437
4437
  };
4438
4438
  }
4439
4439
  function create_default_slot(ctx) {
4440
- let t2;
4441
- let if_block1_anchor;
4442
- let current;
4443
- let if_block0 = (
4440
+ let show_if = (
4444
4441
  /*correctAnswersLength*/
4445
4442
  ctx[6] === 1 && /*isFinished*/
4446
4443
  ctx[1] && (!/*isPreviewMode*/
4447
4444
  ctx[2] || /*isPreviewMode*/
4448
4445
  ctx[2] && /*isPreviewModeInteractive*/
4449
- ctx[3]) && create_if_block_82(ctx)
4446
+ ctx[3]) && !/*selectedOptions*/
4447
+ (ctx[4].length === 1 && /*correctAnswerIds*/
4448
+ ctx[7].includes(
4449
+ /*selectedOptions*/
4450
+ ctx[4][0]
4451
+ ))
4450
4452
  );
4453
+ let t2;
4454
+ let if_block1_anchor;
4455
+ let current;
4456
+ let if_block0 = show_if && create_if_block_82(ctx);
4451
4457
  let if_block1 = (
4452
4458
  /*options*/
4453
4459
  ctx[11] && create_if_block5(ctx)
@@ -4471,18 +4477,24 @@
4471
4477
  current = true;
4472
4478
  },
4473
4479
  p(ctx2, dirty) {
4474
- if (
4475
- /*correctAnswersLength*/
4480
+ if (dirty & /*correctAnswersLength, isFinished, isPreviewMode, isPreviewModeInteractive, selectedOptions, correctAnswerIds*/
4481
+ 222)
4482
+ show_if = /*correctAnswersLength*/
4476
4483
  ctx2[6] === 1 && /*isFinished*/
4477
4484
  ctx2[1] && (!/*isPreviewMode*/
4478
4485
  ctx2[2] || /*isPreviewMode*/
4479
4486
  ctx2[2] && /*isPreviewModeInteractive*/
4480
- ctx2[3])
4481
- ) {
4487
+ ctx2[3]) && !/*selectedOptions*/
4488
+ (ctx2[4].length === 1 && /*correctAnswerIds*/
4489
+ ctx2[7].includes(
4490
+ /*selectedOptions*/
4491
+ ctx2[4][0]
4492
+ ));
4493
+ if (show_if) {
4482
4494
  if (if_block0) {
4483
4495
  if_block0.p(ctx2, dirty);
4484
- if (dirty & /*correctAnswersLength, isFinished, isPreviewMode, isPreviewModeInteractive*/
4485
- 78) {
4496
+ if (dirty & /*correctAnswersLength, isFinished, isPreviewMode, isPreviewModeInteractive, selectedOptions, correctAnswerIds*/
4497
+ 222) {
4486
4498
  transition_in(if_block0, 1);
4487
4499
  }
4488
4500
  } else {
@@ -5108,14 +5120,14 @@
5108
5120
  // src/lib/components/prompt/typein/PromptTypeIn.svelte
5109
5121
  function get_each_context2(ctx, list, i) {
5110
5122
  const child_ctx = ctx.slice();
5111
- child_ctx[58] = list[i];
5112
- child_ctx[60] = i;
5123
+ child_ctx[62] = list[i];
5124
+ child_ctx[64] = i;
5113
5125
  return child_ctx;
5114
5126
  }
5115
5127
  function get_each_context_1(ctx, list, i) {
5116
5128
  const child_ctx = ctx.slice();
5117
- child_ctx[61] = list[i];
5118
- child_ctx[63] = i;
5129
+ child_ctx[65] = list[i];
5130
+ child_ctx[67] = i;
5119
5131
  return child_ctx;
5120
5132
  }
5121
5133
  function create_else_block_3(ctx) {
@@ -5132,7 +5144,7 @@
5132
5144
  textarea,
5133
5145
  "aria-label",
5134
5146
  /*textAriaLabel*/
5135
- ctx[18]
5147
+ ctx[20]
5136
5148
  );
5137
5149
  attr(
5138
5150
  textarea,
@@ -5150,7 +5162,7 @@
5150
5162
  ctx[2];
5151
5163
  attr(textarea, "autocomplete", "off");
5152
5164
  textarea.readOnly = /*isReadonlyText*/
5153
- ctx[25];
5165
+ ctx[27];
5154
5166
  },
5155
5167
  m(target, anchor) {
5156
5168
  insert(target, textarea, anchor);
@@ -5165,38 +5177,38 @@
5165
5177
  textarea,
5166
5178
  "input",
5167
5179
  /*textarea_input_handler*/
5168
- ctx[36]
5180
+ ctx[38]
5169
5181
  ),
5170
5182
  listen(
5171
5183
  textarea,
5172
5184
  "mousedown",
5173
5185
  /*mousedown_handler*/
5174
- ctx[37]
5186
+ ctx[39]
5175
5187
  ),
5176
5188
  listen(
5177
5189
  textarea,
5178
5190
  "touchstart",
5179
5191
  /*touchstart_handler*/
5180
- ctx[38],
5192
+ ctx[40],
5181
5193
  { passive: true }
5182
5194
  ),
5183
5195
  listen(
5184
5196
  textarea,
5185
5197
  "focus",
5186
5198
  /*focus_handler*/
5187
- ctx[39]
5199
+ ctx[41]
5188
5200
  ),
5189
5201
  listen(
5190
5202
  textarea,
5191
5203
  "focusout",
5192
5204
  /*focusout_handler_1*/
5193
- ctx[40]
5205
+ ctx[42]
5194
5206
  ),
5195
5207
  listen(
5196
5208
  textarea,
5197
5209
  "keydown",
5198
5210
  /*keydown_handler_1*/
5199
- ctx[41]
5211
+ ctx[43]
5200
5212
  ),
5201
5213
  action_destroyer(autosize_action = svelte_autosize_default.call(null, textarea))
5202
5214
  ];
@@ -5205,12 +5217,12 @@
5205
5217
  },
5206
5218
  p(ctx2, dirty) {
5207
5219
  if (dirty[0] & /*textAriaLabel*/
5208
- 262144) {
5220
+ 1048576) {
5209
5221
  attr(
5210
5222
  textarea,
5211
5223
  "aria-label",
5212
5224
  /*textAriaLabel*/
5213
- ctx2[18]
5225
+ ctx2[20]
5214
5226
  );
5215
5227
  }
5216
5228
  if (dirty[0] & /*placeholder*/
@@ -5269,7 +5281,7 @@
5269
5281
  input,
5270
5282
  "aria-label",
5271
5283
  /*textAriaLabel*/
5272
- ctx[18]
5284
+ ctx[20]
5273
5285
  );
5274
5286
  attr(
5275
5287
  input,
@@ -5286,7 +5298,7 @@
5286
5298
  ctx[2];
5287
5299
  attr(input, "autocomplete", "off");
5288
5300
  input.readOnly = /*isReadonlyText*/
5289
- ctx[25];
5301
+ ctx[27];
5290
5302
  },
5291
5303
  m(target, anchor) {
5292
5304
  insert(target, input, anchor);
@@ -5301,19 +5313,19 @@
5301
5313
  input,
5302
5314
  "input",
5303
5315
  /*input_input_handler*/
5304
- ctx[33]
5316
+ ctx[35]
5305
5317
  ),
5306
5318
  listen(
5307
5319
  input,
5308
5320
  "focusout",
5309
5321
  /*focusout_handler*/
5310
- ctx[34]
5322
+ ctx[36]
5311
5323
  ),
5312
5324
  listen(
5313
5325
  input,
5314
5326
  "keydown",
5315
5327
  /*keydown_handler*/
5316
- ctx[35]
5328
+ ctx[37]
5317
5329
  )
5318
5330
  ];
5319
5331
  mounted = true;
@@ -5321,12 +5333,12 @@
5321
5333
  },
5322
5334
  p(ctx2, dirty) {
5323
5335
  if (dirty[0] & /*textAriaLabel*/
5324
- 262144) {
5336
+ 1048576) {
5325
5337
  attr(
5326
5338
  input,
5327
5339
  "aria-label",
5328
5340
  /*textAriaLabel*/
5329
- ctx2[18]
5341
+ ctx2[20]
5330
5342
  );
5331
5343
  }
5332
5344
  if (dirty[0] & /*placeholder*/
@@ -5504,7 +5516,7 @@
5504
5516
  m(target, anchor) {
5505
5517
  insert(target, div0, anchor);
5506
5518
  mount_component(commonstringtohtml, div0, null);
5507
- ctx[32](div0);
5519
+ ctx[34](div0);
5508
5520
  insert(target, t0, anchor);
5509
5521
  insert(target, div1, anchor);
5510
5522
  insert(target, t1, anchor);
@@ -5543,7 +5555,7 @@
5543
5555
  detach(div2);
5544
5556
  }
5545
5557
  destroy_component(commonstringtohtml);
5546
- ctx[32](null);
5558
+ ctx[34](null);
5547
5559
  }
5548
5560
  };
5549
5561
  }
@@ -5555,12 +5567,12 @@
5555
5567
  let if_block2_anchor;
5556
5568
  let current;
5557
5569
  let if_block0 = !/*isInlineTypein*/
5558
- ctx[24] && create_if_block_63(ctx);
5570
+ ctx[26] && create_if_block_63(ctx);
5559
5571
  const if_block_creators = [create_if_block_43, create_if_block_53];
5560
5572
  const if_blocks = [];
5561
5573
  function select_block_type_3(ctx2, dirty) {
5562
5574
  if (!/*isInlineTypein*/
5563
- ctx2[24])
5575
+ ctx2[26])
5564
5576
  return 0;
5565
5577
  if (!/*isResultCorrect*/
5566
5578
  ctx2[1])
@@ -5572,7 +5584,7 @@
5572
5584
  }
5573
5585
  let if_block2 = (
5574
5586
  /*isInlineTypein*/
5575
- ctx[24] && (!/*isPreviewMode*/
5587
+ ctx[26] && (!/*isPreviewMode*/
5576
5588
  ctx[3] || /*isPreviewModeInteractive*/
5577
5589
  ctx[4]) && create_if_block_16(ctx)
5578
5590
  );
@@ -5603,7 +5615,7 @@
5603
5615
  },
5604
5616
  p(ctx2, dirty) {
5605
5617
  if (!/*isInlineTypein*/
5606
- ctx2[24])
5618
+ ctx2[26])
5607
5619
  if_block0.p(ctx2, dirty);
5608
5620
  let previous_block_index = current_block_type_index;
5609
5621
  current_block_type_index = select_block_type_3(ctx2, dirty);
@@ -5635,7 +5647,7 @@
5635
5647
  }
5636
5648
  if (
5637
5649
  /*isInlineTypein*/
5638
- ctx2[24] && (!/*isPreviewMode*/
5650
+ ctx2[26] && (!/*isPreviewMode*/
5639
5651
  ctx2[3] || /*isPreviewModeInteractive*/
5640
5652
  ctx2[4])
5641
5653
  ) {
@@ -5728,7 +5740,7 @@
5728
5740
  attr(span1, "class", "p2");
5729
5741
  attr(div, "aria-hidden", "true");
5730
5742
  attr(div, "class", div_class_value = "flex items-center text-charcoal " + /*typeinType*/
5731
- (ctx[23] === TYPEIN_TYPE_SHORT ? "mt-2" : "mt-0.5"));
5743
+ (ctx[25] === TYPEIN_TYPE_SHORT ? "mt-2" : "mt-0.5"));
5732
5744
  },
5733
5745
  m(target, anchor) {
5734
5746
  insert(target, div, anchor);
@@ -5852,11 +5864,8 @@
5852
5864
  ctx[1]
5853
5865
  ),
5854
5866
  resultFeedback: (
5855
- /*isSkippedAnswer*/
5856
- ctx[10] ? "" : (
5857
- /*resultFeedback*/
5858
- ctx[8]
5859
- )
5867
+ /*computedFeedback*/
5868
+ ctx[18]
5860
5869
  ),
5861
5870
  isSkipped: (
5862
5871
  /*isSkippedAnswer*/
@@ -5866,9 +5875,8 @@
5866
5875
  ctx[1] || /*isSkippedAnswer*/
5867
5876
  ctx[10],
5868
5877
  resultFeedbackTitle: (
5869
- /*isResultCorrect*/
5870
- ctx[1] || /*isSkippedAnswer*/
5871
- ctx[10] ? "" : "Why they got it wrong"
5878
+ /*computedFeedbackTitle*/
5879
+ ctx[19]
5872
5880
  )
5873
5881
  }
5874
5882
  });
@@ -5886,13 +5894,10 @@
5886
5894
  2)
5887
5895
  promptresultv2_changes.isResultCorrect = /*isResultCorrect*/
5888
5896
  ctx2[1];
5889
- if (dirty[0] & /*isSkippedAnswer, resultFeedback*/
5890
- 1280)
5891
- promptresultv2_changes.resultFeedback = /*isSkippedAnswer*/
5892
- ctx2[10] ? "" : (
5893
- /*resultFeedback*/
5894
- ctx2[8]
5895
- );
5897
+ if (dirty[0] & /*computedFeedback*/
5898
+ 262144)
5899
+ promptresultv2_changes.resultFeedback = /*computedFeedback*/
5900
+ ctx2[18];
5896
5901
  if (dirty[0] & /*isSkippedAnswer*/
5897
5902
  1024)
5898
5903
  promptresultv2_changes.isSkipped = /*isSkippedAnswer*/
@@ -5902,11 +5907,10 @@
5902
5907
  promptresultv2_changes.hasIcon = !/*isResultCorrect*/
5903
5908
  ctx2[1] || /*isSkippedAnswer*/
5904
5909
  ctx2[10];
5905
- if (dirty[0] & /*isResultCorrect, isSkippedAnswer*/
5906
- 1026)
5907
- promptresultv2_changes.resultFeedbackTitle = /*isResultCorrect*/
5908
- ctx2[1] || /*isSkippedAnswer*/
5909
- ctx2[10] ? "" : "Why they got it wrong";
5910
+ if (dirty[0] & /*computedFeedbackTitle*/
5911
+ 524288)
5912
+ promptresultv2_changes.resultFeedbackTitle = /*computedFeedbackTitle*/
5913
+ ctx2[19];
5910
5914
  promptresultv2.$set(promptresultv2_changes);
5911
5915
  },
5912
5916
  i(local) {
@@ -6006,7 +6010,7 @@
6006
6010
  },
6007
6011
  p(ctx2, dirty) {
6008
6012
  if (dirty[0] & /*inlineIteration, inlineAnswerResult, correctAnswerDataLength, sessionId, inlineTypeinAnswer, correctAnswerData*/
6009
- 754208) {
6013
+ 2327072) {
6010
6014
  each_value = ensure_array_like(
6011
6015
  /*correctAnswerData*/
6012
6016
  ctx2[16]
@@ -6068,7 +6072,7 @@
6068
6072
  /*inlineAnswerResult*/
6069
6073
  ctx2[15][
6070
6074
  /*itemIndex*/
6071
- ctx2[60]
6075
+ ctx2[64]
6072
6076
  ]
6073
6077
  )
6074
6078
  return 0;
@@ -6084,7 +6088,7 @@
6084
6088
  attr(span0, "class", span0_class_value = /*inlineAnswerResult*/
6085
6089
  (ctx[15][
6086
6090
  /*itemIndex*/
6087
- ctx[60]
6091
+ ctx[64]
6088
6092
  ] ? "text-green-900" : "text-red-900") + " p-0.5");
6089
6093
  attr(span1, "class", "w-6 h-6 absolute right-4 top-3 bottom-0 my-auto flex item-center justify-center");
6090
6094
  },
@@ -6116,7 +6120,7 @@
6116
6120
  32768 && span0_class_value !== (span0_class_value = /*inlineAnswerResult*/
6117
6121
  (ctx2[15][
6118
6122
  /*itemIndex*/
6119
- ctx2[60]
6123
+ ctx2[64]
6120
6124
  ] ? "text-green-900" : "text-red-900") + " p-0.5")) {
6121
6125
  attr(span0, "class", span0_class_value);
6122
6126
  }
@@ -6198,7 +6202,7 @@
6198
6202
  let p;
6199
6203
  let t0_value = useIsEven(
6200
6204
  /*iterationIndex*/
6201
- ctx[63]
6205
+ ctx[67]
6202
6206
  ) ? `Student's` : "Correct";
6203
6207
  let t0;
6204
6208
  let t1;
@@ -6222,7 +6226,7 @@
6222
6226
  let t6;
6223
6227
  let show_if = useIsEven(
6224
6228
  /*iterationIndex*/
6225
- ctx[63]
6229
+ ctx[67]
6226
6230
  );
6227
6231
  let div0_class_value;
6228
6232
  let div1_class_value;
@@ -6243,7 +6247,7 @@
6243
6247
  t3 = space();
6244
6248
  span1 = element("span");
6245
6249
  span1.textContent = `${/*itemIndex*/
6246
- ctx[60] + 1}`;
6250
+ ctx[64] + 1}`;
6247
6251
  t5 = space();
6248
6252
  textarea = element("textarea");
6249
6253
  t6 = space();
@@ -6251,130 +6255,130 @@
6251
6255
  if_block.c();
6252
6256
  attr(p, "class", p_class_value = "text-base text-charcoal font-semibold " + (useIsEven(
6253
6257
  /*iterationIndex*/
6254
- ctx[63]
6258
+ ctx[67]
6255
6259
  ) && /*itemIndex*/
6256
- ctx[60] !== 0 ? "hidden" : !useIsEven(
6260
+ ctx[64] !== 0 ? "hidden" : !useIsEven(
6257
6261
  /*iterationIndex*/
6258
- ctx[63]
6262
+ ctx[67]
6259
6263
  ) && /*itemIndex*/
6260
- ctx[60] !== 0 ? "mt-2 md:mt-0 md:hidden" : !useIsEven(
6264
+ ctx[64] !== 0 ? "mt-2 md:mt-0 md:hidden" : !useIsEven(
6261
6265
  /*iterationIndex*/
6262
- ctx[63]
6266
+ ctx[67]
6263
6267
  ) && /*itemIndex*/
6264
- ctx[60] === 0 ? "mt-2 md:mt-0" : (
6268
+ ctx[64] === 0 ? "mt-2 md:mt-0" : (
6265
6269
  /*itemIndex*/
6266
- ctx[60] === 0 ? "" : ""
6270
+ ctx[64] === 0 ? "" : ""
6267
6271
  )) + " " + (!useIsEven(
6268
6272
  /*iterationIndex*/
6269
- ctx[63]
6273
+ ctx[67]
6270
6274
  ) && /*inlineAnswerResult*/
6271
6275
  ctx[15][
6272
6276
  /*itemIndex*/
6273
- ctx[60]
6277
+ ctx[64]
6274
6278
  ] ? "hidden md:block" : ""));
6275
6279
  attr(span0, "class", "absolute inset-0 bottom-[7px] bg-black opacity-5 rounded-l-lg w-8.5 top-1");
6276
6280
  attr(span1, "class", "absolute font-semibold text-base leading-[19px] text-charcoal px-3 inline-block top-1/2 -translate-y-1/2 -mt-0.5");
6277
6281
  attr(label, "for", label_for_value = `${/*iterationIndex*/
6278
- ctx[63]}-${/*sessionId*/
6282
+ ctx[67]}-${/*sessionId*/
6279
6283
  ctx[5]}-${/*itemIndex*/
6280
- ctx[60]}`);
6284
+ ctx[64]}`);
6281
6285
  attr(label, "class", label_class_value = "absolute left-0 top-[13px] bottom-0 " + /*correctAnswerDataLength*/
6282
6286
  (ctx[17] > 1 && !useIsEven(
6283
6287
  /*iterationIndex*/
6284
- ctx[63]
6288
+ ctx[67]
6285
6289
  ) ? "hidden md:inline-block" : (
6286
6290
  /*correctAnswerDataLength*/
6287
6291
  ctx[17] > 1 && useIsEven(
6288
6292
  /*iterationIndex*/
6289
- ctx[63]
6293
+ ctx[67]
6290
6294
  ) ? "" : "hidden"
6291
6295
  )));
6292
6296
  attr(label, "aria-hidden", "true");
6293
6297
  attr(textarea, "aria-label", textarea_aria_label_value = `${useIsEven(
6294
6298
  /*iterationIndex*/
6295
- ctx[63]
6299
+ ctx[67]
6296
6300
  ) ? `Student's` : "Correct"} answer${useIsEven(
6297
6301
  /*iterationIndex*/
6298
- ctx[63]
6302
+ ctx[67]
6299
6303
  ) && /*inlineAnswerResult*/
6300
6304
  ctx[15][
6301
6305
  /*itemIndex*/
6302
- ctx[60]
6306
+ ctx[64]
6303
6307
  ] ? " (Correct)" : useIsEven(
6304
6308
  /*iterationIndex*/
6305
- ctx[63]
6309
+ ctx[67]
6306
6310
  ) && !/*inlineAnswerResult*/
6307
6311
  ctx[15][
6308
6312
  /*itemIndex*/
6309
- ctx[60]
6313
+ ctx[64]
6310
6314
  ] ? " (Incorrect)" : ""}, Item number ${/*itemIndex*/
6311
- ctx[60] + 1}:`);
6315
+ ctx[64] + 1}:`);
6312
6316
  attr(textarea, "class", textarea_class_value = "typein-textbox py-[9px] pr-4 mt-4 " + /*correctAnswerDataLength*/
6313
6317
  (ctx[17] > 1 && !useIsEven(
6314
6318
  /*iterationIndex*/
6315
- ctx[63]
6319
+ ctx[67]
6316
6320
  ) ? "md:pl-13.2" : (
6317
6321
  /*correctAnswerDataLength*/
6318
6322
  ctx[17] > 1 && useIsEven(
6319
6323
  /*iterationIndex*/
6320
- ctx[63]
6324
+ ctx[67]
6321
6325
  ) ? "pl-13.2" : ""
6322
6326
  )) + " " + (useIsEven(
6323
6327
  /*iterationIndex*/
6324
- ctx[63]
6328
+ ctx[67]
6325
6329
  ) ? "!pr-11" : "") + " " + (useIsEven(
6326
6330
  /*iterationIndex*/
6327
- ctx[63]
6331
+ ctx[67]
6328
6332
  ) && /*inlineAnswerResult*/
6329
6333
  ctx[15][
6330
6334
  /*itemIndex*/
6331
- ctx[60]
6335
+ ctx[64]
6332
6336
  ] ? "border-2 border-green-900" : useIsEven(
6333
6337
  /*iterationIndex*/
6334
- ctx[63]
6338
+ ctx[67]
6335
6339
  ) && !/*inlineAnswerResult*/
6336
6340
  ctx[15][
6337
6341
  /*itemIndex*/
6338
- ctx[60]
6342
+ ctx[64]
6339
6343
  ] ? "border-2 border-red-900 bg-red-50" : ""));
6340
6344
  attr(textarea, "id", textarea_id_value = `${/*iterationIndex*/
6341
- ctx[63]}-${/*sessionId*/
6345
+ ctx[67]}-${/*sessionId*/
6342
6346
  ctx[5]}-${/*itemIndex*/
6343
- ctx[60]}`);
6347
+ ctx[64]}`);
6344
6348
  textarea.value = textarea_value_value = useIsEven(
6345
6349
  /*iterationIndex*/
6346
- ctx[63]
6350
+ ctx[67]
6347
6351
  ) ? (
6348
6352
  /*inlineTypeinAnswer*/
6349
6353
  ctx[9][
6350
6354
  /*itemIndex*/
6351
- ctx[60]
6355
+ ctx[64]
6352
6356
  ] || "No answer provided"
6353
6357
  ) : (
6354
6358
  /*item*/
6355
- ctx[58][0]
6359
+ ctx[62][0]
6356
6360
  );
6357
6361
  attr(textarea, "rows", "1");
6358
6362
  textarea.readOnly = true;
6359
6363
  attr(textarea, "tabindex", textarea_tabindex_value = !useIsEven(
6360
6364
  /*iterationIndex*/
6361
- ctx[63]
6365
+ ctx[67]
6362
6366
  ) && /*inlineAnswerResult*/
6363
6367
  ctx[15][
6364
6368
  /*itemIndex*/
6365
- ctx[60]
6369
+ ctx[64]
6366
6370
  ] ? "-1" : "");
6367
6371
  attr(div0, "class", div0_class_value = "h-fit relative " + (!useIsEven(
6368
6372
  /*iterationIndex*/
6369
- ctx[63]
6373
+ ctx[67]
6370
6374
  ) && /*inlineAnswerResult*/
6371
6375
  ctx[15][
6372
6376
  /*itemIndex*/
6373
- ctx[60]
6377
+ ctx[64]
6374
6378
  ] ? "hidden md:block" : ""));
6375
6379
  attr(div1, "class", div1_class_value = "flex flex-col md:w-1/2 " + (useIsEven(
6376
6380
  /*iterationIndex*/
6377
- ctx[63]
6381
+ ctx[67]
6378
6382
  ) ? "md:pr-4" : "ml-8.5 md:ml-0 md:pl-4"));
6379
6383
  },
6380
6384
  m(target, anchor) {
@@ -6403,46 +6407,46 @@
6403
6407
  if (!current || dirty[0] & /*inlineAnswerResult*/
6404
6408
  32768 && p_class_value !== (p_class_value = "text-base text-charcoal font-semibold " + (useIsEven(
6405
6409
  /*iterationIndex*/
6406
- ctx2[63]
6410
+ ctx2[67]
6407
6411
  ) && /*itemIndex*/
6408
- ctx2[60] !== 0 ? "hidden" : !useIsEven(
6412
+ ctx2[64] !== 0 ? "hidden" : !useIsEven(
6409
6413
  /*iterationIndex*/
6410
- ctx2[63]
6414
+ ctx2[67]
6411
6415
  ) && /*itemIndex*/
6412
- ctx2[60] !== 0 ? "mt-2 md:mt-0 md:hidden" : !useIsEven(
6416
+ ctx2[64] !== 0 ? "mt-2 md:mt-0 md:hidden" : !useIsEven(
6413
6417
  /*iterationIndex*/
6414
- ctx2[63]
6418
+ ctx2[67]
6415
6419
  ) && /*itemIndex*/
6416
- ctx2[60] === 0 ? "mt-2 md:mt-0" : (
6420
+ ctx2[64] === 0 ? "mt-2 md:mt-0" : (
6417
6421
  /*itemIndex*/
6418
- ctx2[60] === 0 ? "" : ""
6422
+ ctx2[64] === 0 ? "" : ""
6419
6423
  )) + " " + (!useIsEven(
6420
6424
  /*iterationIndex*/
6421
- ctx2[63]
6425
+ ctx2[67]
6422
6426
  ) && /*inlineAnswerResult*/
6423
6427
  ctx2[15][
6424
6428
  /*itemIndex*/
6425
- ctx2[60]
6429
+ ctx2[64]
6426
6430
  ] ? "hidden md:block" : ""))) {
6427
6431
  attr(p, "class", p_class_value);
6428
6432
  }
6429
6433
  if (!current || dirty[0] & /*sessionId*/
6430
6434
  32 && label_for_value !== (label_for_value = `${/*iterationIndex*/
6431
- ctx2[63]}-${/*sessionId*/
6435
+ ctx2[67]}-${/*sessionId*/
6432
6436
  ctx2[5]}-${/*itemIndex*/
6433
- ctx2[60]}`)) {
6437
+ ctx2[64]}`)) {
6434
6438
  attr(label, "for", label_for_value);
6435
6439
  }
6436
6440
  if (!current || dirty[0] & /*correctAnswerDataLength*/
6437
6441
  131072 && label_class_value !== (label_class_value = "absolute left-0 top-[13px] bottom-0 " + /*correctAnswerDataLength*/
6438
6442
  (ctx2[17] > 1 && !useIsEven(
6439
6443
  /*iterationIndex*/
6440
- ctx2[63]
6444
+ ctx2[67]
6441
6445
  ) ? "hidden md:inline-block" : (
6442
6446
  /*correctAnswerDataLength*/
6443
6447
  ctx2[17] > 1 && useIsEven(
6444
6448
  /*iterationIndex*/
6445
- ctx2[63]
6449
+ ctx2[67]
6446
6450
  ) ? "" : "hidden"
6447
6451
  )))) {
6448
6452
  attr(label, "class", label_class_value);
@@ -6450,87 +6454,87 @@
6450
6454
  if (!current || dirty[0] & /*inlineAnswerResult*/
6451
6455
  32768 && textarea_aria_label_value !== (textarea_aria_label_value = `${useIsEven(
6452
6456
  /*iterationIndex*/
6453
- ctx2[63]
6457
+ ctx2[67]
6454
6458
  ) ? `Student's` : "Correct"} answer${useIsEven(
6455
6459
  /*iterationIndex*/
6456
- ctx2[63]
6460
+ ctx2[67]
6457
6461
  ) && /*inlineAnswerResult*/
6458
6462
  ctx2[15][
6459
6463
  /*itemIndex*/
6460
- ctx2[60]
6464
+ ctx2[64]
6461
6465
  ] ? " (Correct)" : useIsEven(
6462
6466
  /*iterationIndex*/
6463
- ctx2[63]
6467
+ ctx2[67]
6464
6468
  ) && !/*inlineAnswerResult*/
6465
6469
  ctx2[15][
6466
6470
  /*itemIndex*/
6467
- ctx2[60]
6471
+ ctx2[64]
6468
6472
  ] ? " (Incorrect)" : ""}, Item number ${/*itemIndex*/
6469
- ctx2[60] + 1}:`)) {
6473
+ ctx2[64] + 1}:`)) {
6470
6474
  attr(textarea, "aria-label", textarea_aria_label_value);
6471
6475
  }
6472
6476
  if (!current || dirty[0] & /*correctAnswerDataLength, inlineAnswerResult*/
6473
6477
  163840 && textarea_class_value !== (textarea_class_value = "typein-textbox py-[9px] pr-4 mt-4 " + /*correctAnswerDataLength*/
6474
6478
  (ctx2[17] > 1 && !useIsEven(
6475
6479
  /*iterationIndex*/
6476
- ctx2[63]
6480
+ ctx2[67]
6477
6481
  ) ? "md:pl-13.2" : (
6478
6482
  /*correctAnswerDataLength*/
6479
6483
  ctx2[17] > 1 && useIsEven(
6480
6484
  /*iterationIndex*/
6481
- ctx2[63]
6485
+ ctx2[67]
6482
6486
  ) ? "pl-13.2" : ""
6483
6487
  )) + " " + (useIsEven(
6484
6488
  /*iterationIndex*/
6485
- ctx2[63]
6489
+ ctx2[67]
6486
6490
  ) ? "!pr-11" : "") + " " + (useIsEven(
6487
6491
  /*iterationIndex*/
6488
- ctx2[63]
6492
+ ctx2[67]
6489
6493
  ) && /*inlineAnswerResult*/
6490
6494
  ctx2[15][
6491
6495
  /*itemIndex*/
6492
- ctx2[60]
6496
+ ctx2[64]
6493
6497
  ] ? "border-2 border-green-900" : useIsEven(
6494
6498
  /*iterationIndex*/
6495
- ctx2[63]
6499
+ ctx2[67]
6496
6500
  ) && !/*inlineAnswerResult*/
6497
6501
  ctx2[15][
6498
6502
  /*itemIndex*/
6499
- ctx2[60]
6503
+ ctx2[64]
6500
6504
  ] ? "border-2 border-red-900 bg-red-50" : ""))) {
6501
6505
  attr(textarea, "class", textarea_class_value);
6502
6506
  }
6503
6507
  if (!current || dirty[0] & /*sessionId*/
6504
6508
  32 && textarea_id_value !== (textarea_id_value = `${/*iterationIndex*/
6505
- ctx2[63]}-${/*sessionId*/
6509
+ ctx2[67]}-${/*sessionId*/
6506
6510
  ctx2[5]}-${/*itemIndex*/
6507
- ctx2[60]}`)) {
6511
+ ctx2[64]}`)) {
6508
6512
  attr(textarea, "id", textarea_id_value);
6509
6513
  }
6510
6514
  if (!current || dirty[0] & /*inlineTypeinAnswer, correctAnswerData*/
6511
6515
  66048 && textarea_value_value !== (textarea_value_value = useIsEven(
6512
6516
  /*iterationIndex*/
6513
- ctx2[63]
6517
+ ctx2[67]
6514
6518
  ) ? (
6515
6519
  /*inlineTypeinAnswer*/
6516
6520
  ctx2[9][
6517
6521
  /*itemIndex*/
6518
- ctx2[60]
6522
+ ctx2[64]
6519
6523
  ] || "No answer provided"
6520
6524
  ) : (
6521
6525
  /*item*/
6522
- ctx2[58][0]
6526
+ ctx2[62][0]
6523
6527
  ))) {
6524
6528
  textarea.value = textarea_value_value;
6525
6529
  }
6526
6530
  if (!current || dirty[0] & /*inlineAnswerResult*/
6527
6531
  32768 && textarea_tabindex_value !== (textarea_tabindex_value = !useIsEven(
6528
6532
  /*iterationIndex*/
6529
- ctx2[63]
6533
+ ctx2[67]
6530
6534
  ) && /*inlineAnswerResult*/
6531
6535
  ctx2[15][
6532
6536
  /*itemIndex*/
6533
- ctx2[60]
6537
+ ctx2[64]
6534
6538
  ] ? "-1" : "")) {
6535
6539
  attr(textarea, "tabindex", textarea_tabindex_value);
6536
6540
  }
@@ -6539,11 +6543,11 @@
6539
6543
  if (!current || dirty[0] & /*inlineAnswerResult*/
6540
6544
  32768 && div0_class_value !== (div0_class_value = "h-fit relative " + (!useIsEven(
6541
6545
  /*iterationIndex*/
6542
- ctx2[63]
6546
+ ctx2[67]
6543
6547
  ) && /*inlineAnswerResult*/
6544
6548
  ctx2[15][
6545
6549
  /*itemIndex*/
6546
- ctx2[60]
6550
+ ctx2[64]
6547
6551
  ] ? "hidden md:block" : ""))) {
6548
6552
  attr(div0, "class", div0_class_value);
6549
6553
  }
@@ -6575,7 +6579,7 @@
6575
6579
  let current;
6576
6580
  let each_value_1 = ensure_array_like(
6577
6581
  /*inlineIteration*/
6578
- ctx[19]
6582
+ ctx[21]
6579
6583
  );
6580
6584
  let each_blocks = [];
6581
6585
  for (let i = 0; i < each_value_1.length; i += 1) {
@@ -6608,7 +6612,7 @@
6608
6612
  229920) {
6609
6613
  each_value_1 = ensure_array_like(
6610
6614
  /*inlineIteration*/
6611
- ctx2[19]
6615
+ ctx2[21]
6612
6616
  );
6613
6617
  let i;
6614
6618
  for (i = 0; i < each_value_1.length; i += 1) {
@@ -6664,12 +6668,12 @@
6664
6668
  function select_block_type(ctx2, dirty) {
6665
6669
  if (
6666
6670
  /*isInlineTypein*/
6667
- ctx2[24]
6671
+ ctx2[26]
6668
6672
  )
6669
6673
  return 0;
6670
6674
  if (
6671
6675
  /*typeinType*/
6672
- ctx2[23] === TYPEIN_TYPE_SHORT
6676
+ ctx2[25] === TYPEIN_TYPE_SHORT
6673
6677
  )
6674
6678
  return 1;
6675
6679
  return 2;
@@ -6752,16 +6756,16 @@
6752
6756
  props: {
6753
6757
  rubric: (
6754
6758
  /*rubric*/
6755
- ctx[20].text
6759
+ ctx[22].text
6756
6760
  ),
6757
6761
  prompt: (
6758
6762
  /*prompt*/
6759
- ctx[22]
6763
+ ctx[24]
6760
6764
  ),
6761
6765
  interactionType: INTERACTION_TYPE_TYPEIN,
6762
6766
  stimulus: (
6763
6767
  /*stimulus*/
6764
- ctx[21]
6768
+ ctx[23]
6765
6769
  ),
6766
6770
  hasDivider: (
6767
6771
  /*hasDivider*/
@@ -6785,9 +6789,9 @@
6785
6789
  16384)
6786
6790
  promptbody_changes.hasDivider = /*hasDivider*/
6787
6791
  ctx2[14];
6788
- if (dirty[0] & /*correctAnswerData, inlineAnswerResult, correctAnswerDataLength, sessionId, inlineTypeinAnswer, isPreviewMode, isPreviewModeInteractive, isResultCorrect, resultFeedback, isSkippedAnswer, resultLabel, isFinished, isDataSaving, root, inlinePromptString, textAriaLabel, placeholder, typeinAnswer*/
6789
- 507903 | dirty[2] & /*$$scope*/
6790
- 4) {
6792
+ if (dirty[0] & /*correctAnswerData, inlineAnswerResult, correctAnswerDataLength, sessionId, inlineTypeinAnswer, isPreviewMode, isPreviewModeInteractive, isResultCorrect, resultFeedback, computedFeedback, isSkippedAnswer, computedFeedbackTitle, resultLabel, isFinished, isDataSaving, root, inlinePromptString, textAriaLabel, placeholder, typeinAnswer*/
6793
+ 2080767 | dirty[2] & /*$$scope*/
6794
+ 64) {
6791
6795
  promptbody_changes.$$scope = { dirty, ctx: ctx2 };
6792
6796
  }
6793
6797
  promptbody.$set(promptbody_changes);
@@ -6839,6 +6843,8 @@
6839
6843
  const { rubric, interaction, metadata, scoringMetadata, stimulus } = sessionData;
6840
6844
  const { prompt, typein_type: typeinType } = interaction;
6841
6845
  const isInlineTypein = typeinType === TYPEIN_TYPE_INLINE;
6846
+ let computedFeedback = null;
6847
+ let computedFeedbackTitle = null;
6842
6848
  if (metadata) {
6843
6849
  const events = metadata.interactions.events.pop();
6844
6850
  if (isInlineTypein) {
@@ -6897,8 +6903,11 @@
6897
6903
  $$invalidate(0, isFinished = true);
6898
6904
  $$invalidate(16, correctAnswerData = previewCorrectAnswer);
6899
6905
  $$invalidate(17, correctAnswerDataLength = previewCorrectAnswer.length);
6900
- if (!isResultCorrect)
6906
+ if (hasOnlyEmptyWrongAnswers(inlineTypeinAnswer, inlineAnswerResult))
6907
+ $$invalidate(10, isSkippedAnswer = true);
6908
+ if (!isResultCorrect && inlineTypeinAnswer.some((value) => value !== ""))
6901
6909
  getFeedback();
6910
+ inlineComputedFeedback();
6902
6911
  buildInlinePrompt();
6903
6912
  setTimeout(
6904
6913
  () => {
@@ -6921,7 +6930,7 @@
6921
6930
  };
6922
6931
  const getResultMessage = () => {
6923
6932
  $$invalidate(12, resultLabel = isResultCorrect ? "Correct" : "Incorrect");
6924
- $$invalidate(18, textAriaLabel = `Submitted response is ${resultLabel.toLocaleLowerCase()}`);
6933
+ $$invalidate(20, textAriaLabel = `Submitted response is ${resultLabel.toLocaleLowerCase()}`);
6925
6934
  $$invalidate(11, placeholder = isResultCorrect ? placeholder : "No answer provided");
6926
6935
  };
6927
6936
  const checkInlineAnswer = (correctAnswer, answer, isAllowMacron, isIgnorePunctuation) => {
@@ -6937,6 +6946,13 @@
6937
6946
  return transformedAnswerList[index].includes(inlineAnswer.toLowerCase().trim());
6938
6947
  });
6939
6948
  };
6949
+ const inlineComputedFeedback = () => {
6950
+ $$invalidate(18, computedFeedback = isSkippedAnswer ? "" : resultFeedback);
6951
+ $$invalidate(19, computedFeedbackTitle = isResultCorrect || isSkippedAnswer ? "" : "Why they got it wrong");
6952
+ };
6953
+ const hasOnlyEmptyWrongAnswers = (answers, answerResults) => {
6954
+ return answers.filter((value) => value === "").length === answerResults.filter((value) => value === false).length;
6955
+ };
6940
6956
  if (isFinished) {
6941
6957
  const { answer, hasAnswer } = scoringMetadata;
6942
6958
  isSkippedAnswer = !hasAnswer;
@@ -6952,6 +6968,9 @@
6952
6968
  correctAnswerData = correctAnswer;
6953
6969
  correctAnswerDataLength = correctAnswer.length;
6954
6970
  inlineAnswerResult = checkInlineAnswer(correctAnswer, metadataAnswer, allowNonMacrons, ignorePunctuation);
6971
+ if (hasOnlyEmptyWrongAnswers(metadataAnswer, inlineAnswerResult))
6972
+ isSkippedAnswer = true;
6973
+ inlineComputedFeedback();
6955
6974
  } else {
6956
6975
  typeinAnswer = answer && hasAnswer ? answer : typeinAnswer;
6957
6976
  }
@@ -6962,7 +6981,7 @@
6962
6981
  }
6963
6982
  const resetInteractivePreviewData = () => {
6964
6983
  $$invalidate(12, resultLabel = "");
6965
- $$invalidate(18, textAriaLabel = "");
6984
+ $$invalidate(20, textAriaLabel = "");
6966
6985
  $$invalidate(11, placeholder = "");
6967
6986
  getResultMessage();
6968
6987
  getFeedback();
@@ -7073,7 +7092,7 @@
7073
7092
  const keydown_handler_1 = (event) => saveOnEnter(event);
7074
7093
  $$self.$$set = ($$props2) => {
7075
7094
  if ("sessionData" in $$props2)
7076
- $$invalidate(30, sessionData = $$props2.sessionData);
7095
+ $$invalidate(32, sessionData = $$props2.sessionData);
7077
7096
  if ("isDataSaving" in $$props2)
7078
7097
  $$invalidate(2, isDataSaving = $$props2.isDataSaving);
7079
7098
  if ("isFinished" in $$props2)
@@ -7085,13 +7104,13 @@
7085
7104
  if ("isPreviewModeInteractive" in $$props2)
7086
7105
  $$invalidate(4, isPreviewModeInteractive = $$props2.isPreviewModeInteractive);
7087
7106
  if ("isPreviewCheckedAnswer" in $$props2)
7088
- $$invalidate(31, isPreviewCheckedAnswer = $$props2.isPreviewCheckedAnswer);
7107
+ $$invalidate(33, isPreviewCheckedAnswer = $$props2.isPreviewCheckedAnswer);
7089
7108
  if ("sessionId" in $$props2)
7090
7109
  $$invalidate(5, sessionId = $$props2.sessionId);
7091
7110
  };
7092
7111
  $$self.$$.update = () => {
7093
7112
  if ($$self.$$.dirty[1] & /*isPreviewCheckedAnswer*/
7094
- 1) {
7113
+ 4) {
7095
7114
  $:
7096
7115
  if (isPreviewCheckedAnswer) {
7097
7116
  resetInteractivePreviewData();
@@ -7117,6 +7136,8 @@
7117
7136
  inlineAnswerResult,
7118
7137
  correctAnswerData,
7119
7138
  correctAnswerDataLength,
7139
+ computedFeedback,
7140
+ computedFeedbackTitle,
7120
7141
  textAriaLabel,
7121
7142
  inlineIteration,
7122
7143
  rubric,
@@ -7153,13 +7174,13 @@
7153
7174
  create_fragment13,
7154
7175
  safe_not_equal,
7155
7176
  {
7156
- sessionData: 30,
7177
+ sessionData: 32,
7157
7178
  isDataSaving: 2,
7158
7179
  isFinished: 0,
7159
7180
  isResultCorrect: 1,
7160
7181
  isPreviewMode: 3,
7161
7182
  isPreviewModeInteractive: 4,
7162
- isPreviewCheckedAnswer: 31,
7183
+ isPreviewCheckedAnswer: 33,
7163
7184
  sessionId: 5
7164
7185
  },
7165
7186
  null,
@@ -7167,7 +7188,7 @@
7167
7188
  );
7168
7189
  }
7169
7190
  get sessionData() {
7170
- return this.$$.ctx[30];
7191
+ return this.$$.ctx[32];
7171
7192
  }
7172
7193
  set sessionData(sessionData) {
7173
7194
  this.$$set({ sessionData });
@@ -7209,7 +7230,7 @@
7209
7230
  flush();
7210
7231
  }
7211
7232
  get isPreviewCheckedAnswer() {
7212
- return this.$$.ctx[31];
7233
+ return this.$$.ctx[33];
7213
7234
  }
7214
7235
  set isPreviewCheckedAnswer(isPreviewCheckedAnswer) {
7215
7236
  this.$$set({ isPreviewCheckedAnswer });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "change version": "1.0.3",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [