qti3-item-player-vue3 0.2.12 → 0.2.13

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.
@@ -1607,12 +1607,12 @@ class re {
1607
1607
  throw new k("Improper value encoding. Found Array. Must be an Object.");
1608
1608
  if (t.base !== void 0) {
1609
1609
  if (i.cardinality === "single")
1610
- return this.baseValueFromPciJson(t.base, i.baseType);
1610
+ return this.baseValueFromPciJson(t.base, i.baseType, !0);
1611
1611
  throw new k("Inconsistent value cardinality [base] for this variable. Variable must be single cardinality.");
1612
1612
  }
1613
1613
  if (t.list !== void 0) {
1614
1614
  if (i.cardinality === "multiple" || i.cardinality === "ordered")
1615
- return this.baseValueFromPciJson(t.list, i.baseType);
1615
+ return this.baseValueFromPciJson(t.list, i.baseType, !1);
1616
1616
  throw new k("Inconsistent value cardinality [list] for this variable. Variable must be multiple or ordered cardinality.");
1617
1617
  }
1618
1618
  if (t.record !== void 0) {
@@ -1625,7 +1625,7 @@ class re {
1625
1625
  return console.log("[PciDecodingException][ValueFromJson] ", n), this.nullValue();
1626
1626
  }
1627
1627
  }
1628
- baseValueFromPciJson(t, i) {
1628
+ baseValueFromPciJson(t, i, s) {
1629
1629
  if (t === null) return this.nullValue();
1630
1630
  try {
1631
1631
  if (typeof t != "object")
@@ -1636,15 +1636,23 @@ class re {
1636
1636
  if (i === "point" || i === "directedPair" || i === "pair") {
1637
1637
  if (!Array.isArray(t[i]))
1638
1638
  throw new k(`Invalid value. For baseType "${i}", must be an Array`);
1639
- if (t[i].length !== 2)
1640
- throw new k(`Invalid value. For baseType "${i}", Array must have 2 elements`);
1641
- return `${t[i][0]} ${t[i][1]}`;
1639
+ if (s) {
1640
+ if (t[i].length !== 2)
1641
+ throw new k(`Invalid value. For baseType "${i}", Array must have 2 elements`);
1642
+ return `${t[i][0]} ${t[i][1]}`;
1643
+ }
1644
+ let n = [];
1645
+ return t[i].forEach((r) => {
1646
+ if (r.length !== 2)
1647
+ throw new k(`Invalid value. For baseType "${i}", Array must have 2 elements`);
1648
+ n.push(`${r[0]} ${r[1]}`);
1649
+ }), n;
1642
1650
  }
1643
1651
  return t[i];
1644
1652
  }
1645
1653
  throw new k(`Value does not have the required base-type. Expecting ${i}.`);
1646
- } catch ({ name: s, message: n }) {
1647
- return console.log("[PciDecodingException][BaseValueFromJson] ", n, t), this.nullValue();
1654
+ } catch ({ name: n, message: r }) {
1655
+ return console.log("[PciDecodingException][BaseValueFromJson] ", r, t), this.nullValue();
1648
1656
  }
1649
1657
  }
1650
1658
  recordValueFromPciJson(t, i) {
@@ -1660,7 +1668,7 @@ class re {
1660
1668
  for (let [r, a] of s)
1661
1669
  for (let o = 0; o < t.length; o++)
1662
1670
  if (t[o].name !== void 0 && t[o].base !== void 0 && t[o].name === r) {
1663
- const u = this.baseValueFromPciJson(t[o].base, a.getBaseType()), c = new vn(r, a.getBaseType(), u);
1671
+ const u = this.baseValueFromPciJson(t[o].base, a.getBaseType(), !0), c = new vn(r, a.getBaseType(), u);
1664
1672
  n.set(r, c);
1665
1673
  break;
1666
1674
  }
@@ -29840,17 +29848,17 @@ const ZO = /* @__PURE__ */ D(jO, [["render", XO]]), ch = new G(), JO = {
29840
29848
  this.isValidResponse = e;
29841
29849
  },
29842
29850
  disable() {
29843
- this.toggleDisablePoints(!0);
29851
+ this.toggleDisable(!0);
29844
29852
  },
29845
29853
  enable() {
29846
- this.toggleDisablePoints(!1);
29854
+ this.toggleDisable(!1);
29847
29855
  },
29848
29856
  /**
29849
29857
  * @description Utility method to disable/enable this interaction's points.
29850
29858
  * @param {Boolean} isDisabled
29851
29859
  */
29852
- toggleDisablePoints(e) {
29853
- this.isDisabled = e;
29860
+ toggleDisable(e) {
29861
+ this.isDisabled = e, e ? this.$refs.overlay.classList.add("disabled") : this.$refs.overlay.classList.remove("disabled");
29854
29862
  },
29855
29863
  /**
29856
29864
  * @description Get this interaction's invalid response message.
@@ -30069,7 +30077,7 @@ const ZO = /* @__PURE__ */ D(jO, [["render", XO]]), ch = new G(), JO = {
30069
30077
  return r.setAttribute("cx", t.x), r.setAttribute("cy", t.y), r.setAttribute("r", this.pointRadius), s === "default-light" ? (r.setAttribute("fill", "orange"), r.setAttribute("fill-opacity", ".5"), r.setAttribute("stroke", "orange")) : (r.setAttribute("fill", "#0088CC"), r.setAttribute("fill-opacity", ".5"), r.setAttribute("stroke", "blue")), r.setAttribute("opacity", "1"), r.setAttribute("stroke-width", "1"), r.setAttribute("data-marker-type", s), r.setAttribute("id", `${e}`), r.setAttribute("class", `qti3-player-select-point ${n ? "static" : ""}`), r.setAttribute("tabindex", "0"), r.setAttribute("data-point", `${i.x} ${i.y}`), r;
30070
30078
  },
30071
30079
  handleOverlayClick(e) {
30072
- e.preventDefault(), this.checkMaxChoicesLimit() || this.addPointFromClick(this.getMousePosition(e));
30080
+ e.preventDefault(), !this.isDisabled && (this.checkMaxChoicesLimit() || this.addPointFromClick(this.getMousePosition(e)));
30073
30081
  },
30074
30082
  /**
30075
30083
  * @description Handler for a click/touch on a point. This removes the point.