Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildTrials functions versus Trial objects #138

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/further_reading/jspsych_basics.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: jspsych
slug: /jspsych
title: JSPsych
description: "Understanding concepts in JSPsych"
---

## Assembling Trials: Functions vs. Objects

When working with Honeycomb to create experiments, users often have questions regarding the distinction between trials exported directly as Trial objects and those encapsulated within functions that output Trial objects.

In the `honeycombTrials.js` file, you'll find that some trials are exported as objects while others are enclosed within functions. During experiment execution, certain downstream trials may require access to data collected in previous trials.

Trials relying on the global `jsPsych` object to store timeline data or retrieve aggregated results from prior trials need to dynamically ingest this information during the experiment. Consequently, the `buildTrial` functions serve the purpose of assembling trials with data from the jsPsych object collected during the experiment.

For further information about the `jsPsych` global object, refer to the [jsPsych documentation](https://www.jspsych.org/7.3/reference/jspsych/).