eat-js-sdk 1.0.14 → 1.0.15

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.
@@ -3089,8 +3089,8 @@
3089
3089
  // src/lib/components/prompt/mcq/PromptMCQ.svelte
3090
3090
  function get_each_context(ctx, list, i) {
3091
3091
  const child_ctx = ctx.slice();
3092
- child_ctx[24] = list[i];
3093
- child_ctx[26] = i;
3092
+ child_ctx[23] = list[i];
3093
+ child_ctx[25] = i;
3094
3094
  return child_ctx;
3095
3095
  }
3096
3096
  function create_if_block_14(ctx) {
@@ -3101,7 +3101,7 @@
3101
3101
  let current;
3102
3102
  let each_value = ensure_array_like(Object.values(
3103
3103
  /*options*/
3104
- ctx[12]
3104
+ ctx[11]
3105
3105
  ));
3106
3106
  let each_blocks = [];
3107
3107
  for (let i = 0; i < each_value.length; i += 1) {
@@ -3140,10 +3140,10 @@
3140
3140
  attr(div0, "class", div0_class_value);
3141
3141
  }
3142
3142
  if (dirty & /*correctAnswersLength, selectedOptions, Object, options, isFinished, correctAnswerIds, isPreviewMode, isPreviewModeInteractive, handleOptionClick*/
3143
- 12730) {
3143
+ 6366) {
3144
3144
  each_value = ensure_array_like(Object.values(
3145
3145
  /*options*/
3146
- ctx2[12]
3146
+ ctx2[11]
3147
3147
  ));
3148
3148
  let i;
3149
3149
  for (i = 0; i < each_value.length; i += 1) {
@@ -3217,20 +3217,20 @@
3217
3217
  const if_blocks = [];
3218
3218
  function select_block_type(ctx2, dirty) {
3219
3219
  if (dirty & /*correctAnswerIds, isFinished, isPreviewMode, isPreviewModeInteractive, selectedOptions*/
3220
- 314)
3220
+ 158)
3221
3221
  show_if = null;
3222
3222
  if (show_if == null)
3223
3223
  show_if = !!/*correctAnswerIds*/
3224
- (ctx2[8]?.includes(
3224
+ (ctx2[7]?.includes(
3225
3225
  /*option*/
3226
- ctx2[24].id
3226
+ ctx2[23].id
3227
3227
  ) && /*isFinished*/
3228
3228
  ctx2[1] || /*isPreviewMode*/
3229
- ctx2[3] && !/*isPreviewModeInteractive*/
3230
- ctx2[4] && /*selectedOptions*/
3231
- ctx2[5].includes(
3229
+ ctx2[2] && !/*isPreviewModeInteractive*/
3230
+ ctx2[3] && /*selectedOptions*/
3231
+ ctx2[4].includes(
3232
3232
  /*option*/
3233
- ctx2[24].id
3233
+ ctx2[23].id
3234
3234
  ));
3235
3235
  if (show_if)
3236
3236
  return 0;
@@ -3245,20 +3245,20 @@
3245
3245
  attr(span, "aria-hidden", "true");
3246
3246
  attr(span, "class", span_class_value = /*isFinished*/
3247
3247
  (ctx[1] && /*correctAnswerIds*/
3248
- ctx[8]?.includes(
3248
+ ctx[7]?.includes(
3249
3249
  /*option*/
3250
- ctx[24].id
3250
+ ctx[23].id
3251
3251
  ) || /*correctAnswerIds*/
3252
- ctx[8]?.includes(
3252
+ ctx[7]?.includes(
3253
3253
  /*option*/
3254
- ctx[24].id
3254
+ ctx[23].id
3255
3255
  ) && /*isFinished*/
3256
3256
  ctx[1] || /*isPreviewMode*/
3257
- ctx[3] && !/*isPreviewModeInteractive*/
3258
- ctx[4] && /*selectedOptions*/
3259
- ctx[5].includes(
3257
+ ctx[2] && !/*isPreviewModeInteractive*/
3258
+ ctx[3] && /*selectedOptions*/
3259
+ ctx[4].includes(
3260
3260
  /*option*/
3261
- ctx[24].id
3261
+ ctx[23].id
3262
3262
  ) ? "text-green-800" : "text-red-800") + " p-0.5");
3263
3263
  },
3264
3264
  m(target, anchor) {
@@ -3285,22 +3285,22 @@
3285
3285
  if_block.m(span, null);
3286
3286
  }
3287
3287
  if (!current || dirty & /*isFinished, correctAnswerIds, isPreviewMode, isPreviewModeInteractive, selectedOptions*/
3288
- 314 && span_class_value !== (span_class_value = /*isFinished*/
3288
+ 158 && span_class_value !== (span_class_value = /*isFinished*/
3289
3289
  (ctx2[1] && /*correctAnswerIds*/
3290
- ctx2[8]?.includes(
3290
+ ctx2[7]?.includes(
3291
3291
  /*option*/
3292
- ctx2[24].id
3292
+ ctx2[23].id
3293
3293
  ) || /*correctAnswerIds*/
3294
- ctx2[8]?.includes(
3294
+ ctx2[7]?.includes(
3295
3295
  /*option*/
3296
- ctx2[24].id
3296
+ ctx2[23].id
3297
3297
  ) && /*isFinished*/
3298
3298
  ctx2[1] || /*isPreviewMode*/
3299
- ctx2[3] && !/*isPreviewModeInteractive*/
3300
- ctx2[4] && /*selectedOptions*/
3301
- ctx2[5].includes(
3299
+ ctx2[2] && !/*isPreviewModeInteractive*/
3300
+ ctx2[3] && /*selectedOptions*/
3301
+ ctx2[4].includes(
3302
3302
  /*option*/
3303
- ctx2[24].id
3303
+ ctx2[23].id
3304
3304
  ) ? "text-green-800" : "text-red-800") + " p-0.5")) {
3305
3305
  attr(span, "class", span_class_value);
3306
3306
  }
@@ -3381,9 +3381,9 @@
3381
3381
  let span;
3382
3382
  let show_if = (
3383
3383
  /*selectedOptions*/
3384
- ctx[5].includes(
3384
+ ctx[4].includes(
3385
3385
  /*option*/
3386
- ctx[24].id
3386
+ ctx[23].id
3387
3387
  )
3388
3388
  );
3389
3389
  let span_class_value;
@@ -3395,9 +3395,9 @@
3395
3395
  if (if_block)
3396
3396
  if_block.c();
3397
3397
  attr(span, "class", span_class_value = "custom-checkbox " + /*selectedOptions*/
3398
- (ctx[5].includes(
3398
+ (ctx[4].includes(
3399
3399
  /*option*/
3400
- ctx[24].id
3400
+ ctx[23].id
3401
3401
  ) ? "border-soft-blue group-active:border-soft-blue" : "border-gray-850"));
3402
3402
  },
3403
3403
  m(target, anchor) {
@@ -3408,16 +3408,16 @@
3408
3408
  },
3409
3409
  p(ctx2, dirty) {
3410
3410
  if (dirty & /*selectedOptions*/
3411
- 32)
3411
+ 16)
3412
3412
  show_if = /*selectedOptions*/
3413
- ctx2[5].includes(
3413
+ ctx2[4].includes(
3414
3414
  /*option*/
3415
- ctx2[24].id
3415
+ ctx2[23].id
3416
3416
  );
3417
3417
  if (show_if) {
3418
3418
  if (if_block) {
3419
3419
  if (dirty & /*selectedOptions*/
3420
- 32) {
3420
+ 16) {
3421
3421
  transition_in(if_block, 1);
3422
3422
  }
3423
3423
  } else {
@@ -3434,10 +3434,10 @@
3434
3434
  check_outros();
3435
3435
  }
3436
3436
  if (!current || dirty & /*selectedOptions*/
3437
- 32 && span_class_value !== (span_class_value = "custom-checkbox " + /*selectedOptions*/
3438
- (ctx2[5].includes(
3437
+ 16 && span_class_value !== (span_class_value = "custom-checkbox " + /*selectedOptions*/
3438
+ (ctx2[4].includes(
3439
3439
  /*option*/
3440
- ctx2[24].id
3440
+ ctx2[23].id
3441
3441
  ) ? "border-soft-blue group-active:border-soft-blue" : "border-gray-850"))) {
3442
3442
  attr(span, "class", span_class_value);
3443
3443
  }
@@ -3499,11 +3499,11 @@
3499
3499
  let show_if_1 = (
3500
3500
  /*isFinished*/
3501
3501
  ctx[1] && /*selectedOptions*/
3502
- ctx[5].includes(
3502
+ ctx[4].includes(
3503
3503
  /*option*/
3504
- ctx[24].id
3504
+ ctx[23].id
3505
3505
  ) && /*correctAnswersLength*/
3506
- ctx[7] == 1
3506
+ ctx[6] == 1
3507
3507
  );
3508
3508
  let t0;
3509
3509
  let button;
@@ -3512,7 +3512,7 @@
3512
3512
  let span0;
3513
3513
  let t1_value = useMCQ_default(
3514
3514
  /*index*/
3515
- ctx[26]
3515
+ ctx[25]
3516
3516
  ) + "";
3517
3517
  let t1;
3518
3518
  let span0_class_value;
@@ -3523,9 +3523,9 @@
3523
3523
  let show_if = (
3524
3524
  /*isFinished*/
3525
3525
  ctx[1] && /*selectedOptions*/
3526
- ctx[5]?.includes(
3526
+ ctx[4]?.includes(
3527
3527
  /*option*/
3528
- ctx[24].id
3528
+ ctx[23].id
3529
3529
  )
3530
3530
  );
3531
3531
  let t4;
@@ -3542,20 +3542,20 @@
3542
3542
  commonstringtohtml = new CommonStringToHtml_default({
3543
3543
  props: { htmlString: (
3544
3544
  /*option*/
3545
- ctx[24].answer
3545
+ ctx[23].answer
3546
3546
  ) }
3547
3547
  });
3548
3548
  let if_block1 = show_if && create_if_block_42(ctx);
3549
3549
  let if_block2 = (
3550
3550
  /*correctAnswersLength*/
3551
- ctx[7] > 1 && create_if_block_23(ctx)
3551
+ ctx[6] > 1 && create_if_block_23(ctx)
3552
3552
  );
3553
3553
  function click_handler() {
3554
3554
  return (
3555
3555
  /*click_handler*/
3556
- ctx[15](
3556
+ ctx[14](
3557
3557
  /*option*/
3558
- ctx[24]
3558
+ ctx[23]
3559
3559
  )
3560
3560
  );
3561
3561
  }
@@ -3580,74 +3580,74 @@
3580
3580
  if_block2.c();
3581
3581
  t5 = space();
3582
3582
  attr(span0, "class", span0_class_value = "choice " + (!/*correctAnswersLength*/
3583
- (ctx[7] > 1) ? "group-active:border-2 group-active:border-blue-1000 group-active:p-[7px]" : ""));
3583
+ (ctx[6] > 1) ? "group-active:border-2 group-active:border-blue-1000 group-active:p-[7px]" : ""));
3584
3584
  attr(span1, "class", "flex items-center");
3585
3585
  attr(span2, "class", "flex items-center");
3586
3586
  attr(span3, "class", "grow flex items-center justify-between");
3587
3587
  attr(button, "role", button_role_value = /*correctAnswersLength*/
3588
- ctx[7] > 1 ? "checkbox" : null);
3588
+ ctx[6] > 1 ? "checkbox" : null);
3589
3589
  attr(button, "tabindex", button_tabindex_value = /*correctAnswersLength*/
3590
- ctx[7] > 1 ? 0 : null);
3590
+ ctx[6] > 1 ? 0 : null);
3591
3591
  attr(button, "aria-checked", button_aria_checked_value = /*correctAnswersLength*/
3592
- ctx[7] > 1 ? (
3592
+ ctx[6] > 1 ? (
3593
3593
  /*selectedOptions*/
3594
- ctx[5].includes(
3594
+ ctx[4].includes(
3595
3595
  /*option*/
3596
- ctx[24].id
3596
+ ctx[23].id
3597
3597
  )
3598
3598
  ) : null);
3599
3599
  attr(button, "aria-label", button_aria_label_value = `${/*selectedOptions*/
3600
- ctx[5].includes(
3600
+ ctx[4].includes(
3601
3601
  /*option*/
3602
- ctx[24].id
3602
+ ctx[23].id
3603
3603
  ) ? `Selected option ${useMCQ_default(
3604
3604
  /*index*/
3605
- ctx[26]
3605
+ ctx[25]
3606
3606
  )}` : `Option ${useMCQ_default(
3607
3607
  /*index*/
3608
- ctx[26]
3608
+ ctx[25]
3609
3609
  )}`}: ${useRemoveRichTextHtmlTags(
3610
3610
  /*option*/
3611
- ctx[24].answer
3611
+ ctx[23].answer
3612
3612
  )} ${!/*isFinished*/
3613
3613
  ctx[1] || !/*selectedOptions*/
3614
- ctx[5]?.includes(
3614
+ ctx[4]?.includes(
3615
3615
  /*option*/
3616
- ctx[24].id
3616
+ ctx[23].id
3617
3617
  ) ? "" : (
3618
3618
  /*correctAnswerIds*/
3619
- ctx[8].includes(
3619
+ ctx[7].includes(
3620
3620
  /*option*/
3621
- ctx[24].id
3621
+ ctx[23].id
3622
3622
  ) || /*isPreviewMode*/
3623
- ctx[3] && !/*isPreviewModeInteractive*/
3624
- ctx[4] && /*selectedOptions*/
3625
- ctx[5].includes(
3623
+ ctx[2] && !/*isPreviewModeInteractive*/
3624
+ ctx[3] && /*selectedOptions*/
3625
+ ctx[4].includes(
3626
3626
  /*option*/
3627
- ctx[24].id
3627
+ ctx[23].id
3628
3628
  ) ? "(Correct answer)" : "(Incorrect answer)"
3629
3629
  )}`);
3630
3630
  attr(button, "class", button_class_value = "group text-left " + /*correctAnswersLength*/
3631
- (ctx[7] > 1 ? "btn-multi-mcq-option" : "btn-single-mcq-option") + " " + /*correctAnswersLength*/
3632
- (ctx[7] > 1 ? "focus-ring-by" : "") + " " + /*correctAnswersLength*/
3633
- (ctx[7] > 1 && (!/*isFinished*/
3631
+ (ctx[6] > 1 ? "btn-multi-mcq-option" : "btn-single-mcq-option") + " " + /*correctAnswersLength*/
3632
+ (ctx[6] > 1 ? "focus-ring-by" : "") + " " + /*correctAnswersLength*/
3633
+ (ctx[6] > 1 && (!/*isFinished*/
3634
3634
  ctx[1] || /*isPreviewModeInteractive*/
3635
- ctx[4]) ? "active:raw-focus-ring-by" : "") + " " + /*selectedOptions*/
3636
- (ctx[5].includes(
3635
+ ctx[3]) ? "active:raw-focus-ring-by" : "") + " " + /*selectedOptions*/
3636
+ (ctx[4].includes(
3637
3637
  /*option*/
3638
- ctx[24].id
3638
+ ctx[23].id
3639
3639
  ) ? "selected" : "") + " " + (!/*isFinished*/
3640
3640
  ctx[1] ? "" : (
3641
3641
  /*correctAnswerIds*/
3642
- ctx[8].includes(
3642
+ ctx[7].includes(
3643
3643
  /*option*/
3644
- ctx[24].id
3644
+ ctx[23].id
3645
3645
  ) || /*isPreviewMode*/
3646
- ctx[3] && !/*isPreviewModeInteractive*/
3647
- ctx[4] && /*selectedOptions*/
3648
- ctx[5].includes(
3646
+ ctx[2] && !/*isPreviewModeInteractive*/
3647
+ ctx[3] && /*selectedOptions*/
3648
+ ctx[4].includes(
3649
3649
  /*option*/
3650
- ctx[24].id
3650
+ ctx[23].id
3651
3651
  ) ? "correct" : "incorrect"
3652
3652
  )));
3653
3653
  },
@@ -3679,14 +3679,14 @@
3679
3679
  p(new_ctx, dirty) {
3680
3680
  ctx = new_ctx;
3681
3681
  if (dirty & /*isFinished, selectedOptions, correctAnswersLength*/
3682
- 162)
3682
+ 82)
3683
3683
  show_if_1 = /*isFinished*/
3684
3684
  ctx[1] && /*selectedOptions*/
3685
- ctx[5].includes(
3685
+ ctx[4].includes(
3686
3686
  /*option*/
3687
- ctx[24].id
3687
+ ctx[23].id
3688
3688
  ) && /*correctAnswersLength*/
3689
- ctx[7] == 1;
3689
+ ctx[6] == 1;
3690
3690
  if (show_if_1) {
3691
3691
  if (if_block0) {
3692
3692
  } else {
@@ -3699,23 +3699,23 @@
3699
3699
  if_block0 = null;
3700
3700
  }
3701
3701
  if (!current || dirty & /*correctAnswersLength*/
3702
- 128 && span0_class_value !== (span0_class_value = "choice " + (!/*correctAnswersLength*/
3703
- (ctx[7] > 1) ? "group-active:border-2 group-active:border-blue-1000 group-active:p-[7px]" : ""))) {
3702
+ 64 && span0_class_value !== (span0_class_value = "choice " + (!/*correctAnswersLength*/
3703
+ (ctx[6] > 1) ? "group-active:border-2 group-active:border-blue-1000 group-active:p-[7px]" : ""))) {
3704
3704
  attr(span0, "class", span0_class_value);
3705
3705
  }
3706
3706
  if (dirty & /*isFinished, selectedOptions*/
3707
- 34)
3707
+ 18)
3708
3708
  show_if = /*isFinished*/
3709
3709
  ctx[1] && /*selectedOptions*/
3710
- ctx[5]?.includes(
3710
+ ctx[4]?.includes(
3711
3711
  /*option*/
3712
- ctx[24].id
3712
+ ctx[23].id
3713
3713
  );
3714
3714
  if (show_if) {
3715
3715
  if (if_block1) {
3716
3716
  if_block1.p(ctx, dirty);
3717
3717
  if (dirty & /*isFinished, selectedOptions*/
3718
- 34) {
3718
+ 18) {
3719
3719
  transition_in(if_block1, 1);
3720
3720
  }
3721
3721
  } else {
@@ -3733,12 +3733,12 @@
3733
3733
  }
3734
3734
  if (
3735
3735
  /*correctAnswersLength*/
3736
- ctx[7] > 1
3736
+ ctx[6] > 1
3737
3737
  ) {
3738
3738
  if (if_block2) {
3739
3739
  if_block2.p(ctx, dirty);
3740
3740
  if (dirty & /*correctAnswersLength*/
3741
- 128) {
3741
+ 64) {
3742
3742
  transition_in(if_block2, 1);
3743
3743
  }
3744
3744
  } else {
@@ -3755,82 +3755,82 @@
3755
3755
  check_outros();
3756
3756
  }
3757
3757
  if (!current || dirty & /*correctAnswersLength*/
3758
- 128 && button_role_value !== (button_role_value = /*correctAnswersLength*/
3759
- ctx[7] > 1 ? "checkbox" : null)) {
3758
+ 64 && button_role_value !== (button_role_value = /*correctAnswersLength*/
3759
+ ctx[6] > 1 ? "checkbox" : null)) {
3760
3760
  attr(button, "role", button_role_value);
3761
3761
  }
3762
3762
  if (!current || dirty & /*correctAnswersLength*/
3763
- 128 && button_tabindex_value !== (button_tabindex_value = /*correctAnswersLength*/
3764
- ctx[7] > 1 ? 0 : null)) {
3763
+ 64 && button_tabindex_value !== (button_tabindex_value = /*correctAnswersLength*/
3764
+ ctx[6] > 1 ? 0 : null)) {
3765
3765
  attr(button, "tabindex", button_tabindex_value);
3766
3766
  }
3767
3767
  if (!current || dirty & /*correctAnswersLength, selectedOptions*/
3768
- 160 && button_aria_checked_value !== (button_aria_checked_value = /*correctAnswersLength*/
3769
- ctx[7] > 1 ? (
3768
+ 80 && button_aria_checked_value !== (button_aria_checked_value = /*correctAnswersLength*/
3769
+ ctx[6] > 1 ? (
3770
3770
  /*selectedOptions*/
3771
- ctx[5].includes(
3771
+ ctx[4].includes(
3772
3772
  /*option*/
3773
- ctx[24].id
3773
+ ctx[23].id
3774
3774
  )
3775
3775
  ) : null)) {
3776
3776
  attr(button, "aria-checked", button_aria_checked_value);
3777
3777
  }
3778
3778
  if (!current || dirty & /*selectedOptions, isFinished, correctAnswerIds, isPreviewMode, isPreviewModeInteractive*/
3779
- 314 && button_aria_label_value !== (button_aria_label_value = `${/*selectedOptions*/
3780
- ctx[5].includes(
3779
+ 158 && button_aria_label_value !== (button_aria_label_value = `${/*selectedOptions*/
3780
+ ctx[4].includes(
3781
3781
  /*option*/
3782
- ctx[24].id
3782
+ ctx[23].id
3783
3783
  ) ? `Selected option ${useMCQ_default(
3784
3784
  /*index*/
3785
- ctx[26]
3785
+ ctx[25]
3786
3786
  )}` : `Option ${useMCQ_default(
3787
3787
  /*index*/
3788
- ctx[26]
3788
+ ctx[25]
3789
3789
  )}`}: ${useRemoveRichTextHtmlTags(
3790
3790
  /*option*/
3791
- ctx[24].answer
3791
+ ctx[23].answer
3792
3792
  )} ${!/*isFinished*/
3793
3793
  ctx[1] || !/*selectedOptions*/
3794
- ctx[5]?.includes(
3794
+ ctx[4]?.includes(
3795
3795
  /*option*/
3796
- ctx[24].id
3796
+ ctx[23].id
3797
3797
  ) ? "" : (
3798
3798
  /*correctAnswerIds*/
3799
- ctx[8].includes(
3799
+ ctx[7].includes(
3800
3800
  /*option*/
3801
- ctx[24].id
3801
+ ctx[23].id
3802
3802
  ) || /*isPreviewMode*/
3803
- ctx[3] && !/*isPreviewModeInteractive*/
3804
- ctx[4] && /*selectedOptions*/
3805
- ctx[5].includes(
3803
+ ctx[2] && !/*isPreviewModeInteractive*/
3804
+ ctx[3] && /*selectedOptions*/
3805
+ ctx[4].includes(
3806
3806
  /*option*/
3807
- ctx[24].id
3807
+ ctx[23].id
3808
3808
  ) ? "(Correct answer)" : "(Incorrect answer)"
3809
3809
  )}`)) {
3810
3810
  attr(button, "aria-label", button_aria_label_value);
3811
3811
  }
3812
3812
  if (!current || dirty & /*correctAnswersLength, isFinished, isPreviewModeInteractive, selectedOptions, correctAnswerIds, isPreviewMode*/
3813
- 442 && button_class_value !== (button_class_value = "group text-left " + /*correctAnswersLength*/
3814
- (ctx[7] > 1 ? "btn-multi-mcq-option" : "btn-single-mcq-option") + " " + /*correctAnswersLength*/
3815
- (ctx[7] > 1 ? "focus-ring-by" : "") + " " + /*correctAnswersLength*/
3816
- (ctx[7] > 1 && (!/*isFinished*/
3813
+ 222 && button_class_value !== (button_class_value = "group text-left " + /*correctAnswersLength*/
3814
+ (ctx[6] > 1 ? "btn-multi-mcq-option" : "btn-single-mcq-option") + " " + /*correctAnswersLength*/
3815
+ (ctx[6] > 1 ? "focus-ring-by" : "") + " " + /*correctAnswersLength*/
3816
+ (ctx[6] > 1 && (!/*isFinished*/
3817
3817
  ctx[1] || /*isPreviewModeInteractive*/
3818
- ctx[4]) ? "active:raw-focus-ring-by" : "") + " " + /*selectedOptions*/
3819
- (ctx[5].includes(
3818
+ ctx[3]) ? "active:raw-focus-ring-by" : "") + " " + /*selectedOptions*/
3819
+ (ctx[4].includes(
3820
3820
  /*option*/
3821
- ctx[24].id
3821
+ ctx[23].id
3822
3822
  ) ? "selected" : "") + " " + (!/*isFinished*/
3823
3823
  ctx[1] ? "" : (
3824
3824
  /*correctAnswerIds*/
3825
- ctx[8].includes(
3825
+ ctx[7].includes(
3826
3826
  /*option*/
3827
- ctx[24].id
3827
+ ctx[23].id
3828
3828
  ) || /*isPreviewMode*/
3829
- ctx[3] && !/*isPreviewModeInteractive*/
3830
- ctx[4] && /*selectedOptions*/
3831
- ctx[5].includes(
3829
+ ctx[2] && !/*isPreviewModeInteractive*/
3830
+ ctx[3] && /*selectedOptions*/
3831
+ ctx[4].includes(
3832
3832
  /*option*/
3833
- ctx[24].id
3833
+ ctx[23].id
3834
3834
  ) ? "correct" : "incorrect"
3835
3835
  )))) {
3836
3836
  attr(button, "class", button_class_value);
@@ -3873,12 +3873,16 @@
3873
3873
  promptresult = new PromptResultFeedback_default({
3874
3874
  props: {
3875
3875
  isResultCorrect: (
3876
- /*isResultCorrect*/
3877
- ctx[2]
3876
+ /*selectedOptions*/
3877
+ ctx[4].length === 1 && /*correctAnswerIds*/
3878
+ ctx[7].includes(
3879
+ /*selectedOptions*/
3880
+ ctx[4][0]
3881
+ )
3878
3882
  ),
3879
3883
  resultFeedback: (
3880
3884
  /*resultFeedback*/
3881
- ctx[6]
3885
+ ctx[5]
3882
3886
  )
3883
3887
  }
3884
3888
  });
@@ -3892,14 +3896,18 @@
3892
3896
  },
3893
3897
  p(ctx2, dirty) {
3894
3898
  const promptresult_changes = {};
3895
- if (dirty & /*isResultCorrect*/
3896
- 4)
3897
- promptresult_changes.isResultCorrect = /*isResultCorrect*/
3898
- ctx2[2];
3899
+ if (dirty & /*selectedOptions, correctAnswerIds*/
3900
+ 144)
3901
+ promptresult_changes.isResultCorrect = /*selectedOptions*/
3902
+ ctx2[4].length === 1 && /*correctAnswerIds*/
3903
+ ctx2[7].includes(
3904
+ /*selectedOptions*/
3905
+ ctx2[4][0]
3906
+ );
3899
3907
  if (dirty & /*resultFeedback*/
3900
- 64)
3908
+ 32)
3901
3909
  promptresult_changes.resultFeedback = /*resultFeedback*/
3902
- ctx2[6];
3910
+ ctx2[5];
3903
3911
  promptresult.$set(promptresult_changes);
3904
3912
  },
3905
3913
  i(local) {
@@ -3923,12 +3931,12 @@
3923
3931
  let current;
3924
3932
  let if_block0 = (
3925
3933
  /*options*/
3926
- ctx[12] && create_if_block_14(ctx)
3934
+ ctx[11] && create_if_block_14(ctx)
3927
3935
  );
3928
3936
  let if_block1 = (
3929
3937
  /*isFinished*/
3930
3938
  ctx[1] && /*correctAnswersLength*/
3931
- ctx[7] === 1 && create_if_block5(ctx)
3939
+ ctx[6] === 1 && create_if_block5(ctx)
3932
3940
  );
3933
3941
  return {
3934
3942
  c() {
@@ -3951,18 +3959,18 @@
3951
3959
  p(ctx2, dirty) {
3952
3960
  if (
3953
3961
  /*options*/
3954
- ctx2[12]
3962
+ ctx2[11]
3955
3963
  )
3956
3964
  if_block0.p(ctx2, dirty);
3957
3965
  if (
3958
3966
  /*isFinished*/
3959
3967
  ctx2[1] && /*correctAnswersLength*/
3960
- ctx2[7] === 1
3968
+ ctx2[6] === 1
3961
3969
  ) {
3962
3970
  if (if_block1) {
3963
3971
  if_block1.p(ctx2, dirty);
3964
3972
  if (dirty & /*isFinished, correctAnswersLength*/
3965
- 130) {
3973
+ 66) {
3966
3974
  transition_in(if_block1, 1);
3967
3975
  }
3968
3976
  } else {
@@ -4010,16 +4018,16 @@
4010
4018
  props: {
4011
4019
  rubric: (
4012
4020
  /*rubric*/
4013
- ctx[9].text
4021
+ ctx[8].text
4014
4022
  ),
4015
4023
  prompt: (
4016
4024
  /*prompt*/
4017
- ctx[11]
4025
+ ctx[10]
4018
4026
  ),
4019
4027
  interactionType: INTERACTION_TYPE_MCQ,
4020
4028
  stimulus: (
4021
4029
  /*stimulus*/
4022
- ctx[10]
4030
+ ctx[9]
4023
4031
  ),
4024
4032
  $$slots: { default: [create_default_slot] },
4025
4033
  $$scope: { ctx }
@@ -4035,8 +4043,8 @@
4035
4043
  },
4036
4044
  p(ctx2, [dirty]) {
4037
4045
  const promptbody_changes = {};
4038
- if (dirty & /*$$scope, isResultCorrect, resultFeedback, isFinished, correctAnswersLength, selectedOptions, correctAnswerIds, isPreviewMode, isPreviewModeInteractive, isDataSaving*/
4039
- 134218239) {
4046
+ if (dirty & /*$$scope, selectedOptions, correctAnswerIds, resultFeedback, isFinished, correctAnswersLength, isPreviewMode, isPreviewModeInteractive, isDataSaving*/
4047
+ 67109119) {
4040
4048
  promptbody_changes.$$scope = { dirty, ctx: ctx2 };
4041
4049
  }
4042
4050
  promptbody.$set(promptbody_changes);
@@ -4060,7 +4068,6 @@
4060
4068
  let { sessionData } = $$props;
4061
4069
  let { isDataSaving } = $$props;
4062
4070
  let { isFinished = false } = $$props;
4063
- let { isResultCorrect = false } = $$props;
4064
4071
  let { isPreviewMode = false } = $$props;
4065
4072
  let { isPreviewModeInteractive = false } = $$props;
4066
4073
  const { rubric, interaction, metadata, scoringMetadata, stimulus, totalCorrectAnswers } = sessionData;
@@ -4083,7 +4090,7 @@
4083
4090
  if (!options || selectedOptions.length < 1)
4084
4091
  return;
4085
4092
  const feedbackData = Object.values(options).filter((option) => selectedOptions.includes(option.id));
4086
- $$invalidate(6, resultFeedback = feedbackData[0].feedback || resultFeedback);
4093
+ $$invalidate(5, resultFeedback = feedbackData[0].feedback || resultFeedback);
4087
4094
  };
4088
4095
  if (isFinished) {
4089
4096
  const { hasAnswer, answerIds: ansIds, correctAnswerIds: correctAnsIds } = scoringMetadata;
@@ -4117,7 +4124,7 @@
4117
4124
  selectedOptions.push(optionId);
4118
4125
  selectedChoices.push(useRemoveRichTextHtmlTags(option));
4119
4126
  }
4120
- $$invalidate(5, selectedOptions = [...selectedOptions]);
4127
+ $$invalidate(4, selectedOptions = [...selectedOptions]);
4121
4128
  selectedChoices = [...selectedChoices];
4122
4129
  dispatch("saveOption", {
4123
4130
  answer_id: [...selectedOptions],
@@ -4126,7 +4133,7 @@
4126
4133
  } else {
4127
4134
  if (selectedOptions[0] === optionId)
4128
4135
  return;
4129
- $$invalidate(5, selectedOptions = [optionId]);
4136
+ $$invalidate(4, selectedOptions = [optionId]);
4130
4137
  option = useRemoveRichTextHtmlTags(option);
4131
4138
  dispatch("saveOption", {
4132
4139
  answer_id: [optionId],
@@ -4136,7 +4143,7 @@
4136
4143
  if (isPreviewModeInteractive) {
4137
4144
  setTimeout(
4138
4145
  () => {
4139
- $$invalidate(6, resultFeedback = null);
4146
+ $$invalidate(5, resultFeedback = null);
4140
4147
  getFeedback();
4141
4148
  },
4142
4149
  50
@@ -4146,22 +4153,19 @@
4146
4153
  const click_handler = (option) => handleOptionClick(option.id, option.answer);
4147
4154
  $$self.$$set = ($$props2) => {
4148
4155
  if ("sessionData" in $$props2)
4149
- $$invalidate(14, sessionData = $$props2.sessionData);
4156
+ $$invalidate(13, sessionData = $$props2.sessionData);
4150
4157
  if ("isDataSaving" in $$props2)
4151
4158
  $$invalidate(0, isDataSaving = $$props2.isDataSaving);
4152
4159
  if ("isFinished" in $$props2)
4153
4160
  $$invalidate(1, isFinished = $$props2.isFinished);
4154
- if ("isResultCorrect" in $$props2)
4155
- $$invalidate(2, isResultCorrect = $$props2.isResultCorrect);
4156
4161
  if ("isPreviewMode" in $$props2)
4157
- $$invalidate(3, isPreviewMode = $$props2.isPreviewMode);
4162
+ $$invalidate(2, isPreviewMode = $$props2.isPreviewMode);
4158
4163
  if ("isPreviewModeInteractive" in $$props2)
4159
- $$invalidate(4, isPreviewModeInteractive = $$props2.isPreviewModeInteractive);
4164
+ $$invalidate(3, isPreviewModeInteractive = $$props2.isPreviewModeInteractive);
4160
4165
  };
4161
4166
  return [
4162
4167
  isDataSaving,
4163
4168
  isFinished,
4164
- isResultCorrect,
4165
4169
  isPreviewMode,
4166
4170
  isPreviewModeInteractive,
4167
4171
  selectedOptions,
@@ -4181,16 +4185,15 @@
4181
4185
  constructor(options) {
4182
4186
  super();
4183
4187
  init(this, options, instance5, create_fragment8, safe_not_equal, {
4184
- sessionData: 14,
4188
+ sessionData: 13,
4185
4189
  isDataSaving: 0,
4186
4190
  isFinished: 1,
4187
- isResultCorrect: 2,
4188
- isPreviewMode: 3,
4189
- isPreviewModeInteractive: 4
4191
+ isPreviewMode: 2,
4192
+ isPreviewModeInteractive: 3
4190
4193
  });
4191
4194
  }
4192
4195
  get sessionData() {
4193
- return this.$$.ctx[14];
4196
+ return this.$$.ctx[13];
4194
4197
  }
4195
4198
  set sessionData(sessionData) {
4196
4199
  this.$$set({ sessionData });
@@ -4210,29 +4213,22 @@
4210
4213
  this.$$set({ isFinished });
4211
4214
  flush();
4212
4215
  }
4213
- get isResultCorrect() {
4214
- return this.$$.ctx[2];
4215
- }
4216
- set isResultCorrect(isResultCorrect) {
4217
- this.$$set({ isResultCorrect });
4218
- flush();
4219
- }
4220
4216
  get isPreviewMode() {
4221
- return this.$$.ctx[3];
4217
+ return this.$$.ctx[2];
4222
4218
  }
4223
4219
  set isPreviewMode(isPreviewMode) {
4224
4220
  this.$$set({ isPreviewMode });
4225
4221
  flush();
4226
4222
  }
4227
4223
  get isPreviewModeInteractive() {
4228
- return this.$$.ctx[4];
4224
+ return this.$$.ctx[3];
4229
4225
  }
4230
4226
  set isPreviewModeInteractive(isPreviewModeInteractive) {
4231
4227
  this.$$set({ isPreviewModeInteractive });
4232
4228
  flush();
4233
4229
  }
4234
4230
  };
4235
- customElements.define("prompt-mcq", create_custom_element(PromptMCQ, { "sessionData": {}, "isDataSaving": {}, "isFinished": { "type": "Boolean" }, "isResultCorrect": { "type": "Boolean" }, "isPreviewMode": { "type": "Boolean" }, "isPreviewModeInteractive": { "type": "Boolean" } }, [], [], true));
4231
+ customElements.define("prompt-mcq", create_custom_element(PromptMCQ, { "sessionData": {}, "isDataSaving": {}, "isFinished": { "type": "Boolean" }, "isPreviewMode": { "type": "Boolean" }, "isPreviewModeInteractive": { "type": "Boolean" } }, [], [], true));
4236
4232
  var PromptMCQ_default = PromptMCQ;
4237
4233
 
4238
4234
  // node_modules/autosize/dist/autosize.esm.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "change version": "1.0.2",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [