Skip to content

Data structure 244#248

Merged
gureckis merged 3 commits into
mainfrom
data_structure_244
Dec 12, 2025
Merged

Data structure 244#248
gureckis merged 3 commits into
mainfrom
data_structure_244

Conversation

@gureckis

Copy link
Copy Markdown
Member

No description provided.

Introduces a new data recording API that organizes experiment data by route/page name and visit number, making it easier to track which data came from which part of an experiment and which visit.

New features:
  - recordPageData(data, routeName?) - records to pageData_<routeName>
    with visit_N sub-objects for multi-visit tracking
  - computeCompletionCode() - moved from ThanksView to useAPI for reuse
  - getAllPageData getter in smilestore

  Data structure per route:
      pageData_<routeName>: {
        visit_0: {
          timestamps: [ts1, ts2],  // parallel arrays
          data: [data1, data2]
        },
        visit_1: {
          timestamps: [ts3],
          data: [data3]
        }
      }

Each visit to a route creates a new visit_N object, keeping data from different visits cleanly separated.

Deprecations (still functional with warnings):
 - recordForm() - use recordPageData() instead
 - recordData() - use recordPageData() instead

BREAKING CHANGE: Completion code hash now uses pageData_* fields (falls back to studyData for backward compatibility)

- Includes docs and tests
@gureckis
gureckis merged commit ead0f44 into main Dec 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant