Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Interactive With JSPsych example submits a DataCollection its own schema rejects

Đang mở Phù hợp với người mới
#1,833 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
frontend, testing

Hướng nghiên cứu

Bắt đầu với apps/playground/src/instruments/examples/interactive/Interactive-With-JSPsych/index.ts và luồng gửi trong ScalarInstrumentRenderer; testing/src/specs/playground.spec.ts cho thấy cách gửi các ví dụ trong playground. Cập nhật ví dụ để gửi mảng trials và thêm ví dụ đó vào spec. Chạy spec của playground và xác nhận ví dụ này được gửi thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
119
Fork
19
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
39

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DouglasNeuroInformatics/OpenDataCapture

Tất cả issue của DouglasNeuroInformatics/OpenDataCapture

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.