Interactive With JSPsych example submits a DataCollection its own schema rejects
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
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
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
theas anycast and itsno-unsafe-argumentdisable. - 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
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DouglasNeuroInformatics/OpenDataCapture
-
Area: Infrastructure Chore Difficulty: Low Good First Issue Priority: Low
Difficulty 1/5 Under an hour Newbie friendliness 88/100
DouglasNeuroInformatics/OpenDataCapture#1836 ·
Maintainers usually reply within 1 day
-
Area: Infrastructure Chore Difficulty: Low Priority: Medium
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
DouglasNeuroInformatics/OpenDataCapture#1835 ·
Maintainers usually reply within 1 day
-
Area: Instruments Bug Difficulty: Low Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DouglasNeuroInformatics/OpenDataCapture#1824 · 1 comment ·
Maintainers usually reply within 1 day
-
Area: Shared Bug Difficulty: Low Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
DouglasNeuroInformatics/OpenDataCapture#1813 · 1 comment ·
Maintainers usually reply within 1 day
-
Area: Shared Bug Difficulty: Low Good First Issue Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DouglasNeuroInformatics/OpenDataCapture#1812 · 1 comment ·
Maintainers usually reply within 1 day
All issues in DouglasNeuroInformatics/OpenDataCapture
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
marmelab/react-admin#11431 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
db-ux-design-system/core-web#8655 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effectOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
epam/statgpt-admin-frontend#305 ·
Maintainers usually reply within 1 day