eat-js-sdk 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eat-prompt-builder.mjs +55 -76
- package/package.json +1 -1
|
@@ -1586,7 +1586,7 @@
|
|
|
1586
1586
|
let current;
|
|
1587
1587
|
let each_value = ensure_array_like(Object.entries(
|
|
1588
1588
|
/*options*/
|
|
1589
|
-
ctx[
|
|
1589
|
+
ctx[7]
|
|
1590
1590
|
));
|
|
1591
1591
|
let each_blocks = [];
|
|
1592
1592
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -1625,10 +1625,10 @@
|
|
|
1625
1625
|
attr(div0, "class", div0_class_value);
|
|
1626
1626
|
}
|
|
1627
1627
|
if (dirty & /*selectedOption, Object, options, isFinished, isResultCorrect, handleOptionClick*/
|
|
1628
|
-
|
|
1628
|
+
398) {
|
|
1629
1629
|
each_value = ensure_array_like(Object.entries(
|
|
1630
1630
|
/*options*/
|
|
1631
|
-
ctx2[
|
|
1631
|
+
ctx2[7]
|
|
1632
1632
|
));
|
|
1633
1633
|
let i;
|
|
1634
1634
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -1851,7 +1851,7 @@
|
|
|
1851
1851
|
function click_handler() {
|
|
1852
1852
|
return (
|
|
1853
1853
|
/*click_handler*/
|
|
1854
|
-
ctx[
|
|
1854
|
+
ctx[10](
|
|
1855
1855
|
/*option*/
|
|
1856
1856
|
ctx[17]
|
|
1857
1857
|
)
|
|
@@ -2022,7 +2022,7 @@
|
|
|
2022
2022
|
let current;
|
|
2023
2023
|
let if_block = (
|
|
2024
2024
|
/*options*/
|
|
2025
|
-
ctx[
|
|
2025
|
+
ctx[7] && create_if_block_13(ctx)
|
|
2026
2026
|
);
|
|
2027
2027
|
return {
|
|
2028
2028
|
c() {
|
|
@@ -2039,7 +2039,7 @@
|
|
|
2039
2039
|
p(ctx2, dirty) {
|
|
2040
2040
|
if (
|
|
2041
2041
|
/*options*/
|
|
2042
|
-
ctx2[
|
|
2042
|
+
ctx2[7]
|
|
2043
2043
|
)
|
|
2044
2044
|
if_block.p(ctx2, dirty);
|
|
2045
2045
|
},
|
|
@@ -2071,13 +2071,9 @@
|
|
|
2071
2071
|
/*isResultCorrect*/
|
|
2072
2072
|
ctx[2]
|
|
2073
2073
|
),
|
|
2074
|
-
resultFeedbackTitle: (
|
|
2075
|
-
/*resultFeedbackTitle*/
|
|
2076
|
-
ctx[4]
|
|
2077
|
-
),
|
|
2078
2074
|
resultFeedback: (
|
|
2079
2075
|
/*resultFeedback*/
|
|
2080
|
-
ctx[
|
|
2076
|
+
ctx[4]
|
|
2081
2077
|
)
|
|
2082
2078
|
}
|
|
2083
2079
|
});
|
|
@@ -2095,14 +2091,10 @@
|
|
|
2095
2091
|
4)
|
|
2096
2092
|
promptresult_changes.isResultCorrect = /*isResultCorrect*/
|
|
2097
2093
|
ctx2[2];
|
|
2098
|
-
if (dirty & /*resultFeedbackTitle*/
|
|
2099
|
-
16)
|
|
2100
|
-
promptresult_changes.resultFeedbackTitle = /*resultFeedbackTitle*/
|
|
2101
|
-
ctx2[4];
|
|
2102
2094
|
if (dirty & /*resultFeedback*/
|
|
2103
|
-
|
|
2095
|
+
16)
|
|
2104
2096
|
promptresult_changes.resultFeedback = /*resultFeedback*/
|
|
2105
|
-
ctx2[
|
|
2097
|
+
ctx2[4];
|
|
2106
2098
|
promptresult.$set(promptresult_changes);
|
|
2107
2099
|
},
|
|
2108
2100
|
i(local) {
|
|
@@ -2129,11 +2121,11 @@
|
|
|
2129
2121
|
props: {
|
|
2130
2122
|
rubric: (
|
|
2131
2123
|
/*rubric*/
|
|
2132
|
-
ctx[
|
|
2124
|
+
ctx[5].text
|
|
2133
2125
|
),
|
|
2134
2126
|
prompt: (
|
|
2135
2127
|
/*prompt*/
|
|
2136
|
-
ctx[
|
|
2128
|
+
ctx[6]
|
|
2137
2129
|
),
|
|
2138
2130
|
$$slots: { default: [create_default_slot] },
|
|
2139
2131
|
$$scope: { ctx }
|
|
@@ -2251,7 +2243,7 @@
|
|
|
2251
2243
|
const click_handler = (option) => handleOptionClick(option.id, option.answer);
|
|
2252
2244
|
$$self.$$set = ($$props2) => {
|
|
2253
2245
|
if ("sessionData" in $$props2)
|
|
2254
|
-
$$invalidate(
|
|
2246
|
+
$$invalidate(9, sessionData = $$props2.sessionData);
|
|
2255
2247
|
if ("isDataSaving" in $$props2)
|
|
2256
2248
|
$$invalidate(0, isDataSaving = $$props2.isDataSaving);
|
|
2257
2249
|
if ("isFinished" in $$props2)
|
|
@@ -2264,7 +2256,6 @@
|
|
|
2264
2256
|
isFinished,
|
|
2265
2257
|
isResultCorrect,
|
|
2266
2258
|
selectedOption,
|
|
2267
|
-
resultFeedbackTitle,
|
|
2268
2259
|
resultFeedback,
|
|
2269
2260
|
rubric,
|
|
2270
2261
|
prompt,
|
|
@@ -2278,14 +2269,14 @@
|
|
|
2278
2269
|
constructor(options) {
|
|
2279
2270
|
super();
|
|
2280
2271
|
init(this, options, instance3, create_fragment5, safe_not_equal, {
|
|
2281
|
-
sessionData:
|
|
2272
|
+
sessionData: 9,
|
|
2282
2273
|
isDataSaving: 0,
|
|
2283
2274
|
isFinished: 1,
|
|
2284
2275
|
isResultCorrect: 2
|
|
2285
2276
|
});
|
|
2286
2277
|
}
|
|
2287
2278
|
get sessionData() {
|
|
2288
|
-
return this.$$.ctx[
|
|
2279
|
+
return this.$$.ctx[9];
|
|
2289
2280
|
}
|
|
2290
2281
|
set sessionData(sessionData) {
|
|
2291
2282
|
this.$$set({ sessionData });
|
|
@@ -2408,13 +2399,13 @@
|
|
|
2408
2399
|
textarea,
|
|
2409
2400
|
"aria-label",
|
|
2410
2401
|
/*textAriaLabel*/
|
|
2411
|
-
ctx[
|
|
2402
|
+
ctx[7]
|
|
2412
2403
|
);
|
|
2413
2404
|
attr(
|
|
2414
2405
|
textarea,
|
|
2415
2406
|
"placeholder",
|
|
2416
2407
|
/*placeholder*/
|
|
2417
|
-
ctx[
|
|
2408
|
+
ctx[5]
|
|
2418
2409
|
);
|
|
2419
2410
|
attr(textarea, "rows", "3");
|
|
2420
2411
|
attr(textarea, "class", textarea_class_value = "typein-textbox overflow-hidden " + (!/*isFinished*/
|
|
@@ -2441,38 +2432,38 @@
|
|
|
2441
2432
|
textarea,
|
|
2442
2433
|
"input",
|
|
2443
2434
|
/*textarea_input_handler*/
|
|
2444
|
-
ctx[
|
|
2435
|
+
ctx[20]
|
|
2445
2436
|
),
|
|
2446
2437
|
listen(
|
|
2447
2438
|
textarea,
|
|
2448
2439
|
"mousedown",
|
|
2449
2440
|
/*mousedown_handler*/
|
|
2450
|
-
ctx[
|
|
2441
|
+
ctx[21]
|
|
2451
2442
|
),
|
|
2452
2443
|
listen(
|
|
2453
2444
|
textarea,
|
|
2454
2445
|
"touchstart",
|
|
2455
2446
|
/*touchstart_handler*/
|
|
2456
|
-
ctx[
|
|
2447
|
+
ctx[22],
|
|
2457
2448
|
{ passive: true }
|
|
2458
2449
|
),
|
|
2459
2450
|
listen(
|
|
2460
2451
|
textarea,
|
|
2461
2452
|
"focus",
|
|
2462
2453
|
/*focus_handler*/
|
|
2463
|
-
ctx[
|
|
2454
|
+
ctx[23]
|
|
2464
2455
|
),
|
|
2465
2456
|
listen(
|
|
2466
2457
|
textarea,
|
|
2467
2458
|
"focusout",
|
|
2468
2459
|
/*focusout_handler_1*/
|
|
2469
|
-
ctx[
|
|
2460
|
+
ctx[24]
|
|
2470
2461
|
),
|
|
2471
2462
|
listen(
|
|
2472
2463
|
textarea,
|
|
2473
2464
|
"keydown",
|
|
2474
2465
|
/*keydown_handler_1*/
|
|
2475
|
-
ctx[
|
|
2466
|
+
ctx[25]
|
|
2476
2467
|
),
|
|
2477
2468
|
action_destroyer(autosize_action = svelte_autosize_default.call(null, textarea))
|
|
2478
2469
|
];
|
|
@@ -2481,21 +2472,21 @@
|
|
|
2481
2472
|
},
|
|
2482
2473
|
p(ctx2, dirty) {
|
|
2483
2474
|
if (dirty[0] & /*textAriaLabel*/
|
|
2484
|
-
|
|
2475
|
+
128) {
|
|
2485
2476
|
attr(
|
|
2486
2477
|
textarea,
|
|
2487
2478
|
"aria-label",
|
|
2488
2479
|
/*textAriaLabel*/
|
|
2489
|
-
ctx2[
|
|
2480
|
+
ctx2[7]
|
|
2490
2481
|
);
|
|
2491
2482
|
}
|
|
2492
2483
|
if (dirty[0] & /*placeholder*/
|
|
2493
|
-
|
|
2484
|
+
32) {
|
|
2494
2485
|
attr(
|
|
2495
2486
|
textarea,
|
|
2496
2487
|
"placeholder",
|
|
2497
2488
|
/*placeholder*/
|
|
2498
|
-
ctx2[
|
|
2489
|
+
ctx2[5]
|
|
2499
2490
|
);
|
|
2500
2491
|
}
|
|
2501
2492
|
if (dirty[0] & /*isFinished, isResultCorrect*/
|
|
@@ -2548,13 +2539,13 @@
|
|
|
2548
2539
|
input,
|
|
2549
2540
|
"aria-label",
|
|
2550
2541
|
/*textAriaLabel*/
|
|
2551
|
-
ctx[
|
|
2542
|
+
ctx[7]
|
|
2552
2543
|
);
|
|
2553
2544
|
attr(
|
|
2554
2545
|
input,
|
|
2555
2546
|
"placeholder",
|
|
2556
2547
|
/*placeholder*/
|
|
2557
|
-
ctx[
|
|
2548
|
+
ctx[5]
|
|
2558
2549
|
);
|
|
2559
2550
|
attr(input, "class", input_class_value = "typein-textbox " + (!/*isFinished*/
|
|
2560
2551
|
ctx[1] ? "" : (
|
|
@@ -2580,19 +2571,19 @@
|
|
|
2580
2571
|
input,
|
|
2581
2572
|
"input",
|
|
2582
2573
|
/*input_input_handler*/
|
|
2583
|
-
ctx[
|
|
2574
|
+
ctx[17]
|
|
2584
2575
|
),
|
|
2585
2576
|
listen(
|
|
2586
2577
|
input,
|
|
2587
2578
|
"focusout",
|
|
2588
2579
|
/*focusout_handler*/
|
|
2589
|
-
ctx[
|
|
2580
|
+
ctx[18]
|
|
2590
2581
|
),
|
|
2591
2582
|
listen(
|
|
2592
2583
|
input,
|
|
2593
2584
|
"keydown",
|
|
2594
2585
|
/*keydown_handler*/
|
|
2595
|
-
ctx[
|
|
2586
|
+
ctx[19]
|
|
2596
2587
|
)
|
|
2597
2588
|
];
|
|
2598
2589
|
mounted = true;
|
|
@@ -2600,21 +2591,21 @@
|
|
|
2600
2591
|
},
|
|
2601
2592
|
p(ctx2, dirty) {
|
|
2602
2593
|
if (dirty[0] & /*textAriaLabel*/
|
|
2603
|
-
|
|
2594
|
+
128) {
|
|
2604
2595
|
attr(
|
|
2605
2596
|
input,
|
|
2606
2597
|
"aria-label",
|
|
2607
2598
|
/*textAriaLabel*/
|
|
2608
|
-
ctx2[
|
|
2599
|
+
ctx2[7]
|
|
2609
2600
|
);
|
|
2610
2601
|
}
|
|
2611
2602
|
if (dirty[0] & /*placeholder*/
|
|
2612
|
-
|
|
2603
|
+
32) {
|
|
2613
2604
|
attr(
|
|
2614
2605
|
input,
|
|
2615
2606
|
"placeholder",
|
|
2616
2607
|
/*placeholder*/
|
|
2617
|
-
ctx2[
|
|
2608
|
+
ctx2[5]
|
|
2618
2609
|
);
|
|
2619
2610
|
}
|
|
2620
2611
|
if (dirty[0] & /*isFinished, isResultCorrect*/
|
|
@@ -2659,7 +2650,7 @@
|
|
|
2659
2650
|
function select_block_type(ctx2, dirty) {
|
|
2660
2651
|
if (
|
|
2661
2652
|
/*typeinType*/
|
|
2662
|
-
ctx2[
|
|
2653
|
+
ctx2[10] === TYPEIN_TYPE_SHORT
|
|
2663
2654
|
)
|
|
2664
2655
|
return create_if_block_22;
|
|
2665
2656
|
return create_else_block_1;
|
|
@@ -2717,13 +2708,9 @@
|
|
|
2717
2708
|
/*isResultCorrect*/
|
|
2718
2709
|
ctx[2]
|
|
2719
2710
|
),
|
|
2720
|
-
resultFeedbackTitle: (
|
|
2721
|
-
/*resultFeedbackTitle*/
|
|
2722
|
-
ctx[4]
|
|
2723
|
-
),
|
|
2724
2711
|
resultFeedback: (
|
|
2725
2712
|
/*resultFeedback*/
|
|
2726
|
-
ctx[
|
|
2713
|
+
ctx[4]
|
|
2727
2714
|
)
|
|
2728
2715
|
}
|
|
2729
2716
|
});
|
|
@@ -2736,7 +2723,7 @@
|
|
|
2736
2723
|
span1 = element("span");
|
|
2737
2724
|
t1 = text(
|
|
2738
2725
|
/*resultLabel*/
|
|
2739
|
-
ctx[
|
|
2726
|
+
ctx[6]
|
|
2740
2727
|
);
|
|
2741
2728
|
t2 = space();
|
|
2742
2729
|
create_component(promptresult.$$.fragment);
|
|
@@ -2745,7 +2732,7 @@
|
|
|
2745
2732
|
attr(span1, "class", "p2");
|
|
2746
2733
|
attr(div, "aria-hidden", "true");
|
|
2747
2734
|
attr(div, "class", div_class_value = "flex items-center text-charcoal " + /*typeinType*/
|
|
2748
|
-
(ctx[
|
|
2735
|
+
(ctx[10] === TYPEIN_TYPE_SHORT ? "mt-2" : "mt-0.5"));
|
|
2749
2736
|
},
|
|
2750
2737
|
m(target, anchor) {
|
|
2751
2738
|
insert(target, div, anchor);
|
|
@@ -2782,25 +2769,21 @@
|
|
|
2782
2769
|
attr(span0, "class", span0_class_value);
|
|
2783
2770
|
}
|
|
2784
2771
|
if (!current || dirty[0] & /*resultLabel*/
|
|
2785
|
-
|
|
2772
|
+
64)
|
|
2786
2773
|
set_data(
|
|
2787
2774
|
t1,
|
|
2788
2775
|
/*resultLabel*/
|
|
2789
|
-
ctx2[
|
|
2776
|
+
ctx2[6]
|
|
2790
2777
|
);
|
|
2791
2778
|
const promptresult_changes = {};
|
|
2792
2779
|
if (dirty[0] & /*isResultCorrect*/
|
|
2793
2780
|
4)
|
|
2794
2781
|
promptresult_changes.isResultCorrect = /*isResultCorrect*/
|
|
2795
2782
|
ctx2[2];
|
|
2796
|
-
if (dirty[0] & /*resultFeedbackTitle*/
|
|
2797
|
-
16)
|
|
2798
|
-
promptresult_changes.resultFeedbackTitle = /*resultFeedbackTitle*/
|
|
2799
|
-
ctx2[4];
|
|
2800
2783
|
if (dirty[0] & /*resultFeedback*/
|
|
2801
|
-
|
|
2784
|
+
16)
|
|
2802
2785
|
promptresult_changes.resultFeedback = /*resultFeedback*/
|
|
2803
|
-
ctx2[
|
|
2786
|
+
ctx2[4];
|
|
2804
2787
|
promptresult.$set(promptresult_changes);
|
|
2805
2788
|
},
|
|
2806
2789
|
i(local) {
|
|
@@ -2888,11 +2871,11 @@
|
|
|
2888
2871
|
props: {
|
|
2889
2872
|
rubric: (
|
|
2890
2873
|
/*rubric*/
|
|
2891
|
-
ctx[
|
|
2874
|
+
ctx[8].text
|
|
2892
2875
|
),
|
|
2893
2876
|
prompt: (
|
|
2894
2877
|
/*prompt*/
|
|
2895
|
-
ctx[
|
|
2878
|
+
ctx[9]
|
|
2896
2879
|
),
|
|
2897
2880
|
$$slots: { default: [create_default_slot2] },
|
|
2898
2881
|
$$scope: { ctx }
|
|
@@ -2921,8 +2904,8 @@
|
|
|
2921
2904
|
p(ctx2, dirty) {
|
|
2922
2905
|
const promptbody_changes = {};
|
|
2923
2906
|
if (dirty[0] & /*textAriaLabel, placeholder, isFinished, isResultCorrect, isDataSaving, typeinAnswer*/
|
|
2924
|
-
|
|
2925
|
-
|
|
2907
|
+
175 | dirty[1] & /*$$scope*/
|
|
2908
|
+
2) {
|
|
2926
2909
|
promptbody_changes.$$scope = { dirty, ctx: ctx2 };
|
|
2927
2910
|
}
|
|
2928
2911
|
promptbody.$set(promptbody_changes);
|
|
@@ -2983,7 +2966,6 @@
|
|
|
2983
2966
|
const dispatch = createEventDispatcher();
|
|
2984
2967
|
let typeinAnswer;
|
|
2985
2968
|
let latestAnswer = "";
|
|
2986
|
-
let resultFeedbackTitle = "";
|
|
2987
2969
|
let resultFeedback = "";
|
|
2988
2970
|
let placeholder = "Type your answer here";
|
|
2989
2971
|
let focusOrigin = "tab";
|
|
@@ -3003,9 +2985,7 @@
|
|
|
3003
2985
|
placeholder = isResultCorrect ? placeholder : "No answer provided";
|
|
3004
2986
|
if (!isPreviewMode) {
|
|
3005
2987
|
const { correct: correctFeeback, incorrect: incorrectFeedback } = interaction.feedback;
|
|
3006
|
-
|
|
3007
|
-
resultFeedbackTitle = header;
|
|
3008
|
-
resultFeedback = text2;
|
|
2988
|
+
resultFeedback = isResultCorrect ? correctFeeback : incorrectFeedback;
|
|
3009
2989
|
}
|
|
3010
2990
|
}
|
|
3011
2991
|
const saveAnswer = () => {
|
|
@@ -3048,7 +3028,7 @@
|
|
|
3048
3028
|
const keydown_handler_1 = (event) => saveOnEnter(event);
|
|
3049
3029
|
$$self.$$set = ($$props2) => {
|
|
3050
3030
|
if ("sessionData" in $$props2)
|
|
3051
|
-
$$invalidate(
|
|
3031
|
+
$$invalidate(15, sessionData = $$props2.sessionData);
|
|
3052
3032
|
if ("isDataSaving" in $$props2)
|
|
3053
3033
|
$$invalidate(0, isDataSaving = $$props2.isDataSaving);
|
|
3054
3034
|
if ("isFinished" in $$props2)
|
|
@@ -3056,14 +3036,13 @@
|
|
|
3056
3036
|
if ("isResultCorrect" in $$props2)
|
|
3057
3037
|
$$invalidate(2, isResultCorrect = $$props2.isResultCorrect);
|
|
3058
3038
|
if ("isPreviewMode" in $$props2)
|
|
3059
|
-
$$invalidate(
|
|
3039
|
+
$$invalidate(16, isPreviewMode = $$props2.isPreviewMode);
|
|
3060
3040
|
};
|
|
3061
3041
|
return [
|
|
3062
3042
|
isDataSaving,
|
|
3063
3043
|
isFinished,
|
|
3064
3044
|
isResultCorrect,
|
|
3065
3045
|
typeinAnswer,
|
|
3066
|
-
resultFeedbackTitle,
|
|
3067
3046
|
resultFeedback,
|
|
3068
3047
|
placeholder,
|
|
3069
3048
|
resultLabel,
|
|
@@ -3098,18 +3077,18 @@
|
|
|
3098
3077
|
create_fragment6,
|
|
3099
3078
|
safe_not_equal,
|
|
3100
3079
|
{
|
|
3101
|
-
sessionData:
|
|
3080
|
+
sessionData: 15,
|
|
3102
3081
|
isDataSaving: 0,
|
|
3103
3082
|
isFinished: 1,
|
|
3104
3083
|
isResultCorrect: 2,
|
|
3105
|
-
isPreviewMode:
|
|
3084
|
+
isPreviewMode: 16
|
|
3106
3085
|
},
|
|
3107
3086
|
null,
|
|
3108
3087
|
[-1, -1]
|
|
3109
3088
|
);
|
|
3110
3089
|
}
|
|
3111
3090
|
get sessionData() {
|
|
3112
|
-
return this.$$.ctx[
|
|
3091
|
+
return this.$$.ctx[15];
|
|
3113
3092
|
}
|
|
3114
3093
|
set sessionData(sessionData) {
|
|
3115
3094
|
this.$$set({ sessionData });
|
|
@@ -3137,7 +3116,7 @@
|
|
|
3137
3116
|
flush();
|
|
3138
3117
|
}
|
|
3139
3118
|
get isPreviewMode() {
|
|
3140
|
-
return this.$$.ctx[
|
|
3119
|
+
return this.$$.ctx[16];
|
|
3141
3120
|
}
|
|
3142
3121
|
set isPreviewMode(isPreviewMode) {
|
|
3143
3122
|
this.$$set({ isPreviewMode });
|
|
@@ -3670,7 +3649,7 @@
|
|
|
3670
3649
|
};
|
|
3671
3650
|
const getSessionScore = async () => {
|
|
3672
3651
|
try {
|
|
3673
|
-
const { data } = await useGet(`sessions/${sessionId}/score`);
|
|
3652
|
+
const { data } = await useGet(`sessions/${sessionId}/score${skipUserValidationStr}`);
|
|
3674
3653
|
if (data) {
|
|
3675
3654
|
const { metadata, scoring } = data[0];
|
|
3676
3655
|
const { answer, has_answer: hasAnswer } = metadata;
|