@@ -37,13 +37,13 @@ const DEFAULT_STIMULUS_INFO_OBJECT: IStimulusInfo = {
37
37
/**
38
38
* Generates the stimulus HTML for a given trial.
39
39
*
40
- * @param targetSide The side of the target stimulus [same|opposite].
41
- * @param stimulusSide The side of the stimulus to be displayed [left|right].
42
- * @param stimulusInfo The stimulus information object that describes the name
40
+ * @param { "same" | "opposite" } targetSide - The side of the target stimulus [same|opposite].
41
+ * @param { "left" | "right" } stimulusSide - The side of the stimulus to be displayed [left|right].
42
+ * @param { object } stimulusInfo - The stimulus information object that describes the name
43
43
* of the stimulus and its source.
44
- * @param instruction Whether to include instruction text teaching participants
44
+ * @param { boolean } instruction - Whether to include instruction text teaching participants
45
45
* how to respond or not.
46
- * @returns HTML string representing the stimulus.
46
+ * @returns { string } HTML string representing the stimulus.
47
47
*/
48
48
function generateStimulus (
49
49
targetSide : keyof IStimulusInfo ,
@@ -73,9 +73,9 @@ function generateStimulus(
73
73
/**
74
74
* Computes the correct response index.
75
75
*
76
- * @param targetSide The side of the target stimulus [same|opposite].
77
- * @param stimulusSide The side of the stimulus to be displayed [left|right].
78
- * @returns The correct response index.
76
+ * @param { "same" | "opposite" } targetSide - The side of the target stimulus [same|opposite].
77
+ * @param { "left" | "right" } stimulusSide - The side of the stimulus to be displayed [left|right].
78
+ * @returns { number } The correct response index.
79
79
*/
80
80
function getCorrectResponse ( targetSide : keyof IStimulusInfo , stimulusSide : "left" | "right" ) {
81
81
return targetSide === "same"
@@ -90,8 +90,8 @@ function getCorrectResponse(targetSide: keyof IStimulusInfo, stimulusSide: "left
90
90
/**
91
91
* Trial that announces the demo game type.
92
92
*
93
- * @param stimulusName The name of the stimulus to be demoed
94
- * @returns jsPsychHtmlButtonResponse object displaying the name of the stimulus
93
+ * @param { string } stimulusName - The name of the stimulus to be demoed.
94
+ * @returns { object } jsPsychHtmlButtonResponse object displaying the name of the stimulus
95
95
* to be demoed.
96
96
*/
97
97
function createGametypeTrial ( stimulusName : string ) {
@@ -108,12 +108,12 @@ function createGametypeTrial(stimulusName: string) {
108
108
/**
109
109
* Trial that shows the stimulus and collects the response.
110
110
*
111
- * @param jsPsych The jsPsych object that runs the experiment.
112
- * @param stimulusInfo The stimulus information object that describes the name
111
+ * @param { object } jsPsych - The jsPsych object that runs the experiment.
112
+ * @param { object } stimulusInfo - The stimulus information object that describes the name
113
113
* of the stimulus and its source.
114
- * @param instruction Whether to include instruction text teaching participants
114
+ * @param { boolean } instruction - Whether to include instruction text teaching participants
115
115
* how to respond or not.
116
- * @returns jsPsychHtmlButtonResponse object displaying the stimulus and collecting
116
+ * @returns { object } jsPsychHtmlButtonResponse object displaying the stimulus and collecting
117
117
* the response.
118
118
*/
119
119
function createTrial ( jsPsych : JsPsych , stimulusInfo : IStimulusInfo , instruction : boolean = false ) {
@@ -149,8 +149,8 @@ function createTrial(jsPsych: JsPsych, stimulusInfo: IStimulusInfo, instruction:
149
149
/**
150
150
* Trial that shows feedback after each demo trial.
151
151
*
152
- * @param jsPsych The jsPsych object that runs the experiment.
153
- * @returns jsPsychHtmlKeyboardResponse object displaying feedback after each
152
+ * @param { object } jsPsych - The jsPsych object that runs the experiment.
153
+ * @returns { object } jsPsychHtmlKeyboardResponse object displaying feedback after each
154
154
* demo trial that depends on whether the participant answered correctly.
155
155
*
156
156
*/
@@ -175,8 +175,8 @@ function createFeedbackTrial(jsPsych: JsPsych) {
175
175
/**
176
176
* Trial that shows a fixation cross.
177
177
*
178
- * @param jsPsych The jsPsych object that runs the experiment.
179
- * @returns jsPsychHtmlKeyboardResponse object displaying a fixation cross for a
178
+ * @param { object } jsPsych - The jsPsych object that runs the experiment.
179
+ * @returns { object } jsPsychHtmlKeyboardResponse object displaying a fixation cross for a
180
180
* random duration.
181
181
*/
182
182
function createFixationTrial ( jsPsych : JsPsych , fixationDurationFunction : ( ) => number ) {
@@ -196,11 +196,11 @@ function createFixationTrial(jsPsych: JsPsych, fixationDurationFunction: () => n
196
196
/**
197
197
* Creates a demo subtimeline.
198
198
*
199
- * @param jsPsych The jsPsych object that runs the experiment.
200
- * @param targetSide The side of the target stimulus [same|opposite|both] .
201
- * @param stimulusInfo The stimulus information object that describes the name
199
+ * @param { object } jsPsych - The jsPsych object that runs the experiment.
200
+ * @param { "same" | "opposite" | "both" } targetSide - The side of the target stimulus.
201
+ * @param { object } stimulusInfo - The stimulus information object that describes the name
202
202
* of the stimulus and its source.
203
- * @returns A subtimeline that includes a demo trial with stimulus on the left,
203
+ * @returns { Array } A subtimeline that includes a demo trial with stimulus on the left,
204
204
* a demo trial with stimulus on the right, or both.
205
205
*/
206
206
function createDemoSubTimeline (
@@ -250,14 +250,14 @@ function createDemoSubTimeline(
250
250
/**
251
251
* Creates a subtimeline with a set number of trials.
252
252
*
253
- * @param jsPsych The jsPsych object that runs the experiment.
254
- * @param options The options object that includes what kinds of trials to
253
+ * @param { object } jsPsych - The jsPsych object that runs the experiment.
254
+ * @param { object } options - The options object that includes what kinds of trials to
255
255
* include [same|opposte|both], the number of trials, the weights for how often
256
256
* each type of stimulus appears, the weights for how often the stimulus appears on
257
257
* each side, and the stimulus information containing the name and source of each
258
258
* stimulus type.
259
259
*
260
- * @returns A subtimeline with a set number of trials with the specified options.
260
+ * @returns { Array } A subtimeline with a set number of trials with the specified options.
261
261
*/
262
262
function createTrialsSubTimeline (
263
263
jsPsych : JsPsych ,
@@ -326,12 +326,13 @@ function createTrialsSubTimeline(
326
326
/**
327
327
* Creates the main timeline.
328
328
*
329
- * @param jsPsych The jsPsych object that runs the experiment.
330
- * @param options The options object that includes the number of trials, the weights
329
+ * @param { object } jsPsych - The jsPsych object that runs the experiment.
330
+ * @param { object } options - The options object that includes the number of trials, the weights
331
331
* for how often each type of stimulus appears, the weights for how often the stimulus
332
332
* appears on each side, the stimulus information containing the name and source
333
333
* of each stimulus type, whether to include a demo section or not, and the instruction
334
334
* text at the beginning and end of the experiment.
335
+ * @returns {object } The main timeline object.
335
336
*/
336
337
export function createTimeline (
337
338
jsPsych : JsPsych ,
0 commit comments