Timeline tutorial#2
Conversation
…ection of the tutorial. I also added a "complete code" details admonition to the timeline unit section and renamed a couple of variables to more closely resemble the original rt task. Also changed text accordingly to match the regular functions, since I will not be using arrow functions for timelineUnits
…e timelineunits part describing how to call units from html post-build. Also made minor edits for readability and added admonitions to flag problem areas, like bugs
…eUnits section for factoring createTimeline code out to units, example "code so far" detail nodes for both sections (which make it easier to check that code works between sections), and minor corrections like missing arguments. I also made minor edits to the designing and executing parameters section to introduce the options object
… for fallback definitions and parameter object typing; the util section has also been meaningfully rewritten, though it needs further edits to accomodate the placement of the options typing explanation
…until then; still some self-referential admonitions earlier in the tutorial signposting details worth possibly presenting to the reader; the testing and documentation sections still need writing, though the pull request section will be relegated to a separate page scoped out by Josh
jodeleeuw
left a comment
There was a problem hiding this comment.
@vminojosa I made this a PR so that we could use the github review tools.
I think this is a really good structure for the tutorial. I have a few specific comments you'll see in the thread.
The only big picture comment I have is about the utils example. I'm not convinced that pulling out the fixation duration helps motivate why someone would want to export a util. Maybe instead we could output a function to calculate some kind of specific score on performance in the task? I realize that deviates a bit from the rt demo tutorial, but I think explaining that utils (and timelineUnits) are optional exports and there may genuinely be cases where no utils are exported is a way around this.
wdyt?
|
|
||
| ## Overview exports from index.ts | ||
|
|
||
| `index.js` exports three principle kinds of components, all of which are functions. |
There was a problem hiding this comment.
createTimeline() is a function, but timelineUnits and utils are objects that might contain functions.
| }; | ||
| timeline.push(debrief_block); | ||
|
|
||
| return timeline |
There was a problem hiding this comment.
One minor adjustment: createTimeline() should return an object like this:
return { timeline: timeline }This allows a researcher to insert it into an experiment timeline. I'll comment on that below.
| jsPsych.data.displayData(); | ||
| }}); | ||
|
|
||
| const timeline = jsPsychTimelineReactionTimeDemo.createTimeline(jsPsych); |
There was a problem hiding this comment.
Here's where the object return matters.
const rt_demo_timeline = jsPsychTimelineReactionTimeDemo.createTimeline(jsPsych);
const experiment_timeline = []
// this step would not work if the createTimeline function returns an array
experiment_timeline.push(rt_demo_timeline)
jsPsych.run(experiment_timeline)| ``` | ||
| </details> | ||
|
|
||
| ## Setting up a timelineUnit |
There was a problem hiding this comment.
Might be helpful to explain that the timelineUnits exist so that bits an pieces of an overall timeline can be reused. Like if someone wanted to use the choice rt part of this timeline, but didn't want to use the same introduction.
| </script> | ||
| ``` | ||
|
|
||
| With our `timelineUnits` bracketed out and exported, anyone could isolate, rearrange, or reconfigure any one of the pieces of our original experiment. The next section will expand on that last point and go into parametrizing units for configurability. |
There was a problem hiding this comment.
Here's the motivation. Probably need this earlier (and again here is fine too!)
|
Just leaving a general comment to your general comment, then addressing the rest one-to-one: I definitely agree about the fixation thing as not very persuasive; was just looking for the lowest conceptual lift to get the first draft to a page, so really glad to receive alternatives honestly. Nor do I mind deviating from the rt task tutorial at all; I was actually hoping on a second pass to also add demos on some more robust / complicated features (like a buildTimelineVariables thing) I may need a bit more clarification on the performance function though. I understand the debrief trial already has some of the basic performance evaluation written in, so I'm wondering what additional thing you're looking for by that description. |
No description provided.