alexsys-exam-renderer 0.1.22 → 0.1.23

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -353,31 +353,31 @@ function pt(e, t) {
353
353
  let n = me(e), r = he(e), i = e.questions.filter(ge).map((e) => ({
354
354
  maxScore: n ? pe(e) : 0,
355
355
  units: mt(e, t)
356
- })), a = !n && Ut(i, (e) => e.units.length) > 0 ? r / Ut(i, (e) => e.units.length) : 0, o = i.flatMap((t) => {
357
- let r = n ? t.units.length > 0 ? t.maxScore / t.units.length : 0 : a;
358
- return t.units.map((t) => {
359
- let n = Wt(t.maxScore ?? r);
356
+ })), a = Ut(i, (e) => e.units.length), o = n ? [] : bt(r, a), s = 0, c = i.flatMap((t) => {
357
+ let r = n ? bt(t.maxScore, t.units.length) : [];
358
+ return t.units.map((t, i) => {
359
+ let a = Wt(t.maxScore ?? (n ? r[i] ?? 0 : o[s++] ?? 0));
360
360
  return {
361
361
  ...t,
362
- maxScore: n,
363
- score: t.status === "correct" ? n : 0,
362
+ maxScore: a,
363
+ score: t.status === "correct" ? a : 0,
364
364
  sectionId: e.id
365
365
  };
366
366
  });
367
- }), s = Ht(o, "correct"), c = Ht(o, "incorrect"), l = Ht(o, "unanswered"), u = c + l;
367
+ }), l = Ht(c, "correct"), u = Ht(c, "incorrect"), d = Ht(c, "unanswered"), f = u + d;
368
368
  return {
369
369
  badge: e.badge,
370
- correctCount: s,
370
+ correctCount: l,
371
371
  id: e.id,
372
- incorrectCount: c,
372
+ incorrectCount: u,
373
373
  maxScore: r,
374
- notCorrectCount: u,
375
- score: Wt(Ut(o, (e) => e.score)),
374
+ notCorrectCount: f,
375
+ score: Wt(Ut(c, (e) => e.score)),
376
376
  title: e.title,
377
377
  tone: e.tone,
378
- totalUnits: o.length,
379
- unansweredCount: l,
380
- units: o
378
+ totalUnits: c.length,
379
+ unansweredCount: d,
380
+ units: c
381
381
  };
382
382
  }
383
383
  function mt(e, t) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alexsys-exam-renderer",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "React UI library for rendering digital exam interfaces.",
5
5
  "type": "module",
6
6
  "license": "MIT",