Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Interactive With JSPsych example submits a DataCollection its own schema rejects

Aperta Adatta ai principianti
#1,833 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend, testing

Direzione di ricerca

Inizia da apps/playground/src/instruments/examples/interactive/Interactive-With-JSPsych/index.ts e dal flusso di invio in ScalarInstrumentRenderer; testing/src/specs/playground.spec.ts mostra come vengono inviati gli esempi del playground. Aggiorna l’esempio in modo che invii l’array trials e aggiungilo alla spec. Esegui la spec del playground e conferma che questo esempio venga inviato correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
119
Fork
19
Merge medio
4g 11h
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DouglasNeuroInformatics/OpenDataCapture

Tutte le issue di DouglasNeuroInformatics/OpenDataCapture

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.