eat-js-sdk 1.0.5 → 1.0.7

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.
@@ -4367,13 +4367,13 @@
4367
4367
  textarea,
4368
4368
  "aria-label",
4369
4369
  /*textAriaLabel*/
4370
- ctx[16]
4370
+ ctx[18]
4371
4371
  );
4372
4372
  attr(
4373
4373
  textarea,
4374
4374
  "placeholder",
4375
4375
  /*placeholder*/
4376
- ctx[9]
4376
+ ctx[11]
4377
4377
  );
4378
4378
  attr(textarea, "rows", "3");
4379
4379
  attr(textarea, "class", textarea_class_value = "typein-textbox overflow-hidden " + (!/*isFinished*/
@@ -4385,14 +4385,14 @@
4385
4385
  ctx[2];
4386
4386
  attr(textarea, "autocomplete", "off");
4387
4387
  textarea.readOnly = /*isReadonlyText*/
4388
- ctx[23];
4388
+ ctx[25];
4389
4389
  },
4390
4390
  m(target, anchor) {
4391
4391
  insert(target, textarea, anchor);
4392
4392
  set_input_value(
4393
4393
  textarea,
4394
4394
  /*typeinAnswer*/
4395
- ctx[5]
4395
+ ctx[7]
4396
4396
  );
4397
4397
  if (!mounted) {
4398
4398
  dispose = [
@@ -4440,21 +4440,21 @@
4440
4440
  },
4441
4441
  p(ctx2, dirty) {
4442
4442
  if (dirty[0] & /*textAriaLabel*/
4443
- 65536) {
4443
+ 262144) {
4444
4444
  attr(
4445
4445
  textarea,
4446
4446
  "aria-label",
4447
4447
  /*textAriaLabel*/
4448
- ctx2[16]
4448
+ ctx2[18]
4449
4449
  );
4450
4450
  }
4451
4451
  if (dirty[0] & /*placeholder*/
4452
- 512) {
4452
+ 2048) {
4453
4453
  attr(
4454
4454
  textarea,
4455
4455
  "placeholder",
4456
4456
  /*placeholder*/
4457
- ctx2[9]
4457
+ ctx2[11]
4458
4458
  );
4459
4459
  }
4460
4460
  if (dirty[0] & /*isFinished, isResultCorrect*/
@@ -4471,11 +4471,11 @@
4471
4471
  ctx2[2];
4472
4472
  }
4473
4473
  if (dirty[0] & /*typeinAnswer*/
4474
- 32) {
4474
+ 128) {
4475
4475
  set_input_value(
4476
4476
  textarea,
4477
4477
  /*typeinAnswer*/
4478
- ctx2[5]
4478
+ ctx2[7]
4479
4479
  );
4480
4480
  }
4481
4481
  },
@@ -4504,13 +4504,13 @@
4504
4504
  input,
4505
4505
  "aria-label",
4506
4506
  /*textAriaLabel*/
4507
- ctx[16]
4507
+ ctx[18]
4508
4508
  );
4509
4509
  attr(
4510
4510
  input,
4511
4511
  "placeholder",
4512
4512
  /*placeholder*/
4513
- ctx[9]
4513
+ ctx[11]
4514
4514
  );
4515
4515
  attr(input, "class", input_class_value = "typein-textbox " + (!/*isFinished*/
4516
4516
  ctx[0] ? "" : (
@@ -4521,14 +4521,14 @@
4521
4521
  ctx[2];
4522
4522
  attr(input, "autocomplete", "off");
4523
4523
  input.readOnly = /*isReadonlyText*/
4524
- ctx[23];
4524
+ ctx[25];
4525
4525
  },
4526
4526
  m(target, anchor) {
4527
4527
  insert(target, input, anchor);
4528
4528
  set_input_value(
4529
4529
  input,
4530
4530
  /*typeinAnswer*/
4531
- ctx[5]
4531
+ ctx[7]
4532
4532
  );
4533
4533
  if (!mounted) {
4534
4534
  dispose = [
@@ -4556,21 +4556,21 @@
4556
4556
  },
4557
4557
  p(ctx2, dirty) {
4558
4558
  if (dirty[0] & /*textAriaLabel*/
4559
- 65536) {
4559
+ 262144) {
4560
4560
  attr(
4561
4561
  input,
4562
4562
  "aria-label",
4563
4563
  /*textAriaLabel*/
4564
- ctx2[16]
4564
+ ctx2[18]
4565
4565
  );
4566
4566
  }
4567
4567
  if (dirty[0] & /*placeholder*/
4568
- 512) {
4568
+ 2048) {
4569
4569
  attr(
4570
4570
  input,
4571
4571
  "placeholder",
4572
4572
  /*placeholder*/
4573
- ctx2[9]
4573
+ ctx2[11]
4574
4574
  );
4575
4575
  }
4576
4576
  if (dirty[0] & /*isFinished, isResultCorrect*/
@@ -4587,12 +4587,12 @@
4587
4587
  ctx2[2];
4588
4588
  }
4589
4589
  if (dirty[0] & /*typeinAnswer*/
4590
- 32 && input.value !== /*typeinAnswer*/
4591
- ctx2[5]) {
4590
+ 128 && input.value !== /*typeinAnswer*/
4591
+ ctx2[7]) {
4592
4592
  set_input_value(
4593
4593
  input,
4594
4594
  /*typeinAnswer*/
4595
- ctx2[5]
4595
+ ctx2[7]
4596
4596
  );
4597
4597
  }
4598
4598
  },
@@ -4617,7 +4617,7 @@
4617
4617
  function select_block_type_1(ctx2, dirty) {
4618
4618
  if (
4619
4619
  /*inlinePromptString*/
4620
- ctx2[11]
4620
+ ctx2[13]
4621
4621
  )
4622
4622
  return 0;
4623
4623
  return 1;
@@ -4719,7 +4719,7 @@
4719
4719
  props: {
4720
4720
  htmlString: (
4721
4721
  /*inlinePromptString*/
4722
- ctx[11]
4722
+ ctx[13]
4723
4723
  ),
4724
4724
  otherClass: "inline-typein-container mt-6"
4725
4725
  }
@@ -4749,9 +4749,9 @@
4749
4749
  p(ctx2, dirty) {
4750
4750
  const commonstringtohtml_changes = {};
4751
4751
  if (dirty[0] & /*inlinePromptString*/
4752
- 2048)
4752
+ 8192)
4753
4753
  commonstringtohtml_changes.htmlString = /*inlinePromptString*/
4754
- ctx2[11];
4754
+ ctx2[13];
4755
4755
  commonstringtohtml.$set(commonstringtohtml_changes);
4756
4756
  if (!current || dirty[0] & /*isDataSaving*/
4757
4757
  4 && div2_class_value !== (div2_class_value = "absolute inset-0 bg-transparent " + /*isDataSaving*/
@@ -4790,12 +4790,12 @@
4790
4790
  let if_block2_anchor;
4791
4791
  let current;
4792
4792
  let if_block0 = !/*isInlineTypein*/
4793
- ctx[22] && create_if_block_52(ctx);
4793
+ ctx[24] && create_if_block_52(ctx);
4794
4794
  const if_block_creators = [create_if_block_43, create_else_block_1];
4795
4795
  const if_blocks = [];
4796
4796
  function select_block_type_3(ctx2, dirty) {
4797
4797
  if (!/*isInlineTypein*/
4798
- ctx2[22])
4798
+ ctx2[24])
4799
4799
  return 0;
4800
4800
  return 1;
4801
4801
  }
@@ -4803,7 +4803,9 @@
4803
4803
  if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
4804
4804
  let if_block2 = (
4805
4805
  /*isInlineTypein*/
4806
- ctx[22] && create_if_block_16(ctx)
4806
+ ctx[24] && (!/*isPreviewMode*/
4807
+ ctx[3] || /*isPreviewModeInteractive*/
4808
+ ctx[4]) && create_if_block_16(ctx)
4807
4809
  );
4808
4810
  return {
4809
4811
  c() {
@@ -4829,14 +4831,34 @@
4829
4831
  },
4830
4832
  p(ctx2, dirty) {
4831
4833
  if (!/*isInlineTypein*/
4832
- ctx2[22])
4834
+ ctx2[24])
4833
4835
  if_block0.p(ctx2, dirty);
4834
4836
  if_block1.p(ctx2, dirty);
4835
4837
  if (
4836
4838
  /*isInlineTypein*/
4837
- ctx2[22]
4838
- )
4839
- if_block2.p(ctx2, dirty);
4839
+ ctx2[24] && (!/*isPreviewMode*/
4840
+ ctx2[3] || /*isPreviewModeInteractive*/
4841
+ ctx2[4])
4842
+ ) {
4843
+ if (if_block2) {
4844
+ if_block2.p(ctx2, dirty);
4845
+ if (dirty[0] & /*isPreviewMode, isPreviewModeInteractive*/
4846
+ 24) {
4847
+ transition_in(if_block2, 1);
4848
+ }
4849
+ } else {
4850
+ if_block2 = create_if_block_16(ctx2);
4851
+ if_block2.c();
4852
+ transition_in(if_block2, 1);
4853
+ if_block2.m(if_block2_anchor.parentNode, if_block2_anchor);
4854
+ }
4855
+ } else if (if_block2) {
4856
+ group_outros();
4857
+ transition_out(if_block2, 1, 1, () => {
4858
+ if_block2 = null;
4859
+ });
4860
+ check_outros();
4861
+ }
4840
4862
  },
4841
4863
  i(local) {
4842
4864
  if (current)
@@ -4898,14 +4920,14 @@
4898
4920
  span1 = element("span");
4899
4921
  t1 = text(
4900
4922
  /*resultLabel*/
4901
- ctx[10]
4923
+ ctx[12]
4902
4924
  );
4903
4925
  attr(span0, "class", span0_class_value = /*isResultCorrect*/
4904
4926
  (ctx[1] ? "text-green-800" : "text-red-800") + " mr-2 p-0.5");
4905
4927
  attr(span1, "class", "p2");
4906
4928
  attr(div, "aria-hidden", "true");
4907
4929
  attr(div, "class", div_class_value = "flex items-center text-charcoal " + /*typeinType*/
4908
- (ctx[21] === TYPEIN_TYPE_SHORT ? "mt-2" : "mt-0.5"));
4930
+ (ctx[23] === TYPEIN_TYPE_SHORT ? "mt-2" : "mt-0.5"));
4909
4931
  },
4910
4932
  m(target, anchor) {
4911
4933
  insert(target, div, anchor);
@@ -4940,11 +4962,11 @@
4940
4962
  attr(span0, "class", span0_class_value);
4941
4963
  }
4942
4964
  if (!current || dirty[0] & /*resultLabel*/
4943
- 1024)
4965
+ 4096)
4944
4966
  set_data(
4945
4967
  t1,
4946
4968
  /*resultLabel*/
4947
- ctx2[10]
4969
+ ctx2[12]
4948
4970
  );
4949
4971
  },
4950
4972
  i(local) {
@@ -5030,22 +5052,22 @@
5030
5052
  ),
5031
5053
  resultFeedback: (
5032
5054
  /*isSkippedAnswer*/
5033
- ctx[8] ? "" : (
5055
+ ctx[10] ? "" : (
5034
5056
  /*resultFeedback*/
5035
- ctx[6]
5057
+ ctx[8]
5036
5058
  )
5037
5059
  ),
5038
5060
  isSkipped: (
5039
5061
  /*isSkippedAnswer*/
5040
- ctx[8]
5062
+ ctx[10]
5041
5063
  ),
5042
5064
  hasIcon: !/*isResultCorrect*/
5043
5065
  ctx[1] || /*isSkippedAnswer*/
5044
- ctx[8],
5066
+ ctx[10],
5045
5067
  resultFeedbackTitle: (
5046
5068
  /*isResultCorrect*/
5047
5069
  ctx[1] || /*isSkippedAnswer*/
5048
- ctx[8] ? "" : "Why they got it wrong"
5070
+ ctx[10] ? "" : "Why they got it wrong"
5049
5071
  )
5050
5072
  }
5051
5073
  });
@@ -5064,26 +5086,26 @@
5064
5086
  promptresultv2_changes.isResultCorrect = /*isResultCorrect*/
5065
5087
  ctx2[1];
5066
5088
  if (dirty[0] & /*isSkippedAnswer, resultFeedback*/
5067
- 320)
5089
+ 1280)
5068
5090
  promptresultv2_changes.resultFeedback = /*isSkippedAnswer*/
5069
- ctx2[8] ? "" : (
5091
+ ctx2[10] ? "" : (
5070
5092
  /*resultFeedback*/
5071
- ctx2[6]
5093
+ ctx2[8]
5072
5094
  );
5073
5095
  if (dirty[0] & /*isSkippedAnswer*/
5074
- 256)
5096
+ 1024)
5075
5097
  promptresultv2_changes.isSkipped = /*isSkippedAnswer*/
5076
- ctx2[8];
5098
+ ctx2[10];
5077
5099
  if (dirty[0] & /*isResultCorrect, isSkippedAnswer*/
5078
- 258)
5100
+ 1026)
5079
5101
  promptresultv2_changes.hasIcon = !/*isResultCorrect*/
