jspsych-tangram 0.0.3 → 0.0.4

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.
@@ -19637,8 +19637,7 @@ var TangramConstructPlugin = (function (jspsych) {
19637
19637
  }
19638
19638
  const sectorTangramMap = this.controller.state.cfg.sectors.map((s) => ({
19639
19639
  sectorId: s.id,
19640
- tangramId: s.id
19641
- // In our system, sector ID == tangram ID
19640
+ tangramId: s.tangramId
19642
19641
  }));
19643
19642
  const blueprintOrder = {
19644
19643
  primitives: this.controller.state.primitives.map((bp) => bp.id),
@@ -20143,10 +20142,10 @@ var TangramConstructPlugin = (function (jspsych) {
20143
20142
  return pts;
20144
20143
  }
20145
20144
  const FIRST_EDGES_UNITS = {
20146
- "small-triangle": [P(0, 0), P(0.5, 0.5)],
20145
+ "smalltriangle": [P(0, 0), P(0.5, 0.5)],
20147
20146
  "parallelogram": [P(0, 0), P(0.5, 0)],
20148
- "large-triangle": [P(0, 0), P(0.5, -0.5)],
20149
- "med-triangle": [P(0, 0), P(0.5, 0)],
20147
+ "largetriangle": [P(0, 0), P(0.5, -0.5)],
20148
+ "medtriangle": [P(0, 0), P(0.5, 0)],
20150
20149
  "square": [P(0, 0), P(0.5, 0)]
20151
20150
  };
20152
20151
  const PRIMITIVE_BLUEPRINTS_CACHE = (() => {
@@ -20159,8 +20158,8 @@ var TangramConstructPlugin = (function (jspsych) {
20159
20158
  color: "#f43f5e"
20160
20159
  },
20161
20160
  {
20162
- id: "prim:small",
20163
- kind: "small-triangle",
20161
+ id: "prim:smalltriangle",
20162
+ kind: "smalltriangle",
20164
20163
  sideLens: [HALFDIAGONAL, HALFDIAGONAL, HALFUNIT, HALFUNIT, HALFUNIT, HALFUNIT],
20165
20164
  angles: [180, 45, 180, 90, 180, 45],
20166
20165
  color: "#f59e0b"
@@ -20173,15 +20172,15 @@ var TangramConstructPlugin = (function (jspsych) {
20173
20172
  color: "#10b981"
20174
20173
  },
20175
20174
  {
20176
- id: "prim:med",
20177
- kind: "med-triangle",
20175
+ id: "prim:medtriangle",
20176
+ kind: "medtriangle",
20178
20177
  sideLens: [HALFUNIT, HALFUNIT, HALFUNIT, HALFUNIT, HALFDIAGONAL, HALFDIAGONAL, HALFDIAGONAL, HALFDIAGONAL],
20179
20178
  angles: [180, 180, 180, 45, 180, 90, 180, 45],
20180
20179
  color: "#3b82f6"
20181
20180
  },
20182
20181
  {
20183
- id: "prim:large",
20184
- kind: "large-triangle",
20182
+ id: "prim:largetriangle",
20183
+ kind: "largetriangle",
20185
20184
  sideLens: [
20186
20185
  HALFDIAGONAL,
20187
20186
  HALFDIAGONAL,
@@ -20253,12 +20252,11 @@ var TangramConstructPlugin = (function (jspsych) {
20253
20252
  function startConstructionTrial(display_element, params, _jsPsych) {
20254
20253
  const CANON = /* @__PURE__ */ new Set([
20255
20254
  "square",
20256
- "small-triangle",
20255
+ "smalltriangle",
20257
20256
  "parallelogram",
20258
- "med-triangle",
20259
- "large-triangle"
20257
+ "medtriangle",
20258
+ "largetriangle"
20260
20259
  ]);
20261
- const SECTOR_IDS = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"];
20262
20260
  console.log("[ConstructionApp] Starting tangram conversion...");
20263
20261
  console.log("[ConstructionApp] Received tangrams:", params.tangrams);
20264
20262
  console.log("[ConstructionApp] Number of tangrams:", params.tangrams.length);
@@ -20283,11 +20281,12 @@ var TangramConstructPlugin = (function (jspsych) {
20283
20281
  console.log(`[ConstructionApp] First vertex: [${tan.vertices[0]?.[0]}, ${tan.vertices[0]?.[1]}] -> {x: ${polygon[0]?.x}, y: ${polygon[0]?.y}}`);
20284
20282
  return polygon;
20285
20283
  });
20286
- const sectorId = SECTOR_IDS[index] ?? `S${index}`;
20284
+ const sectorId = `sector${index}`;
20287
20285
  console.log(`[ConstructionApp] Assigned sector ID: ${sectorId}`);
20288
20286
  console.log(`[ConstructionApp] Final mask has ${mask.length} polygons`);
20289
20287
  const sector = {
20290
20288
  id: sectorId,
20289
+ tangramId: tangramSpec.tangramID,
20291
20290
  silhouette: {
20292
20291
  id: sectorId,
20293
20292
  mask