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.
@@ -2928,8 +2928,7 @@ class InteractionTracker {
2928
2928
  }
2929
2929
  const sectorTangramMap = this.controller.state.cfg.sectors.map((s) => ({
2930
2930
  sectorId: s.id,
2931
- tangramId: s.id
2932
- // In our system, sector ID == tangram ID
2931
+ tangramId: s.tangramId
2933
2932
  }));
2934
2933
  const blueprintOrder = {
2935
2934
  primitives: this.controller.state.primitives.map((bp) => bp.id),
@@ -3434,10 +3433,10 @@ function constructFromSpec(sideLens, angles, firstEdgeUnits) {
3434
3433
  return pts;
3435
3434
  }
3436
3435
  const FIRST_EDGES_UNITS = {
3437
- "small-triangle": [P(0, 0), P(0.5, 0.5)],
3436
+ "smalltriangle": [P(0, 0), P(0.5, 0.5)],
3438
3437
  "parallelogram": [P(0, 0), P(0.5, 0)],
3439
- "large-triangle": [P(0, 0), P(0.5, -0.5)],
3440
- "med-triangle": [P(0, 0), P(0.5, 0)],
3438
+ "largetriangle": [P(0, 0), P(0.5, -0.5)],
3439
+ "medtriangle": [P(0, 0), P(0.5, 0)],
3441
3440
  "square": [P(0, 0), P(0.5, 0)]
3442
3441
  };
3443
3442
  const PRIMITIVE_BLUEPRINTS_CACHE = (() => {
@@ -3450,8 +3449,8 @@ const PRIMITIVE_BLUEPRINTS_CACHE = (() => {
3450
3449
  color: "#f43f5e"
3451
3450
  },
3452
3451
  {
3453
- id: "prim:small",
3454
- kind: "small-triangle",
3452
+ id: "prim:smalltriangle",
3453
+ kind: "smalltriangle",
3455
3454
  sideLens: [HALFDIAGONAL, HALFDIAGONAL, HALFUNIT, HALFUNIT, HALFUNIT, HALFUNIT],
3456
3455
  angles: [180, 45, 180, 90, 180, 45],
3457
3456
  color: "#f59e0b"
@@ -3464,15 +3463,15 @@ const PRIMITIVE_BLUEPRINTS_CACHE = (() => {
3464
3463
  color: "#10b981"
3465
3464
  },
3466
3465
  {
3467
- id: "prim:med",
3468
- kind: "med-triangle",
3466
+ id: "prim:medtriangle",
3467
+ kind: "medtriangle",
3469
3468
  sideLens: [HALFUNIT, HALFUNIT, HALFUNIT, HALFUNIT, HALFDIAGONAL, HALFDIAGONAL, HALFDIAGONAL, HALFDIAGONAL],
3470
3469
  angles: [180, 180, 180, 45, 180, 90, 180, 45],
3471
3470
  color: "#3b82f6"
3472
3471
  },
3473
3472
  {
3474
- id: "prim:large",
3475
- kind: "large-triangle",
3473
+ id: "prim:largetriangle",
3474
+ kind: "largetriangle",
3476
3475
  sideLens: [
3477
3476
  HALFDIAGONAL,
3478
3477
  HALFDIAGONAL,
@@ -3555,6 +3554,8 @@ function startPrepTrial(display_element, params, jsPsych) {
3555
3554
  } = params;
3556
3555
  const prepSectors = Array.from({ length: numQuickstashSlots }, (_, i) => ({
3557
3556
  id: `prep-sector-${i}`,
3557
+ tangramId: `prep-sector-${i}`,
3558
+ // dummy value since prep mode doesn't have tangrams
3558
3559
  silhouette: {
3559
3560
  id: `prep-silhouette-${i}`,
3560
3561
  mask: []