eat-js-sdk 2.0.29 → 2.0.30

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.
@@ -16815,6 +16815,9 @@ function createDropdownState(initialValue) {
16815
16815
  const isAllAnswered$1 = (selections) => {
16816
16816
  return selections.every((item) => item.choice !== "" && item.choice !== "Select Answer");
16817
16817
  };
16818
+ const isAllSkipped = (selections) => {
16819
+ return selections.every((item) => item.choice === "");
16820
+ };
16818
16821
  const calculateAnswerResults = (config, selections) => {
16819
16822
  return selections.map((item) => {
16820
16823
  const correctAnswers = config.correctAnswer[item.id] || [];
@@ -16864,7 +16867,7 @@ function calculateDropdownFeedback(state2, config, validateFn) {
16864
16867
  sessionAnswer: getSessionAnswersForDisplay(selections)
16865
16868
  };
16866
16869
  }
16867
- const isSkipped = config.mode === MODES.SESSION && config.isFinished && !allAnswered;
16870
+ const isSkipped = isAllSkipped(selections);
16868
16871
  let validationResult = {
16869
16872
  isValid: false,
16870
16873
  feedback: ""
@@ -16874,7 +16877,7 @@ function calculateDropdownFeedback(state2, config, validateFn) {
16874
16877
  answer: selections,
16875
16878
  timestamp: state2.lastModified
16876
16879
  });
16877
- } else if (isSkipped) {
16880
+ } else if (config.mode === MODES.SESSION && config.isFinished && !allAnswered) {
16878
16881
  validationResult = {
16879
16882
  isValid: false,
16880
16883
  score: 0,
@@ -17699,10 +17702,11 @@ function DropdownFeedback($$anchor, $$props) {
17699
17702
  push($$props, true);
17700
17703
  let feedbackState = prop($$props, "feedbackState", 7), config = prop($$props, "config", 7), interactionType = prop($$props, "interactionType", 7);
17701
17704
  const alertType = /* @__PURE__ */ user_derived(() => {
17702
- if (feedbackState().isSkipped) return "incorrect";
17705
+ if (feedbackState().isSkipped) return "skipped";
17703
17706
  if (feedbackState().isAllCorrect) return "correct";
17704
17707
  return "incorrect";
17705
17708
  });
17709
+ const shouldShowAlert = /* @__PURE__ */ user_derived(() => !(config().mode === MODES.SESSION && config().isFinished && (feedbackState().isAllCorrect || feedbackState().isSkipped)));
17706
17710
  var $$exports = {
17707
17711
  get feedbackState() {
17708
17712
  return feedbackState();
@@ -17745,7 +17749,7 @@ function DropdownFeedback($$anchor, $$props) {
17745
17749
  });
17746
17750
  };
17747
17751
  if_block(node_1, ($$render) => {
17748
- if (!(MODES.SESSION === config().mode && config().isFinished && feedbackState().isAllCorrect)) $$render(consequent);
17752
+ if (get$1(shouldShowAlert)) $$render(consequent);
17749
17753
  });
17750
17754
  }
17751
17755
  var node_2 = sibling(node_1, 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eat-js-sdk",
3
- "version": "2.0.29",
3
+ "version": "2.0.30",
4
4
  "change version": "2.0.0",
5
5
  "description": "Authoring tool frontend SDK",
6
6
  "contributors": [