@bojackduy/opencode-learn 1.2.1 → 1.2.3

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/tui.js CHANGED
@@ -453,14 +453,14 @@ function QuizDialog(props) {
453
453
  });
454
454
  }
455
455
  setSelected(m);
456
- const correct2 = computeCorrect(eff);
456
+ const correct = computeCorrect(eff);
457
457
  setFeedback({
458
- correct: correct2,
458
+ correct,
459
459
  selectedIndices: eff
460
460
  });
461
461
  if (reason)
462
462
  setNote((prev) => prev ? `${prev} \u2014 ${reason}` : prev);
463
- tlog("QuizDialog classify done", eff.join(","), correct2, reason || "");
463
+ tlog("QuizDialog classify done", eff.join(","), correct, reason || "");
464
464
  } else if (inferredValues && inferredValues.length) {
465
465
  const byVal = new Map(options().map((o, i) => [o.value, i + 1]));
466
466
  let idxs = inferredValues.map((v) => byVal.get(v)).filter(Boolean);
@@ -480,15 +480,15 @@ function QuizDialog(props) {
480
480
  });
481
481
  }
482
482
  setSelected(m);
483
- const correct2 = computeCorrect(idxs);
483
+ const correct = computeCorrect(idxs);
484
484
  setFeedback({
485
- correct: correct2,
485
+ correct,
486
486
  selectedIndices: idxs
487
487
  });
488
488
  } else {
489
- const correct2 = typeof semanticCorrect === "boolean" ? semanticCorrect : false;
489
+ const correct = typeof semanticCorrect === "boolean" ? semanticCorrect : false;
490
490
  setFeedback({
491
- correct: correct2,
491
+ correct,
492
492
  selectedIndices: []
493
493
  });
494
494
  if (reason)
@@ -1722,13 +1722,13 @@ function QuizBatchDialog(props) {
1722
1722
  if (eff.length !== inferred.length)
1723
1723
  tlog("QuizBatchDialog classify enforce single", inferred.join(","), "->", eff.join(","));
1724
1724
  const mm = new Map;
1725
- for (const idx2 of eff) {
1726
- const opt = cur().options[idx2 - 1];
1725
+ for (const idx of eff) {
1726
+ const opt = cur().options[idx - 1];
1727
1727
  if (opt)
1728
- mm.set(`opt:${idx2 - 1}`, {
1728
+ mm.set(`opt:${idx - 1}`, {
1729
1729
  label: opt.label,
1730
1730
  value: opt.value,
1731
- index: idx2
1731
+ index: idx
1732
1732
  });
1733
1733
  }
1734
1734
  setSelected(mm);
@@ -2667,12 +2667,12 @@ var tui = async (api) => {
2667
2667
  data.sessionID = curSid;
2668
2668
  try {
2669
2669
  const cur = api.route?.current;
2670
- const curSid2 = cur?.params?.sessionID || cur?.sessionID;
2671
- if (curSid2 && data.sessionID && data.sessionID !== curSid2) {
2670
+ const curSid = cur?.params?.sessionID || cur?.sessionID;
2671
+ if (curSid && data.sessionID && data.sessionID !== curSid) {
2672
2672
  const anyState = api.state;
2673
2673
  const exists = anyState.session?.get ? anyState.session.get(data.sessionID) : undefined;
2674
2674
  if (!exists)
2675
- data.sessionID = curSid2;
2675
+ data.sessionID = curSid;
2676
2676
  }
2677
2677
  } catch {}
2678
2678
  current = {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@bojackduy/opencode-learn",
4
- "version": "1.2.1",
5
- "description": "Pi learn system for OpenCode \u2014 Socratic teaching, graded quiz, Obsidian md_log, and visual makers. Port of amosblomqvist/learn (video: How I Use AI to Learn Things) to OpenCode.",
4
+ "version": "1.2.3",
5
+ "description": "Pi learn system for OpenCode Socratic teaching, graded quiz, Obsidian md_log, and visual makers. Port of amosblomqvist/learn (video: How I Use AI to Learn Things) to OpenCode.",
6
6
  "type": "module",
7
7
  "license": "AGPL-3.0-or-later",
8
8
  "private": false,