eat-js-sdk 0.0.22 → 0.0.24
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 +149 -93
- 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 });
|
|
@@ -2404,8 +2395,18 @@
|
|
|
2404
2395
|
c() {
|
|
2405
2396
|
textarea = element("textarea");
|
|
2406
2397
|
attr(textarea, "id", idLabel);
|
|
2407
|
-
attr(
|
|
2408
|
-
|
|
2398
|
+
attr(
|
|
2399
|
+
textarea,
|
|
2400
|
+
"aria-label",
|
|
2401
|
+
/*textAriaLabel*/
|
|
2402
|
+
ctx[7]
|
|
2403
|
+
);
|
|
2404
|
+
attr(
|
|
2405
|
+
textarea,
|
|
2406
|
+
"placeholder",
|
|
2407
|
+
/*placeholder*/
|
|
2408
|
+
ctx[5]
|
|
2409
|
+
);
|
|
2409
2410
|
attr(textarea, "rows", "3");
|
|
2410
2411
|
attr(textarea, "class", textarea_class_value = "typein-textbox overflow-hidden " + (!/*isFinished*/
|
|
2411
2412
|
ctx[1] ? "" : (
|
|
@@ -2431,38 +2432,38 @@
|
|
|
2431
2432
|
textarea,
|
|
2432
2433
|
"input",
|
|
2433
2434
|
/*textarea_input_handler*/
|
|
2434
|
-
ctx[
|
|
2435
|
+
ctx[20]
|
|
2435
2436
|
),
|
|
2436
2437
|
listen(
|
|
2437
2438
|
textarea,
|
|
2438
2439
|
"mousedown",
|
|
2439
2440
|
/*mousedown_handler*/
|
|
2440
|
-
ctx[
|
|
2441
|
+
ctx[21]
|
|
2441
2442
|
),
|
|
2442
2443
|
listen(
|
|
2443
2444
|
textarea,
|
|
2444
2445
|
"touchstart",
|
|
2445
2446
|
/*touchstart_handler*/
|
|
2446
|
-
ctx[
|
|
2447
|
+
ctx[22],
|
|
2447
2448
|
{ passive: true }
|
|
2448
2449
|
),
|
|
2449
2450
|
listen(
|
|
2450
2451
|
textarea,
|
|
2451
2452
|
"focus",
|
|
2452
2453
|
/*focus_handler*/
|
|
2453
|
-
ctx[
|
|
2454
|
+
ctx[23]
|
|
2454
2455
|
),
|
|
2455
2456
|
listen(
|
|
2456
2457
|
textarea,
|
|
2457
2458
|
"focusout",
|
|
2458
2459
|
/*focusout_handler_1*/
|
|
2459
|
-
ctx[
|
|
2460
|
+
ctx[24]
|
|
2460
2461
|
),
|
|
2461
2462
|
listen(
|
|
2462
2463
|
textarea,
|
|
2463
2464
|
"keydown",
|
|
2464
2465
|
/*keydown_handler_1*/
|
|
2465
|
-
ctx[
|
|
2466
|
+
ctx[25]
|
|
2466
2467
|
),
|
|
2467
2468
|
action_destroyer(autosize_action = svelte_autosize_default.call(null, textarea))
|
|
2468
2469
|
];
|
|
@@ -2470,7 +2471,25 @@
|
|
|
2470
2471
|
}
|
|
2471
2472
|
},
|
|
2472
2473
|
p(ctx2, dirty) {
|
|
2473
|
-
if (dirty & /*
|
|
2474
|
+
if (dirty[0] & /*textAriaLabel*/
|
|
2475
|
+
128) {
|
|
2476
|
+
attr(
|
|
2477
|
+
textarea,
|
|
2478
|
+
"aria-label",
|
|
2479
|
+
/*textAriaLabel*/
|
|
2480
|
+
ctx2[7]
|
|
2481
|
+
);
|
|
2482
|
+
}
|
|
2483
|
+
if (dirty[0] & /*placeholder*/
|
|
2484
|
+
32) {
|
|
2485
|
+
attr(
|
|
2486
|
+
textarea,
|
|
2487
|
+
"placeholder",
|
|
2488
|
+
/*placeholder*/
|
|
2489
|
+
ctx2[5]
|
|
2490
|
+
);
|
|
2491
|
+
}
|
|
2492
|
+
if (dirty[0] & /*isFinished, isResultCorrect*/
|
|
2474
2493
|
6 && textarea_class_value !== (textarea_class_value = "typein-textbox overflow-hidden " + (!/*isFinished*/
|
|
2475
2494
|
ctx2[1] ? "" : (
|
|
2476
2495
|
/*isResultCorrect*/
|
|
@@ -2478,17 +2497,17 @@
|
|
|
2478
2497
|
)))) {
|
|
2479
2498
|
attr(textarea, "class", textarea_class_value);
|
|
2480
2499
|
}
|
|
2481
|
-
if (dirty & /*isDataSaving*/
|
|
2500
|
+
if (dirty[0] & /*isDataSaving*/
|
|
2482
2501
|
1) {
|
|
2483
2502
|
textarea.disabled = /*isDataSaving*/
|
|
2484
2503
|
ctx2[0];
|
|
2485
2504
|
}
|
|
2486
|
-
if (dirty & /*isFinished*/
|
|
2505
|
+
if (dirty[0] & /*isFinished*/
|
|
2487
2506
|
2) {
|
|
2488
2507
|
textarea.readOnly = /*isFinished*/
|
|
2489
2508
|
ctx2[1];
|
|
2490
2509
|
}
|
|
2491
|
-
if (dirty & /*typeinAnswer*/
|
|
2510
|
+
if (dirty[0] & /*typeinAnswer*/
|
|
2492
2511
|
8) {
|
|
2493
2512
|
set_input_value(
|
|
2494
2513
|
textarea,
|
|
@@ -2516,8 +2535,18 @@
|
|
|
2516
2535
|
input = element("input");
|
|
2517
2536
|
attr(input, "type", "text");
|
|
2518
2537
|
attr(input, "id", idLabel);
|
|
2519
|
-
attr(
|
|
2520
|
-
|
|
2538
|
+
attr(
|
|
2539
|
+
input,
|
|
2540
|
+
"aria-label",
|
|
2541
|
+
/*textAriaLabel*/
|
|
2542
|
+
ctx[7]
|
|
2543
|
+
);
|
|
2544
|
+
attr(
|
|
2545
|
+
input,
|
|
2546
|
+
"placeholder",
|
|
2547
|
+
/*placeholder*/
|
|
2548
|
+
ctx[5]
|
|
2549
|
+
);
|
|
2521
2550
|
attr(input, "class", input_class_value = "typein-textbox " + (!/*isFinished*/
|
|
2522
2551
|
ctx[1] ? "" : (
|
|
2523
2552
|
/*isResultCorrect*/
|
|
@@ -2542,26 +2571,44 @@
|
|
|
2542
2571
|
input,
|
|
2543
2572
|
"input",
|
|
2544
2573
|
/*input_input_handler*/
|
|
2545
|
-
ctx[
|
|
2574
|
+
ctx[17]
|
|
2546
2575
|
),
|
|
2547
2576
|
listen(
|
|
2548
2577
|
input,
|
|
2549
2578
|
"focusout",
|
|
2550
2579
|
/*focusout_handler*/
|
|
2551
|
-
ctx[
|
|
2580
|
+
ctx[18]
|
|
2552
2581
|
),
|
|
2553
2582
|
listen(
|
|
2554
2583
|
input,
|
|
2555
2584
|
"keydown",
|
|
2556
2585
|
/*keydown_handler*/
|
|
2557
|
-
ctx[
|
|
2586
|
+
ctx[19]
|
|
2558
2587
|
)
|
|
2559
2588
|
];
|
|
2560
2589
|
mounted = true;
|
|
2561
2590
|
}
|
|
2562
2591
|
},
|
|
2563
2592
|
p(ctx2, dirty) {
|
|
2564
|
-
if (dirty & /*
|
|
2593
|
+
if (dirty[0] & /*textAriaLabel*/
|
|
2594
|
+
128) {
|
|
2595
|
+
attr(
|
|
2596
|
+
input,
|
|
2597
|
+
"aria-label",
|
|
2598
|
+
/*textAriaLabel*/
|
|
2599
|
+
ctx2[7]
|
|
2600
|
+
);
|
|
2601
|
+
}
|
|
2602
|
+
if (dirty[0] & /*placeholder*/
|
|
2603
|
+
32) {
|
|
2604
|
+
attr(
|
|
2605
|
+
input,
|
|
2606
|
+
"placeholder",
|
|
2607
|
+
/*placeholder*/
|
|
2608
|
+
ctx2[5]
|
|
2609
|
+
);
|
|
2610
|
+
}
|
|
2611
|
+
if (dirty[0] & /*isFinished, isResultCorrect*/
|
|
2565
2612
|
6 && input_class_value !== (input_class_value = "typein-textbox " + (!/*isFinished*/
|
|
2566
2613
|
ctx2[1] ? "" : (
|
|
2567
2614
|
/*isResultCorrect*/
|
|
@@ -2569,17 +2616,17 @@
|
|
|
2569
2616
|
)))) {
|
|
2570
2617
|
attr(input, "class", input_class_value);
|
|
2571
2618
|
}
|
|
2572
|
-
if (dirty & /*isDataSaving*/
|
|
2619
|
+
if (dirty[0] & /*isDataSaving*/
|
|
2573
2620
|
1) {
|
|
2574
2621
|
input.disabled = /*isDataSaving*/
|
|
2575
2622
|
ctx2[0];
|
|
2576
2623
|
}
|
|
2577
|
-
if (dirty & /*isFinished*/
|
|
2624
|
+
if (dirty[0] & /*isFinished*/
|
|
2578
2625
|
2) {
|
|
2579
2626
|
input.readOnly = /*isFinished*/
|
|
2580
2627
|
ctx2[1];
|
|
2581
2628
|
}
|
|
2582
|
-
if (dirty & /*typeinAnswer*/
|
|
2629
|
+
if (dirty[0] & /*typeinAnswer*/
|
|
2583
2630
|
8 && input.value !== /*typeinAnswer*/
|
|
2584
2631
|
ctx2[3]) {
|
|
2585
2632
|
set_input_value(
|
|
@@ -2603,12 +2650,12 @@
|
|
|
2603
2650
|
function select_block_type(ctx2, dirty) {
|
|
2604
2651
|
if (
|
|
2605
2652
|
/*typeinType*/
|
|
2606
|
-
ctx2[
|
|
2653
|
+
ctx2[10] === TYPEIN_TYPE_SHORT
|
|
2607
2654
|
)
|
|
2608
2655
|
return create_if_block_22;
|
|
2609
2656
|
return create_else_block_1;
|
|
2610
2657
|
}
|
|
2611
|
-
let current_block_type = select_block_type(ctx, -1);
|
|
2658
|
+
let current_block_type = select_block_type(ctx, [-1, -1]);
|
|
2612
2659
|
let if_block = current_block_type(ctx);
|
|
2613
2660
|
return {
|
|
2614
2661
|
c() {
|
|
@@ -2638,10 +2685,6 @@
|
|
|
2638
2685
|
let span0_class_value;
|
|
2639
2686
|
let t0;
|
|
2640
2687
|
let span1;
|
|
2641
|
-
let t1_value = (
|
|
2642
|
-
/*isResultCorrect*/
|
|
2643
|
-
ctx[2] ? "Correct" : "Incorrect"
|
|
2644
|
-
);
|
|
2645
2688
|
let t1;
|
|
2646
2689
|
let div_class_value;
|
|
2647
2690
|
let t2;
|
|
@@ -2657,7 +2700,7 @@
|
|
|
2657
2700
|
return 0;
|
|
2658
2701
|
return 1;
|
|
2659
2702
|
}
|
|
2660
|
-
current_block_type_index = select_block_type_1(ctx, -1);
|
|
2703
|
+
current_block_type_index = select_block_type_1(ctx, [-1, -1]);
|
|
2661
2704
|
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
2662
2705
|
promptresult = new PromptResultFeedback_default({
|
|
2663
2706
|
props: {
|
|
@@ -2665,13 +2708,9 @@
|
|
|
2665
2708
|
/*isResultCorrect*/
|
|
2666
2709
|
ctx[2]
|
|
2667
2710
|
),
|
|
2668
|
-
resultFeedbackTitle: (
|
|
2669
|
-
/*resultFeedbackTitle*/
|
|
2670
|
-
ctx[4]
|
|
2671
|
-
),
|
|
2672
2711
|
resultFeedback: (
|
|
2673
2712
|
/*resultFeedback*/
|
|
2674
|
-
ctx[
|
|
2713
|
+
ctx[4]
|
|
2675
2714
|
)
|
|
2676
2715
|
}
|
|
2677
2716
|
});
|
|
@@ -2682,14 +2721,18 @@
|
|
|
2682
2721
|
if_block.c();
|
|
2683
2722
|
t0 = space();
|
|
2684
2723
|
span1 = element("span");
|
|
2685
|
-
t1 = text(
|
|
2724
|
+
t1 = text(
|
|
2725
|
+
/*resultLabel*/
|
|
2726
|
+
ctx[6]
|
|
2727
|
+
);
|
|
2686
2728
|
t2 = space();
|
|
2687
2729
|
create_component(promptresult.$$.fragment);
|
|
2688
2730
|
attr(span0, "class", span0_class_value = /*isResultCorrect*/
|
|
2689
2731
|
(ctx[2] ? "text-green-800" : "text-red-800") + " mr-2 p-0.5");
|
|
2690
2732
|
attr(span1, "class", "p2");
|
|
2733
|
+
attr(div, "aria-hidden", "true");
|
|
2691
2734
|
attr(div, "class", div_class_value = "flex items-center text-charcoal " + /*typeinType*/
|
|
2692
|
-
(ctx[
|
|
2735
|
+
(ctx[10] === TYPEIN_TYPE_SHORT ? "mt-2" : "mt-0.5"));
|
|
2693
2736
|
},
|
|
2694
2737
|
m(target, anchor) {
|
|
2695
2738
|
insert(target, div, anchor);
|
|
@@ -2720,28 +2763,27 @@
|
|
|
2720
2763
|
transition_in(if_block, 1);
|
|
2721
2764
|
if_block.m(span0, null);
|
|
2722
2765
|
}
|
|
2723
|
-
if (!current || dirty & /*isResultCorrect*/
|
|
2766
|
+
if (!current || dirty[0] & /*isResultCorrect*/
|
|
2724
2767
|
4 && span0_class_value !== (span0_class_value = /*isResultCorrect*/
|
|
2725
2768
|
(ctx2[2] ? "text-green-800" : "text-red-800") + " mr-2 p-0.5")) {
|
|
2726
2769
|
attr(span0, "class", span0_class_value);
|
|
2727
2770
|
}
|
|
2728
|
-
if (
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2771
|
+
if (!current || dirty[0] & /*resultLabel*/
|
|
2772
|
+
64)
|
|
2773
|
+
set_data(
|
|
2774
|
+
t1,
|
|
2775
|
+
/*resultLabel*/
|
|
2776
|
+
ctx2[6]
|
|
2777
|
+
);
|
|
2732
2778
|
const promptresult_changes = {};
|
|
2733
|
-
if (dirty & /*isResultCorrect*/
|
|
2779
|
+
if (dirty[0] & /*isResultCorrect*/
|
|
2734
2780
|
4)
|
|
2735
2781
|
promptresult_changes.isResultCorrect = /*isResultCorrect*/
|
|
2736
2782
|
ctx2[2];
|
|
2737
|
-
if (dirty & /*
|
|
2783
|
+
if (dirty[0] & /*resultFeedback*/
|
|
2738
2784
|
16)
|
|
2739
|
-
promptresult_changes.resultFeedbackTitle = /*resultFeedbackTitle*/
|
|
2740
|
-
ctx2[4];
|
|
2741
|
-
if (dirty & /*resultFeedback*/
|
|
2742
|
-
32)
|
|
2743
2785
|
promptresult_changes.resultFeedback = /*resultFeedback*/
|
|
2744
|
-
ctx2[
|
|
2786
|
+
ctx2[4];
|
|
2745
2787
|
promptresult.$set(promptresult_changes);
|
|
2746
2788
|
},
|
|
2747
2789
|
i(local) {
|
|
@@ -2829,11 +2871,11 @@
|
|
|
2829
2871
|
props: {
|
|
2830
2872
|
rubric: (
|
|
2831
2873
|
/*rubric*/
|
|
2832
|
-
ctx[
|
|
2874
|
+
ctx[8].text
|
|
2833
2875
|
),
|
|
2834
2876
|
prompt: (
|
|
2835
2877
|
/*prompt*/
|
|
2836
|
-
ctx[
|
|
2878
|
+
ctx[9]
|
|
2837
2879
|
),
|
|
2838
2880
|
$$slots: { default: [create_default_slot2] },
|
|
2839
2881
|
$$scope: { ctx }
|
|
@@ -2859,10 +2901,11 @@
|
|
|
2859
2901
|
insert(target, if_block_anchor, anchor);
|
|
2860
2902
|
current = true;
|
|
2861
2903
|
},
|
|
2862
|
-
p(ctx2,
|
|
2904
|
+
p(ctx2, dirty) {
|
|
2863
2905
|
const promptbody_changes = {};
|
|
2864
|
-
if (dirty &
|
|
2865
|
-
|
|
2906
|
+
if (dirty[0] & /*textAriaLabel, placeholder, isFinished, isResultCorrect, isDataSaving, typeinAnswer*/
|
|
2907
|
+
175 | dirty[1] & /*$$scope*/
|
|
2908
|
+
2) {
|
|
2866
2909
|
promptbody_changes.$$scope = { dirty, ctx: ctx2 };
|
|
2867
2910
|
}
|
|
2868
2911
|
promptbody.$set(promptbody_changes);
|
|
@@ -2872,7 +2915,7 @@
|
|
|
2872
2915
|
) {
|
|
2873
2916
|
if (if_block) {
|
|
2874
2917
|
if_block.p(ctx2, dirty);
|
|
2875
|
-
if (dirty & /*isFinished*/
|
|
2918
|
+
if (dirty[0] & /*isFinished*/
|
|
2876
2919
|
2) {
|
|
2877
2920
|
transition_in(if_block, 1);
|
|
2878
2921
|
}
|
|
@@ -2914,7 +2957,6 @@
|
|
|
2914
2957
|
};
|
|
2915
2958
|
}
|
|
2916
2959
|
var idLabel = "answerText";
|
|
2917
|
-
var placeholder = "Type your answer here";
|
|
2918
2960
|
function instance4($$self, $$props, $$invalidate) {
|
|
2919
2961
|
let { sessionData } = $$props;
|
|
2920
2962
|
let { isDataSaving } = $$props;
|
|
@@ -2924,23 +2966,26 @@
|
|
|
2924
2966
|
const dispatch = createEventDispatcher();
|
|
2925
2967
|
let typeinAnswer;
|
|
2926
2968
|
let latestAnswer = "";
|
|
2927
|
-
let resultFeedbackTitle = "";
|
|
2928
2969
|
let resultFeedback = "";
|
|
2970
|
+
let placeholder = "Type your answer here";
|
|
2929
2971
|
let focusOrigin = "tab";
|
|
2972
|
+
let resultLabel = "";
|
|
2930
2973
|
const { rubric, interaction, metadata, scoringMetadata } = sessionData;
|
|
2931
2974
|
const { prompt, typein_type: typeinType } = interaction;
|
|
2932
2975
|
if (metadata) {
|
|
2933
2976
|
const events = metadata.interactions.events.pop();
|
|
2934
2977
|
latestAnswer = typeinAnswer = events.answer[0];
|
|
2935
2978
|
}
|
|
2979
|
+
let textAriaLabel = !latestAnswer ? "Answer input: Please type your response" : "Your response is";
|
|
2936
2980
|
if (isFinished) {
|
|
2937
2981
|
const { answer, hasAnswer } = scoringMetadata;
|
|
2938
2982
|
typeinAnswer = answer && hasAnswer ? answer : typeinAnswer;
|
|
2983
|
+
resultLabel = isResultCorrect ? "Correct" : "Incorrect";
|
|
2984
|
+
textAriaLabel = `Submitted response is ${resultLabel.toLocaleLowerCase()}`;
|
|
2985
|
+
placeholder = isResultCorrect ? placeholder : "No answer provided";
|
|
2939
2986
|
if (!isPreviewMode) {
|
|
2940
2987
|
const { correct: correctFeeback, incorrect: incorrectFeedback } = interaction.feedback;
|
|
2941
|
-
|
|
2942
|
-
resultFeedbackTitle = header;
|
|
2943
|
-
resultFeedback = text2;
|
|
2988
|
+
resultFeedback = isResultCorrect ? correctFeeback : incorrectFeedback;
|
|
2944
2989
|
}
|
|
2945
2990
|
}
|
|
2946
2991
|
const saveAnswer = () => {
|
|
@@ -2983,7 +3028,7 @@
|
|
|
2983
3028
|
const keydown_handler_1 = (event) => saveOnEnter(event);
|
|
2984
3029
|
$$self.$$set = ($$props2) => {
|
|
2985
3030
|
if ("sessionData" in $$props2)
|
|
2986
|
-
$$invalidate(
|
|
3031
|
+
$$invalidate(15, sessionData = $$props2.sessionData);
|
|
2987
3032
|
if ("isDataSaving" in $$props2)
|
|
2988
3033
|
$$invalidate(0, isDataSaving = $$props2.isDataSaving);
|
|
2989
3034
|
if ("isFinished" in $$props2)
|
|
@@ -2991,15 +3036,17 @@
|
|
|
2991
3036
|
if ("isResultCorrect" in $$props2)
|
|
2992
3037
|
$$invalidate(2, isResultCorrect = $$props2.isResultCorrect);
|
|
2993
3038
|
if ("isPreviewMode" in $$props2)
|
|
2994
|
-
$$invalidate(
|
|
3039
|
+
$$invalidate(16, isPreviewMode = $$props2.isPreviewMode);
|
|
2995
3040
|
};
|
|
2996
3041
|
return [
|
|
2997
3042
|
isDataSaving,
|
|
2998
3043
|
isFinished,
|
|
2999
3044
|
isResultCorrect,
|
|
3000
3045
|
typeinAnswer,
|
|
3001
|
-
resultFeedbackTitle,
|
|
3002
3046
|
resultFeedback,
|
|
3047
|
+
placeholder,
|
|
3048
|
+
resultLabel,
|
|
3049
|
+
textAriaLabel,
|
|
3003
3050
|
rubric,
|
|
3004
3051
|
prompt,
|
|
3005
3052
|
typeinType,
|
|
@@ -3023,16 +3070,25 @@
|
|
|
3023
3070
|
var PromptTypeIn = class extends SvelteComponent {
|
|
3024
3071
|
constructor(options) {
|
|
3025
3072
|
super();
|
|
3026
|
-
init(
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3073
|
+
init(
|
|
3074
|
+
this,
|
|
3075
|
+
options,
|
|
3076
|
+
instance4,
|
|
3077
|
+
create_fragment6,
|
|
3078
|
+
safe_not_equal,
|
|
3079
|
+
{
|
|
3080
|
+
sessionData: 15,
|
|
3081
|
+
isDataSaving: 0,
|
|
3082
|
+
isFinished: 1,
|
|
3083
|
+
isResultCorrect: 2,
|
|
3084
|
+
isPreviewMode: 16
|
|
3085
|
+
},
|
|
3086
|
+
null,
|
|
3087
|
+
[-1, -1]
|
|
3088
|
+
);
|
|
3033
3089
|
}
|
|
3034
3090
|
get sessionData() {
|
|
3035
|
-
return this.$$.ctx[
|
|
3091
|
+
return this.$$.ctx[15];
|
|
3036
3092
|
}
|
|
3037
3093
|
set sessionData(sessionData) {
|
|
3038
3094
|
this.$$set({ sessionData });
|
|
@@ -3060,7 +3116,7 @@
|
|
|
3060
3116
|
flush();
|
|
3061
3117
|
}
|
|
3062
3118
|
get isPreviewMode() {
|
|
3063
|
-
return this.$$.ctx[
|
|
3119
|
+
return this.$$.ctx[16];
|
|
3064
3120
|
}
|
|
3065
3121
|
set isPreviewMode(isPreviewMode) {
|
|
3066
3122
|
this.$$set({ isPreviewMode });
|