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