Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Interactive With JSPsych example submits a DataCollection its own schema rejects

Open Beginner friendly
#1,833 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
frontend, testing

Research direction

Start with apps/playground/src/instruments/examples/interactive/Interactive-With-JSPsych/index.ts and the submission flow in ScalarInstrumentRenderer; testing/src/specs/playground.spec.ts shows how the playground examples are submitted. Update the example to submit the trials array and add it to the spec. Run the playground spec and confirm this example submits successfully.

Written by the indexing model from the issue text.

Description

Area: Playground Bug Difficulty: Low Good First Issue Priority: Medium

The playground's Interactive With JSPsych example
(apps/playground/src/instruments/examples/interactive/Interactive-With-JSPsych/index.ts) ends its
timeline with:

on_finish: () => {
  done(jsPsych.data.get() as any);
};

jsPsych.data.get() returns jsPsych 8's DataCollection, a class holding its trials in a trials
field, with no toJSON. ScalarInstrumentRenderer serializes what an instrument submits with
JSON.parse(JSON.stringify(data, replacer)), so validateSubmission receives { "trials": [...] }.
The example's validationSchema is z.array(...), so the submission should always fail validation.

This comes from reading the code; it has not been reproduced in the playground.
testing/src/specs/playground.spec.ts submits the Static Assets and Legacy Script examples, but not
this one.

Suggested fix

  • Call done(jsPsych.data.get().values()). values() returns the trials array, which also removes
    the as any cast and its no-unsafe-argument disable.
  • Add the example to the interactive examples the playground spec submits.
Dominant language
TypeScript
Stars
119
Forks
19
Avg merge
4d 11h
Merged PRs (30d)
35

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DouglasNeuroInformatics/OpenDataCapture

All issues in DouglasNeuroInformatics/OpenDataCapture

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.