@m2c2kit/assessment-color-shapes 0.8.6 → 0.8.8

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Game } from "@m2c2kit/core";
2
2
  declare class ColorShapes extends Game {
3
3
  constructor();
4
- init(): Promise<void>;
4
+ initialize(): Promise<void>;
5
5
  private makeShapes;
6
6
  }
7
7
  export { ColorShapes };
package/dist/index.js CHANGED
@@ -133,6 +133,11 @@ class ColorShapes extends Game {
133
133
  format: "date-time",
134
134
  description: "ISO 8601 timestamp at the beginning of the trial. Null if trial was skipped."
135
135
  },
136
+ trial_end_iso8601_timestamp: {
137
+ type: ["string", "null"],
138
+ format: "date-time",
139
+ description: "ISO 8601 timestamp at the end of the trial (when user presses 'Same' or 'Different'). Null if trial was skipped."
140
+ },
136
141
  trial_index: {
137
142
  type: ["integer", "null"],
138
143
  description: "Index of the trial within this assessment, 0-based."
@@ -238,7 +243,7 @@ class ColorShapes extends Game {
238
243
  const options = {
239
244
  name: "Color Shapes",
240
245
  id: "color-shapes",
241
- version: "0.8.6",
246
+ version: "0.8.8",
242
247
  shortDescription: "Color Shapes is a visual array change detection task, measuring intra-item feature binding, where participants determine if shapes change color across two sequential presentations of shape stimuli.",
243
248
  longDescription: `Color Shapes is a change detection paradigm used to measure visual short-term memory binding (Parra et al., 2009). Participants are asked to memorize the shapes and colors of three different polygons for 3 seconds. The three polygons are then removed from the screen and re-displayed at different locations, either having the same or different colors. Participants are then asked to decide whether the combination of colors and shapes are the "Same" or "Different" between the study and test phases.`,
244
249
  showFps: defaultParameters.show_fps.default,
@@ -283,9 +288,9 @@ class ColorShapes extends Game {
283
288
  };
284
289
  super(options);
285
290
  }
286
- init() {
291
+ initialize() {
287
292
  return __async(this, null, function* () {
288
- yield __superGet(ColorShapes.prototype, this, "init").call(this);
293
+ yield __superGet(ColorShapes.prototype, this, "initialize").call(this);
289
294
  const game = this;
290
295
  const SHAPE_SVG_HEIGHT = 96;
291
296
  const SQUARE_SIDE_LENGTH = 350;
@@ -572,6 +577,7 @@ class ColorShapes extends Game {
572
577
  for (let i = 0; i < trialConfiguration.presentShapes.length; i++) {
573
578
  const presentShape = trialConfiguration.presentShapes[i].shape;
574
579
  presentShape.fillColor = trialConfiguration.presentShapes[i].color;
580
+ presentShape.position = { x: 0, y: 0 };
575
581
  presentationGrid.addAtCell(
576
582
  presentShape,
577
583
  trialConfiguration.presentShapes[i].location.row,
@@ -624,6 +630,7 @@ class ColorShapes extends Game {
624
630
  for (let i = 0; i < trialConfiguration.responseShapes.length; i++) {
625
631
  const responseShape = trialConfiguration.responseShapes[i].shape;
626
632
  responseShape.fillColor = trialConfiguration.responseShapes[i].color;
633
+ responseShape.position = { x: 0, y: 0 };
627
634
  responseGrid.addAtCell(
628
635
  responseShape,
629
636
  trialConfiguration.responseShapes[i].location.row,
@@ -658,6 +665,10 @@ class ColorShapes extends Game {
658
665
  const rt = Timer.elapsed("rt");
659
666
  Timer.remove("rt");
660
667
  responseGrid.removeAllChildren();
668
+ game.addTrialData(
669
+ "trial_end_iso8601_timestamp",
670
+ (/* @__PURE__ */ new Date()).toISOString()
671
+ );
661
672
  const trialConfiguration = trialConfigurations[game.trialIndex];
662
673
  game.addTrialData("response_time_duration_ms", rt);
663
674
  game.addTrialData(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m2c2kit/assessment-color-shapes",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "scripts": {
5
5
  "build": "npm run clean && tsc && rollup -c",
6
6
  "clean": "rimraf build build-nobundler dist .rollup.cache tsconfig.tsbuildinfo"
@@ -22,12 +22,12 @@
22
22
  "@m2c2kit/core": "^0.3.6"
23
23
  },
24
24
  "devDependencies": {
25
- "@rollup/plugin-node-resolve": "15.0.2",
25
+ "@rollup/plugin-node-resolve": "15.1.0",
26
26
  "@rollup/plugin-replace": "5.0.2",
27
27
  "rimraf": "5.0.1",
28
28
  "rollup": "3.21.0",
29
29
  "rollup-plugin-copy": "3.4.0",
30
30
  "rollup-plugin-esbuild": "5.0.0",
31
- "typescript": "5.0.4"
31
+ "typescript": "5.1.3"
32
32
  }
33
33
  }