Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Interactive With JSPsych example submits a DataCollection its own schema rejects

未关闭 适合新手
#1,833 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
react, typescript
领域
frontend, testing

调研方向

从 apps/playground/src/instruments/examples/interactive/Interactive-With-JSPsych/index.ts 和 ScalarInstrumentRenderer 中的提交流程入手;testing/src/specs/playground.spec.ts 展示了如何提交 playground 示例。更新示例,使其提交 trials 数组,并将其添加到 spec 中。运行 playground spec,并确认此示例提交成功。

由索引模型根据 Issue 内容生成。

描述

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.
主要语言
TypeScript
星标
119
派生
19
平均合并
4 天 1 小时
30 天内合并 PR
39

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DouglasNeuroInformatics/OpenDataCapture 的其他 Issue

查看 DouglasNeuroInformatics/OpenDataCapture 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。