5080
5102
  ctx2[1] || /*isSkippedAnswer*/
5081
- ctx2[8];
5103
+ ctx2[10];
5082
5104
  if (dirty[0] & /*isResultCorrect, isSkippedAnswer*/
5083
- 258)
5105
+ 1026)
5084
5106
  promptresultv2_changes.resultFeedbackTitle = /*isResultCorrect*/
5085
5107
  ctx2[1] || /*isSkippedAnswer*/
5086
- ctx2[8] ? "" : "Why they got it wrong";
5108
+ ctx2[10] ? "" : "Why they got it wrong";
5087
5109
  promptresultv2.$set(promptresultv2_changes);
5088
5110
  },
5089
5111
  i(local) {
@@ -5112,7 +5134,7 @@
5112
5134
  ),
5113
5135
  resultFeedback: (
5114
5136
  /*resultFeedback*/
5115
- ctx[6]
5137
+ ctx[8]
5116
5138
  )
5117
5139
  }
5118
5140
  });
@@ -5131,9 +5153,9 @@
5131
5153
  promptresult_changes.isResultCorrect = /*isResultCorrect*/
5132
5154
  ctx2[1];
5133
5155
  if (dirty[0] & /*resultFeedback*/
5134
- 64)
5156
+ 256)
5135
5157
  promptresult_changes.resultFeedback = /*resultFeedback*/
