Stop signal timeline#100
Conversation
🦋 Changeset detectedLatest commit: 32e7cd9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
jadeddelta
left a comment
There was a problem hiding this comment.
thanks again for the contribution, and this looks great! here's some feedback and once you're finished we'll take another look.
| multiple_responses: false, | ||
| button_html: button_design, | ||
| choices: buttons, | ||
| data: { |
There was a problem hiding this comment.
i think it would also be a good idea to include a human-readable "direction" or "stimulus-type" field, with values for left, right, left-x, right-x, so that at a glace it's easier to parse rather than the object URL
| return html | ||
| } | ||
|
|
||
| export function createTimeline(jsPsych:JsPsych, { |
There was a problem hiding this comment.
if you're trying to get this out right now, it's not necessary to do this suggestion. but in the future it's a good idea to parameterize the SVGs for the fixation, left, right, left stop, and right stop, in case a developer wants to use their own custom SVGs.
| return URL.createObjectURL(blob) | ||
| } | ||
|
|
||
| const plus = get_svg_url('<svg version="1.1" viewBox="0.0 0.0 480.0 480.0" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><clipPath id="p.0"><path d="m0 0l480.0 0l0 480.0l-480.0 0l0 -480.0z" clip-rule="nonzero"/></clipPath><g clip-path="url(#p.0)"><path fill="#ffffff" d="m0 0l480.0 0l0 480.0l-480.0 0z" fill-rule="evenodd"/><path fill="#000000" fill-opacity="0.0" d="m17.023623 240.0l0 0c0 -120.72858 99.829926 -218.59842 222.97638 -218.59842l0 0c59.137024 0 115.85193 23.03084 157.66812 64.026c41.816162 40.995155 65.30826 96.59652 65.30826 154.57242l0 0c0 120.72858 -99.829926 218.59842 -222.97638 218.59842l0 0c-123.146454 0 -222.97638 -97.86984 -222.97638 -218.59842z" fill-rule="evenodd"/><path stroke="#000000" stroke-width="16.0" stroke-linejoin="round" stroke-linecap="butt" d="m17.023623 240.0l0 0c0 -120.72858 99.829926 -218.59842 222.97638 -218.59842l0 0c59.137024 0 115.85193 23.03084 157.66812 64.026c41.816162 40.995155 65.30826 96.59652 65.30826 154.57242l0 0c0 120.72858 -99.829926 218.59842 -222.97638 218.59842l0 0c-123.146454 0 -222.97638 -97.86984 -222.97638 -218.59842z" fill-rule="evenodd"/><path fill="#000000" d="m175.8033 220.30988l44.506577 0l0 -41.83316l39.38025 0l0 41.83316l44.50656 0l0 39.38025l-44.50656 0l0 41.83316l-39.38025 0l0 -41.83316l-44.506577 0z" fill-rule="evenodd"/></g></svg>') |
There was a problem hiding this comment.
also not necessary now, but might be good to export these in the utils object to give developers access to these svgs (probably just the strings, rather than the get_svg_url?)
| } | ||
|
|
||
| /* defines a test */ | ||
| var test = { |
There was a problem hiding this comment.
it would be a good idea to turn the test variable into a function that is called here, a getTestTrial(params) function that you can then export into timelineUnits that developers can have access to
|
|
||
| /* displays a + between trials */ | ||
| var fixation = { | ||
| type: jsPsychImageButtonResponse, |
There was a problem hiding this comment.
similarly for the test variable, it would be good to turn this into a function for timelineUnits export
| | stop_percent | number | 0.25 | The percent of the trials that will have stop signals. | | ||
|
|
||
|
|
||
| ### timelineUnits |
There was a problem hiding this comment.
when you've added timelineUnits and utils, be sure to document them here
| frame_delay: function() { | ||
| if (delay_adaptive) { | ||
| var data = jsPsych.data.get().filter({task: "response"}).last(1).values()[0]; | ||
| console.log(data) |
There was a problem hiding this comment.
remove the console.log when you're finished
| var new_delay = current_delay - delay_change | ||
|
|
||
| if (new_delay > min_delay) | ||
| { |
There was a problem hiding this comment.
for whatever reason the auto-styling on commits doesn't work, after you've done your work feel free to run npx pretty-quick before you commit to standardize your code's style
Hi! I created a timeline for the stop-signal cognitive test. You should be able to test it by running the index file in the examples folder. Let me know if there are any changes I need to make. Thanks!