alexsys-exam-renderer 0.1.9 → 0.1.10

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.
@@ -1,9 +1,10 @@
1
1
  import type { CoinTableAnswerValue, TableColumn } from '../examSessionTypes';
2
2
  type CoinTableResponseProps = {
3
3
  columns: TableColumn[];
4
- value?: CoinTableAnswerValue;
5
4
  onChange: (value: CoinTableAnswerValue) => void;
5
+ showCountAnswer?: boolean;
6
+ value?: CoinTableAnswerValue;
6
7
  };
7
- export default function CoinTableResponse({ columns, value, onChange }: CoinTableResponseProps): import("react").JSX.Element;
8
+ export default function CoinTableResponse({ columns, value, onChange, showCountAnswer, }: CoinTableResponseProps): import("react").JSX.Element;
8
9
  export {};
9
10
  //# sourceMappingURL=CoinTableResponse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CoinTableResponse.d.ts","sourceRoot":"","sources":["../../../src/exam-session/interactions/CoinTableResponse.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE5E,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,KAAK,CAAC,EAAE,oBAAoB,CAAA;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CAChD,CAAA;AAKD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,sBAAsB,+BAsE7F"}
1
+ {"version":3,"file":"CoinTableResponse.d.ts","sourceRoot":"","sources":["../../../src/exam-session/interactions/CoinTableResponse.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE5E,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAC7B,CAAA;AAKD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,OAAO,EACP,KAAK,EACL,QAAQ,EACR,eAAsB,GACvB,EAAE,sBAAsB,+BAwExB"}
package/dist/index.js CHANGED
@@ -297,14 +297,14 @@ function Ge(e, t, n) {
297
297
  //#endregion
298
298
  //#region src/exam-session/interactions/CoinTableResponse.tsx
299
299
  var Ke = 0, qe = 12;
300
- function Je({ columns: e, value: t, onChange: n }) {
301
- let r = t?.counts ?? {};
302
- function i(e, t) {
303
- let i = e.maxCoins ?? qe, a = Math.max(Ke, Math.min(i, t));
300
+ function Je({ columns: e, value: t, onChange: n, showCountAnswer: r = !0 }) {
301
+ let i = t?.counts ?? {};
302
+ function a(e, t) {
303
+ let r = e.maxCoins ?? qe, a = Math.max(Ke, Math.min(r, t));
304
304
  n({
305
305
  kind: "coin-table",
306
306
  counts: {
307
- ...r,
307
+ ...i,
308
308
  [e.id]: a
309
309
  }
310
310
  });
@@ -312,7 +312,7 @@ function Je({ columns: e, value: t, onChange: n }) {
312
312
  return /* @__PURE__ */ s("div", {
313
313
  className: "response-table",
314
314
  children: e.map((e) => {
315
- let t = r[e.id] ?? 0, n = e.maxCoins ?? qe;
315
+ let t = i[e.id] ?? 0, n = e.maxCoins ?? qe;
316
316
  return /* @__PURE__ */ c("div", {
317
317
  className: "response-column",
318
318
  children: [
@@ -332,31 +332,31 @@ function Je({ columns: e, value: t, onChange: n }) {
332
332
  children: [/* @__PURE__ */ s("button", {
333
333
  className: "coin-action",
334
334
  disabled: t >= n,
335
- onClick: () => i(e, t + 1),
335
+ onClick: () => a(e, t + 1),
336
336
  type: "button",
337
337
  children: "إِضافَةٌ"
338
338
  }), /* @__PURE__ */ s("button", {
339
339
  className: "coin-action coin-action--secondary",
340
340
  disabled: t <= Ke,
341
- onClick: () => i(e, t - 1),
341
+ onClick: () => a(e, t - 1),
342
342
  type: "button",
343
343
  children: "حَذْفٌ"
344
344
  })]
345
345
  })]
346
346
  }),
347
- /* @__PURE__ */ c("label", {
347
+ r ? /* @__PURE__ */ c("label", {
348
348
  className: "coin-count-answer",
349
349
  children: [
350
350
  /* @__PURE__ */ s("span", { children: e.answerLabel }),
351
351
  /* @__PURE__ */ s("input", {
352
352
  "aria-label": e.answerLabel,
353
353
  inputMode: "numeric",
354
- onChange: (t) => i(e, Number(t.target.value) || 0),
354
+ onChange: (t) => a(e, Number(t.target.value) || 0),
355
355
  value: t
356
356
  }),
357
357
  /* @__PURE__ */ s("span", { children: "دَراهِمُ" })
358
358
  ]
359
- })
359
+ }) : null
360
360
  ]
361
361
  }, e.id);
362
362
  })
@@ -3750,6 +3750,7 @@ function Rr({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, pa
3750
3750
  }), i.type === "coin-table" ? /* @__PURE__ */ s(Je, {
3751
3751
  columns: i.columns,
3752
3752
  onChange: (e) => o(l, e),
3753
+ showCountAnswer: !1,
3753
3754
  value: Er(n(l))
3754
3755
  }) : i.type === "table" ? /* @__PURE__ */ s("div", {
3755
3756
  className: "word-problem-table",
@@ -4704,14 +4705,7 @@ function yi({ part: e, partNumber: t }) {
4704
4705
  className: "printable-table-response printable-word-problem__table",
4705
4706
  children: e.columns.map((e) => /* @__PURE__ */ c("div", {
4706
4707
  className: "printable-table-column",
4707
- children: [
4708
- /* @__PURE__ */ s("strong", { children: e.title }),
4709
- /* @__PURE__ */ s("div", { className: "printable-table-area" }),
4710
- /* @__PURE__ */ c("div", {
4711
- className: "printable-inline-answer",
4712
- children: [/* @__PURE__ */ s("span", { children: e.answerLabel }), /* @__PURE__ */ s(Ci, {})]
4713
- })
4714
- ]
4708
+ children: [/* @__PURE__ */ s("strong", { children: e.title }), /* @__PURE__ */ s("div", { className: "printable-table-area" })]
4715
4709
  }, e.id))
4716
4710
  }) : e.type === "table" ? /* @__PURE__ */ s("div", {
4717
4711
  className: "printable-word-problem-table",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alexsys-exam-renderer",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "React UI library for rendering digital exam interfaces.",
5
5
  "type": "module",
6
6
  "license": "MIT",