5136
- ctx2[6];
5158
+ ctx2[8];
5137
5159
  promptresult.$set(promptresult_changes);
5138
5160
  },
5139
5161
  i(local) {
@@ -5156,7 +5178,7 @@
5156
5178
  let current;
5157
5179
  let each_value = ensure_array_like(
5158
5180
  /*correctAnswerData*/
5159
- ctx[14]
5181
+ ctx[16]
5160
5182
  );
5161
5183
  let each_blocks = [];
5162
5184
  for (let i = 0; i < each_value.length; i += 1) {
@@ -5183,10 +5205,10 @@
5183
5205
  },
5184
5206
  p(ctx2, dirty) {
5185
5207
  if (dirty[0] & /*inlineIteration, inlineAnswerResult, correctAnswerDataLength, sessionId, inlineTypeinAnswer, correctAnswerData*/
5186
- 188552) {
5208
+ 754208) {
5187
5209
  each_value = ensure_array_like(
5188
5210
  /*correctAnswerData*/
5189
- ctx2[14]
5211
+ ctx2[16]
5190
5212
  );
5191
5213
  let i;
5192
5214
  for (i = 0; i < each_value.length; i += 1) {
@@ -5243,7 +5265,7 @@
5243
5265
  function select_block_type_4(ctx2, dirty) {
5244
5266
  if (
5245
5267
  /*inlineAnswerResult*/
5246
- ctx2[13][
5268
+ ctx2[15][
5247
5269
  /*itemIndex*/
5248
5270
  ctx2[60]
5249
5271
  ]
@@ -5259,7 +5281,7 @@
5259
5281
  span0 = element("span");
5260
5282
  if_block.c();
5261
5283
  attr(span0, "class", span0_class_value = /*inlineAnswerResult*/
5262
- (ctx[13][
5284
+ (ctx[15][
5263
5285
  /*itemIndex*/
5264
5286
  ctx[60]
5265
5287
  ] ? "text-green-900" : "text-red-900") + " p-0.5");
@@ -5290,8 +5312,8 @@
5290
5312
  if_block.m(span0, null);
5291
5313
  }
5292
5314
  if (!current || dirty[0] & /*inlineAnswerResult*/
5293
- 8192 && span0_class_value !== (span0_class_value = /*inlineAnswerResult*/
5294
- (ctx2[13][
5315
+ 32768 && span0_class_value !== (span0_class_value = /*inlineAnswerResult*/
5316
+ (ctx2[15][
5295
5317
  /*itemIndex*/
5296
5318
  ctx2[60]
5297
5319
  ] ? "text-green-900" : "text-red-900") + " p-0.5")) {
@@ -5445,7 +5467,7 @@
5445
5467
  /*iterationIndex*/
5446
5468
  ctx[63]
5447
5469
  ) && /*inlineAnswerResult*/
5448
- ctx[13][
5470
+ ctx[15][
5449
5471
  /*itemIndex*/
5450
5472
  ctx[60]
5451
5473
  ] ? "hidden md:block" : ""));
@@ -5453,15 +5475,15 @@
5453
5475
  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");
5454
5476
  attr(label, "for", label_for_value = `${/*iterationIndex*/
5455
5477
  ctx[63]}-${/*sessionId*/
5456
- ctx[3]}-${/*itemIndex*/
5478
+ ctx[5]}-${/*itemIndex*/
5457
5479
  ctx[60]}`);
5458
5480
  attr(label, "class", label_class_value = "absolute left-0 top-[13px] bottom-0 " + /*correctAnswerDataLength*/
5459
- (ctx[15] > 1 && !useIsEven(
5481
+ (ctx[17] > 1 && !useIsEven(
5460
5482
  /*iterationIndex*/
5461
5483
  ctx[63]
5462
5484
  ) ? "hidden md:inline-block" : (
5463
5485
  /*correctAnswerDataLength*/
5464
- ctx[15] > 1 && useIsEven(
5486
+ ctx[17] > 1 && useIsEven(
5465
5487
  /*iterationIndex*/
5466
5488
  ctx[63]
5467
5489
  ) ? "" : "hidden"
@@ -5474,25 +5496,25 @@
5474
5496
  /*iterationIndex*/
5475
5497
  ctx[63]
5476
5498
  ) && /*inlineAnswerResult*/
5477
- ctx[13][
5499
+ ctx[15][
5478
5500
  /*itemIndex*/
5479
5501
  ctx[60]
5480
5502
  ] ? " (Correct)" : useIsEven(
5481
5503
  /*iterationIndex*/
5482
5504
  ctx[63]
5483
5505
  ) && !/*inlineAnswerResult*/
5484
- ctx[13][
5506
+ ctx[15][
5485
5507
  /*itemIndex*/
5486
5508
  ctx[60]
5487
5509
  ] ? " (Incorrect)" : ""}, Item number ${/*itemIndex*/
5488
5510
  ctx[60] + 1}:`);
5489
5511
  attr(textarea, "class", textarea_class_value = "typein-textbox py-[9px] pr-4 mt-4 " + /*correctAnswerDataLength*/
5490
- (ctx[15] > 1 && !useIsEven(
5512
+ (ctx[17] > 1 && !useIsEven(
5491
5513
  /*iterationIndex*/
5492
5514
  ctx[63]
5493
5515
  ) ? "md:pl-13.2" : (
5494
5516
  /*correctAnswerDataLength*/
5495
- ctx[15] > 1 && useIsEven(
5517
+ ctx[17] > 1 && useIsEven(
5496
5518
  /*iterationIndex*/
5497
5519
  ctx[63]
5498
5520
  ) ? "pl-13.2" : ""
@@ -5503,27 +5525,27 @@
5503
5525
  /*iterationIndex*/
5504
5526
  ctx[63]
5505
5527
  ) && /*inlineAnswerResult*/
5506
- ctx[13][
5528
+ ctx[15][
5507
5529
  /*itemIndex*/
5508
5530
  ctx[60]
5509
5531
  ] ? "border-2 border-green-900" : useIsEven(
5510
5532
  /*iterationIndex*/
5511
5533
  ctx[63]
5512
5534
  ) && !/*inlineAnswerResult*/
5513
- ctx[13][
5535
+ ctx[15][
5514
5536
  /*itemIndex*/
5515
5537
  ctx[60]
5516
5538
  ] ? "border-2 border-red-900 bg-red-50" : ""));
5517
5539
  attr(textarea, "id", textarea_id_value = `${/*iterationIndex*/
5518
5540
  ctx[63]}-${/*sessionId*/
5519
- ctx[3]}-${/*itemIndex*/
5541
+ ctx[5]}-${/*itemIndex*/
5520
5542
  ctx[60]}`);
5521
5543
  textarea.value = textarea_value_value = useIsEven(
5522
5544
  /*iterationIndex*/
5523
5545
  ctx[63]
5524
5546
  ) ? (
5525
5547
  /*inlineTypeinAnswer*/
5526
- ctx[7][
5548
+ ctx[9][
5527
5549
  /*itemIndex*/
5528
5550
  ctx[60]
5529
5551
  ] || "No answer provided"
@@ -5537,7 +5559,7 @@
5537
5559
  /*iterationIndex*/
5538
5560
  ctx[63]
5539
5561
  ) && /*inlineAnswerResult*/
5540
- ctx[13][
5562
+ ctx[15][
5541
5563
  /*itemIndex*/
5542
5564
  ctx[60]
5543
5565
  ] ? "-1" : "");
@@ -5545,7 +5567,7 @@
5545
5567
  /*iterationIndex*/
5546
5568
  ctx[63]
5547
5569
  ) && /*inlineAnswerResult*/
5548
- ctx[13][
5570
+ ctx[15][
5549
5571
  /*itemIndex*/
5550
5572
  ctx[60]
5551
5573
  ] ? "hidden md:block" : ""));
@@ -5578,7 +5600,7 @@
5578
5600
  },
5579
5601
  p(ctx2, dirty) {
5580
5602
  if (!current || dirty[0] & /*inlineAnswerResult*/
5581
- 8192 && p_class_value !== (p_class_value = "text-base text-charcoal font-semibold " + (useIsEven(
5603
+ 32768 && p_class_value !== (p_class_value = "text-base text-charcoal font-semibold " + (useIsEven(
5582
5604
  /*iterationIndex*/
5583
5605
  ctx2[63]
5584
5606
  ) && /*itemIndex*/
@@ -5597,27 +5619,27 @@
5597
5619
  /*iterationIndex*/
5598
5620
  ctx2[63]
5599
5621
  ) && /*inlineAnswerResult*/
5600
- ctx2[13][
5622
+ ctx2[15][
5601
5623
  /*itemIndex*/
5602
5624
  ctx2[60]
5603
5625
  ] ? "hidden md:block" : ""))) {
5604
5626
  attr(p, "class", p_class_value);
5605
5627
  }
5606
5628
  if (!current || dirty[0] & /*sessionId*/
5607
- 8 && label_for_value !== (label_for_value = `${/*iterationIndex*/
5629
+ 32 && label_for_value !== (label_for_value = `${/*iterationIndex*/
5608
5630
  ctx2[63]}-${/*sessionId*/
5609
- ctx2[3]}-${/*itemIndex*/
5631
+ ctx2[5]}-${/*itemIndex*/
5610
5632
  ctx2[60]}`)) {
5611
5633
  attr(label, "for", label_for_value);
5612
5634
  }
5613
5635
  if (!current || dirty[0] & /*correctAnswerDataLength*/
5614
- 32768 && label_class_value !== (label_class_value = "absolute left-0 top-[13px] bottom-0 " + /*correctAnswerDataLength*/
5615
- (ctx2[15] > 1 && !useIsEven(
5636
+ 131072 && label_class_value !== (label_class_value = "absolute left-0 top-[13px] bottom-0 " + /*correctAnswerDataLength*/
5637
+ (ctx2[17] > 1 && !useIsEven(
5616
5638
  /*iterationIndex*/
5617
5639
  ctx2[63]
5618
5640
  ) ? "hidden md:inline-block" : (
5619
5641
  /*correctAnswerDataLength*/
5620
- ctx2[15] > 1 && useIsEven(
5642
+ ctx2[17] > 1 && useIsEven(
5621
5643
  /*iterationIndex*/
5622
5644
  ctx2[63]
5623
5645
  ) ? "" : "hidden"
@@ -5625,21 +5647,21 @@
5625
5647
  attr(label, "class", label_class_value);
5626
5648
  }
5627
5649
  if (!current || dirty[0] & /*inlineAnswerResult*/
5628
- 8192 && textarea_aria_label_value !== (textarea_aria_label_value = `${useIsEven(
5650
+ 32768 && textarea_aria_label_value !== (textarea_aria_label_value = `${useIsEven(
5629
5651
  /*iterationIndex*/
5630
5652
  ctx2[63]
5631
5653
  ) ? `Student's` : "Correct"} answer${useIsEven(
5632
5654
  /*iterationIndex*/
5633
5655
  ctx2[63]
5634
5656
  ) && /*inlineAnswerResult*/
5635
- ctx2[13][
5657
+ ctx2[15][
5636
5658
  /*itemIndex*/
5637
5659
  ctx2[60]
5638
5660
  ] ? " (Correct)" : useIsEven(
5639
5661
  /*iterationIndex*/
5640
5662
  ctx2[63]
5641
5663
  ) && !/*inlineAnswerResult*/
5642
- ctx2[13][
5664
+ ctx2[15][
5643
5665
  /*itemIndex*/
5644
5666
  ctx2[60]
5645
5667
  ] ? " (Incorrect)" : ""}, Item number ${/*itemIndex*/
@@ -5647,13 +5669,13 @@
5647
5669
  attr(textarea, "aria-label", textarea_aria_label_value);
5648
5670
  }
5649
5671
  if (!current || dirty[0] & /*correctAnswerDataLength, inlineAnswerResult*/
5650
- 40960 && textarea_class_value !== (textarea_class_value = "typein-textbox py-[9px] pr-4 mt-4 " + /*correctAnswerDataLength*/
5651
- (ctx2[15] > 1 && !useIsEven(
5672
+ 163840 && textarea_class_value !== (textarea_class_value = "typein-textbox py-[9px] pr-4 mt-4 " + /*correctAnswerDataLength*/
5673
+ (ctx2[17] > 1 && !useIsEven(
5652
5674
  /*iterationIndex*/
5653
5675
  ctx2[63]
5654
5676
  ) ? "md:pl-13.2" : (
5655
5677
  /*correctAnswerDataLength*/
5656
- ctx2[15] > 1 && useIsEven(
5678
+ ctx2[17] > 1 && useIsEven(
5657
5679
  /*iterationIndex*/
5658
5680
  ctx2[63]
5659
5681
  ) ? "pl-13.2" : ""
@@ -5664,33 +5686,33 @@
5664
5686
  /*iterationIndex*/
5665
5687
  ctx2[63]
5666
5688
  ) && /*inlineAnswerResult*/
5667
- ctx2[13][
5689
+ ctx2[15][
5668
5690
  /*itemIndex*/
5669
5691
  ctx2[60]
5670
5692
  ] ? "border-2 border-green-900" : useIsEven(
5671
5693
  /*iterationIndex*/
5672
5694
  ctx2[63]
5673
5695
  ) && !/*inlineAnswerResult*/
5674
- ctx2[13][
5696
+ ctx2[15][
5675
5697
  /*itemIndex*/
5676
5698
  ctx2[60]
5677
5699
  ] ? "border-2 border-red-900 bg-red-50" : ""))) {
5678
5700
  attr(textarea, "class", textarea_class_value);
5679
5701
  }
5680
5702
  if (!current || dirty[0] & /*sessionId*/
5681
- 8 && textarea_id_value !== (textarea_id_value = `${/*iterationIndex*/
5703
+ 32 && textarea_id_value !== (textarea_id_value = `${/*iterationIndex*/
5682
5704
  ctx2[63]}-${/*sessionId*/
5683
- ctx2[3]}-${/*itemIndex*/
5705
+ ctx2[5]}-${/*itemIndex*/
5684
5706
  ctx2[60]}`)) {
5685
5707
  attr(textarea, "id", textarea_id_value);
5686
5708
  }
5687
5709
  if (!current || dirty[0] & /*inlineTypeinAnswer, correctAnswerData*/
5688
- 16512 && textarea_value_value !== (textarea_value_value = useIsEven(
5710
+ 66048 && textarea_value_value !== (textarea_value_value = useIsEven(
5689
5711
  /*iterationIndex*/
5690
5712
  ctx2[63]
5691
5713
  ) ? (
5692
5714
  /*inlineTypeinAnswer*/
5693
- ctx2[7][
5715
+ ctx2[9][
5694
5716
  /*itemIndex*/
5695
5717
  ctx2[60]
5696
5718
  ] || "No answer provided"
@@ -5701,11 +5723,11 @@
5701
5723
  textarea.value = textarea_value_value;
5702
5724
  }
5703
5725
  if (!current || dirty[0] & /*inlineAnswerResult*/
5704
- 8192 && textarea_tabindex_value !== (textarea_tabindex_value = !useIsEven(
5726
+ 32768 && textarea_tabindex_value !== (textarea_tabindex_value = !useIsEven(
5705
5727
  /*iterationIndex*/
5706
5728
  ctx2[63]
5707
5729
  ) && /*inlineAnswerResult*/
5708
- ctx2[13][
5730
+ ctx2[15][
5709
5731
  /*itemIndex*/
5710
5732
  ctx2[60]
5711
5733
  ] ? "-1" : "")) {
@@ -5714,11 +5736,11 @@
5714
5736
  if (show_if)
5715
5737
  if_block.p(ctx2, dirty);
5716
5738
  if (!current || dirty[0] & /*inlineAnswerResult*/
5717
- 8192 && div0_class_value !== (div0_class_value = "h-fit relative " + (!useIsEven(
5739
+ 32768 && div0_class_value !== (div0_class_value = "h-fit relative " + (!useIsEven(
5718
5740
  /*iterationIndex*/
5719
5741
  ctx2[63]
5720
5742
  ) && /*inlineAnswerResult*/
5721
- ctx2[13][
5743
+ ctx2[15][
5722
5744
  /*itemIndex*/
5723
5745
  ctx2[60]
5724
5746
  ] ? "hidden md:block" : ""))) {
@@ -5752,7 +5774,7 @@
5752
5774
  let current;
5753
5775
  let each_value_1 = ensure_array_like(
5754
5776
  /*inlineIteration*/
5755
- ctx[17]
5777
+ ctx[19]
5756
5778
  );
5757
5779
  let each_blocks = [];
5758
5780
  for (let i = 0; i < each_value_1.length; i += 1) {
@@ -5782,10 +5804,10 @@
5782
5804
  },
5783
5805
  p(ctx2, dirty) {
5784
5806
  if (dirty[0] & /*inlineAnswerResult, correctAnswerDataLength, sessionId, inlineTypeinAnswer, correctAnswerData*/
5785
- 57480) {
5807
+ 229920) {
5786
5808
  each_value_1 = ensure_array_like(
5787
5809
  /*inlineIteration*/
5788
- ctx2[17]
5810
+ ctx2[19]
5789
5811
  );
5790
5812
  let i;
5791
5813
  for (i = 0; i < each_value_1.length; i += 1) {
@@ -5841,12 +5863,12 @@
5841
5863
  function select_block_type(ctx2, dirty) {
5842
5864
  if (
5843
5865
  /*isInlineTypein*/
5844
- ctx2[22]
5866
+ ctx2[24]
5845
5867
  )
5846
5868
  return 0;
5847
5869
  if (
5848
5870
  /*typeinType*/
5849
- ctx2[21] === TYPEIN_TYPE_SHORT
5871
+ ctx2[23] === TYPEIN_TYPE_SHORT
5850
5872
  )
5851
5873
  return 1;
5852
5874
  return 2;
@@ -5929,20 +5951,20 @@
5929
5951
  props: {
5930
5952
  rubric: (
5931
5953
  /*rubric*/
5932
- ctx[18].text
5954
+ ctx[20].text
5933
5955
  ),
5934
5956
  prompt: (
5935
5957
  /*prompt*/
5936
- ctx[20]
5958
+ ctx[22]
5937
5959
  ),
5938
5960
  interactionType: INTERACTION_TYPE_TYPEIN,
5939
5961
  stimulus: (
5940
5962
  /*stimulus*/
5941
- ctx[19]
5963
+ ctx[21]
5942
5964
  ),
5943
5965
  hasDivider: (
5944
5966
  /*hasDivider*/
5945
- ctx[12]
5967
+ ctx[14]
5946
5968
  ),
5947
5969
  $$slots: { default: [create_default_slot2] },
5948
5970
  $$scope: { ctx }
@@ -5959,11 +5981,11 @@
5959
5981
  p(ctx2, dirty) {
5960
5982
  const promptbody_changes = {};
5961
5983
  if (dirty[0] & /*hasDivider*/
5962
- 4096)
5984
+ 16384)
5963
5985
  promptbody_changes.hasDivider = /*hasDivider*/
5964
- ctx2[12];
5965
- if (dirty[0] & /*correctAnswerData, inlineAnswerResult, correctAnswerDataLength, sessionId, inlineTypeinAnswer, isResultCorrect, resultFeedback, isSkippedAnswer, resultLabel, isFinished, isDataSaving, root, inlinePromptString, textAriaLabel, placeholder, typeinAnswer*/
5966
- 126975 | dirty[2] & /*$$scope*/
5986
+ ctx2[14];
5987
+ if (dirty[0] & /*correctAnswerData, inlineAnswerResult, correctAnswerDataLength, sessionId, inlineTypeinAnswer, isPreviewMode, isPreviewModeInteractive, isResultCorrect, resultFeedback, isSkippedAnswer, resultLabel, isFinished, isDataSaving, root, inlinePromptString, textAriaLabel, placeholder, typeinAnswer*/
5988
+ 507903 | dirty[2] & /*$$scope*/
5967
5989
  4) {
5968
5990
  promptbody_changes.$$scope = { dirty, ctx: ctx2 };
5969
5991
  }
@@ -6054,26 +6076,26 @@
6054
6076
  const rawAnswer = useJoinArrayToString(inlineTypeinAnswer);
6055
6077
  const input = root.querySelector(`#${id}`);
6056
6078
  const arrayId = id.split("-")[2] - 1;
6057
- $$invalidate(7, inlineTypeinAnswer[arrayId] = input.value, inlineTypeinAnswer);
6079
+ $$invalidate(9, inlineTypeinAnswer[arrayId] = input.value, inlineTypeinAnswer);
6058
6080
  const latestAnswer2 = useJoinArrayToString(inlineTypeinAnswer);
6059
6081
  if (latestAnswer2 === rawAnswer || isDataSaving)
6060
6082
  return;
6061
6083
  const allEmpty = inlineTypeinAnswer.every((value) => value === "");
6062
6084
  if (isPreviewModeInteractive) {
6063
6085
  const allAnswered = inlineTypeinAnswer.every((value) => value !== "");
6064
- $$invalidate(8, isSkippedAnswer = false);
6086
+ $$invalidate(10, isSkippedAnswer = false);
6065
6087
  if (isInteractiveTriggeredResult && allEmpty) {
6066
- $$invalidate(8, isSkippedAnswer = true);
6088
+ $$invalidate(10, isSkippedAnswer = true);
6067
6089
  }
6068
6090
  if (allAnswered || isInteractiveTriggeredResult) {
6069
6091
  $$invalidate(1, isResultCorrect = false);
6070
- const { is_single_mark: isSingleMark } = interaction;
6092
+ const { is_single_mark: isSingleMark, allow_non_macrons_as_correct_answer: allowNonMacrons, ignore_punctuation: ignorePunctuation } = interaction;
6071
6093
  const { answer: previewCorrectAnswer } = scoringMetadata;
6072
- $$invalidate(13, inlineAnswerResult = checkInlineAnswer(previewCorrectAnswer, inlineTypeinAnswer));
6094
+ $$invalidate(15, inlineAnswerResult = checkInlineAnswer(previewCorrectAnswer, inlineTypeinAnswer, allowNonMacrons, ignorePunctuation));
6073
6095
  $$invalidate(1, isResultCorrect = isSingleMark ? !inlineAnswerResult.includes(false) : inlineAnswerResult.includes(true));
6074
6096
  $$invalidate(0, isFinished = true);
6075
- $$invalidate(14, correctAnswerData = previewCorrectAnswer);
6076
- $$invalidate(15, correctAnswerDataLength = previewCorrectAnswer.length);
6097
+ $$invalidate(16, correctAnswerData = previewCorrectAnswer);
6098
+ $$invalidate(17, correctAnswerDataLength = previewCorrectAnswer.length);
6077
6099
  getFeedback();
6078
6100
  buildInlinePrompt();
6079
6101
  setTimeout(
@@ -6093,12 +6115,12 @@
6093
6115
  };
6094
6116
  const getFeedback = () => {
6095
6117
  const { correct: correctFeeback, incorrect: incorrectFeedback } = interaction.feedback;
6096
- $$invalidate(6, resultFeedback = isResultCorrect ? correctFeeback : incorrectFeedback);
6118
+ $$invalidate(8, resultFeedback = isResultCorrect ? correctFeeback : incorrectFeedback);
6097
6119
  };
6098
6120
  const getResultMessage = () => {
6099
- $$invalidate(10, resultLabel = isResultCorrect ? "Correct" : "Incorrect");
6100
- $$invalidate(16, textAriaLabel = `Submitted response is ${resultLabel.toLocaleLowerCase()}`);
6101
- $$invalidate(9, placeholder = isResultCorrect ? placeholder : "No answer provided");
6121
+ $$invalidate(12, resultLabel = isResultCorrect ? "Correct" : "Incorrect");
6122
+ $$invalidate(18, textAriaLabel = `Submitted response is ${resultLabel.toLocaleLowerCase()}`);
6123
+ $$invalidate(11, placeholder = isResultCorrect ? placeholder : "No answer provided");
6102
6124
  };
6103
6125
  const checkInlineAnswer = (correctAnswer, answer, isAllowMacron, isIgnorePunctuation) => {
6104
6126
  const transformedAnswerList = correctAnswer.map((item) => item.map((data) => data.toLowerCase()));
@@ -6110,7 +6132,7 @@
6110
6132
  if (isIgnorePunctuation) {
6111
6133
  inlineAnswer = useRemovePunctuation(inlineAnswer);
6112
6134
  }
6113
- return transformedAnswerList[index].includes(inlineAnswer.toLowerCase());
6135
+ return transformedAnswerList[index].includes(inlineAnswer.toLowerCase().trim());
6114
6136
  });
6115
6137
  };
6116
6138
  if (isFinished) {
@@ -6135,14 +6157,14 @@
6135
6157
  }
6136
6158
  }
6137
6159
  const resetInteractivePreviewData = () => {
6138
- $$invalidate(10, resultLabel = "");
6139
- $$invalidate(16, textAriaLabel = "");
6140
- $$invalidate(9, placeholder = "");
6160
+ $$invalidate(12, resultLabel = "");
6161
+ $$invalidate(18, textAriaLabel = "");
6162
+ $$invalidate(11, placeholder = "");
6141
6163
  getResultMessage();
6142
6164
  getFeedback();
6143
6165
  };
6144
6166
  const buildInlinePrompt = () => {
6145
- $$invalidate(12, hasDivider = false);
6167
+ $$invalidate(14, hasDivider = false);
6146
6168
  const { inline_prompt: inlinePrompt } = interaction;
6147
6169
  if (inlinePrompt) {
6148
6170
  let idCounter = 1;
@@ -6151,7 +6173,7 @@
6151
6173
  const isSingleInput = inputCount <= 1;
6152
6174
  const sessionString = sessionId ? sessionId.replace(/-/g, "") : "preview";
6153
6175
  const spacer = '<span class="inline-block w-2 h-4"></span>';
6154
- $$invalidate(11, inlinePromptString = inlinePrompt.replace(eatRegex, () => {
6176
+ $$invalidate(13, inlinePromptString = inlinePrompt.replace(eatRegex, () => {
6155
6177
  if (isInitialLoad) {
6156
6178
  inlineTypeinAnswer.push("");
6157
6179
  }
@@ -6227,18 +6249,18 @@
6227
6249
  function div0_binding($$value) {
6228
6250
  binding_callbacks[$$value ? "unshift" : "push"](() => {
6229
6251
  root = $$value;
6230
- $$invalidate(4, root);
6252
+ $$invalidate(6, root);
6231
6253
  });
6232
6254
  }
6233
6255
  function input_input_handler() {
6234
6256
  typeinAnswer = this.value;
6235
- $$invalidate(5, typeinAnswer);
6257
+ $$invalidate(7, typeinAnswer);
6236
6258
  }
6237
6259
  const focusout_handler = () => saveAnswer();
6238
6260
  const keydown_handler = (event) => saveOnEnter(event);
6239
6261
  function textarea_input_handler() {
6240
6262
  typeinAnswer = this.value;
6241
- $$invalidate(5, typeinAnswer);
6263
+ $$invalidate(7, typeinAnswer);
6242
6264
  }
6243
6265
  const mousedown_handler = () => handleClick();
6244
6266
  const touchstart_handler = () => handleClick();
@@ -6247,7 +6269,7 @@
6247
6269
  const keydown_handler_1 = (event) => saveOnEnter(event);
6248
6270
  $$self.$$set = ($$props2) => {
6249
6271
  if ("sessionData" in $$props2)
6250
- $$invalidate(28, sessionData = $$props2.sessionData);
6272
+ $$invalidate(30, sessionData = $$props2.sessionData);
6251
6273
  if ("isDataSaving" in $$props2)
6252
6274
  $$invalidate(2, isDataSaving = $$props2.isDataSaving);
6253
6275
  if ("isFinished" in $$props2)
@@ -6255,13 +6277,13 @@
6255
6277
  if ("isResultCorrect" in $$props2)
6256
6278
  $$invalidate(1, isResultCorrect = $$props2.isResultCorrect);
6257
6279
  if ("isPreviewMode" in $$props2)
6258
- $$invalidate(29, isPreviewMode = $$props2.isPreviewMode);
6280
+ $$invalidate(3, isPreviewMode = $$props2.isPreviewMode);
6259
6281
  if ("isPreviewModeInteractive" in $$props2)
6260
- $$invalidate(30, isPreviewModeInteractive = $$props2.isPreviewModeInteractive);
6282
+ $$invalidate(4, isPreviewModeInteractive = $$props2.isPreviewModeInteractive);
6261
6283
  if ("isPreviewCheckedAnswer" in $$props2)
6262
6284
  $$invalidate(31, isPreviewCheckedAnswer = $$props2.isPreviewCheckedAnswer);
6263
6285
  if ("sessionId" in $$props2)
6264
- $$invalidate(3, sessionId = $$props2.sessionId);
6286
+ $$invalidate(5, sessionId = $$props2.sessionId);
6265
6287
  };
6266
6288
  $$self.$$.update = () => {
6267
6289
  if ($$self.$$.dirty[1] & /*isPreviewCheckedAnswer*/
@@ -6276,6 +6298,8 @@
6276
6298
  isFinished,
6277
6299
  isResultCorrect,
6278
6300
  isDataSaving,
6301
+ isPreviewMode,
6302
+ isPreviewModeInteractive,
6279
6303
  sessionId,
6280
6304
  root,
6281
6305
  typeinAnswer,
@@ -6302,8 +6326,6 @@
6302
6326
  handleFocus,
6303
6327
  handleClick,
6304
6328
  sessionData,
6305
- isPreviewMode,
6306
- isPreviewModeInteractive,
6307
6329
  isPreviewCheckedAnswer,
6308
6330
  div0_binding,
6309
6331
  input_input_handler,
@@ -6327,21 +6349,21 @@
6327
6349
  create_fragment11,
6328
6350
  safe_not_equal,
6329
6351
  {
6330
- sessionData: 28,
6352
+ sessionData: 30,
6331
6353
  isDataSaving: 2,
6332
6354
  isFinished: 0,
6333
6355
  isResultCorrect: 1,
6334
- isPreviewMode: 29,
6335
- isPreviewModeInteractive: 30,
6356
+ isPreviewMode: 3,
6357
+ isPreviewModeInteractive: 4,
6336
6358
  isPreviewCheckedAnswer: 31,
6337
- sessionId: 3
6359
+ sessionId: 5
6338
6360
  },
6339
6361
  null,
6340
6362
  [-1, -1, -1]
6341
6363
  );
6342
6364
  }
6343
6365
  get sessionData() {
6344
- return this.$$.ctx[28];
6366
+ return this.$$.ctx[30];
6345
6367
  }
6346
6368
  set sessionData(sessionData) {
6347
6369
  this.$$set({ sessionData });
@@ -6369,14 +6391,14 @@
6369
6391
  flush();
6370
6392
  }
6371
6393
  get isPreviewMode() {
6372
- return this.$$.ctx[29];
6394
+ return this.$$.ctx[3];
6373
6395
  }
6374
6396
  set isPreviewMode(isPreviewMode) {
6375
6397
  this.$$set({ isPreviewMode });
6376
6398
  flush();
6377
6399
  }
6378
6400
  get isPreviewModeInteractive() {
6379
- return this.$$.ctx[30];
6401
+ return this.$$.ctx[4];
6380
6402
  }
6381
6403
  set isPreviewModeInteractive(isPreviewModeInteractive) {
6382
6404
  this.$$set({ isPreviewModeInteractive });
@@ -6390,7 +6412,7 @@
6390
6412
  flush();
6391
6413
  }
6392
6414
  get sessionId() {
6393
- return this.$$.ctx[3];
6415
+ return this.$$.ctx[5];
6394
6416
  }
6395
6417
  set sessionId(sessionId) {
6396
6418
  this.$$set({ sessionId });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "change version": "1.0.1",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [