Skip to content

Commit 2cb620b

Browse files
committed
standardize current_trial and condition namings
1 parent 0b1b8a0 commit 2cb620b

File tree

10 files changed

+30
-26
lines changed

10 files changed

+30
-26
lines changed

cued_task_switching_single_task_network/experiment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ var appendData = function() {
241241
task: curr_task,
242242
task_condition: task_switch.task_switch,
243243
cue_condition: task_switch.cue_switch,
244-
trial_num: trial_num,
244+
current_trial: trial_num,
245245
correct_response: correct_response,
246246
CTI: CTI
247247
})

cued_task_switching_single_task_network__fmri/experiment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ var appendData = function() {
272272
task: curr_task,
273273
task_condition: task_switch.task_switch,
274274
cue_condition: task_switch.cue_switch,
275-
trial_num: trial_num,
275+
current_trial: trial_num,
276276
correct_response: correct_response,
277277
CTI: CTI
278278
})

cued_task_switching_single_task_network__practice/experiment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ var appendData = function() {
265265
task: curr_task,
266266
task_condition: task_switch.task_switch,
267267
cue_condition: task_switch.cue_switch,
268-
trial_num: trial_num,
268+
current_trial: trial_num,
269269
correct_response: correct_response,
270270
CTI: CTI
271271
})

directed_forgetting_single_task_network/experiment.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ var appendProbeData = function(data) {
136136
jsPsych.data.addDataToLastTrial({
137137
correct: correct,
138138
probe_letter: probe,
139-
directed_forgetting_condition: directed_condition,
140-
trial_num: current_trial,
139+
directed_forgetting_condition: directed_forgetting_condition,
140+
current_trial: current_trial,
141141
correct_response: correct_response,
142142
exp_stage: exp_stage,
143143
cue: cue,
@@ -181,23 +181,23 @@ var getCue = function() {
181181
};
182182

183183
// Will pop out a probe type from the entire probeTypeArray and then choose a probe congruent with the probe type
184-
var getProbe = function(letters,directed_condition,cue) {
184+
var getProbe = function(letters,directed_forgetting_condition,cue) {
185185
var trainingArray = jsPsych.randomization.repeat(stimArray, 1);
186186
var lastSet_top = letters.slice(0,numLetters/2)
187187
var lastSet_bottom = letters.slice(numLetters/2)
188-
if (directed_condition == 'pos') {
188+
if (directed_forgetting_condition == 'pos') {
189189
if (cue == 'BOT') {
190190
probe = lastSet_top[Math.floor(Math.random() * numLetters/2)]
191191
} else if (cue == 'TOP') {
192192
probe = lastSet_bottom[Math.floor(Math.random() * numLetters/2)]
193193
}
194-
} else if (directed_condition == 'neg') {
194+
} else if (directed_forgetting_condition == 'neg') {
195195
if (cue == 'BOT') {
196196
probe = lastSet_bottom[Math.floor(Math.random() * numLetters/2)]
197197
} else if (cue == 'TOP') {
198198
probe = lastSet_top[Math.floor(Math.random() * numLetters/2)]
199199
}
200-
} else if (directed_condition == 'con') {
200+
} else if (directed_forgetting_condition == 'con') {
201201
newArray = trainingArray.filter(function(y) {
202202
return (y != lastSet_top[0] && y != lastSet_top[1] &&
203203
y != lastSet_bottom[0] && y != lastSet_bottom[1])
@@ -219,7 +219,7 @@ var getProbeHTML = function(){
219219

220220
var getLettersHTML = function(){
221221
stim = stims.pop()
222-
directed_condition = stim.directed_condition
222+
directed_forgetting_condition = stim.directed_forgetting_condition
223223
letters = stim.letters
224224
cue = stim.cue
225225
probe = stim.probe
@@ -259,14 +259,14 @@ var createTrialTypes = function (numTrialsPerBlock,numLetters){
259259
var stims = []
260260

261261
for (var i = 0; i < numTrialsPerBlock; i++){
262-
var directed_condition = probeTypeArray.pop()
262+
var directed_forgetting_condition = probeTypeArray.pop()
263263
var letters = getTrainingSet(used_letters,numLetters)
264264
var cue = getCue()
265-
var probe = getProbe(letters,directed_condition,cue)
266-
var correct_response = getCorrectResponse(directed_condition)
265+
var probe = getProbe(letters,directed_forgetting_condition,cue)
266+
var correct_response = getCorrectResponse(directed_forgetting_condition)
267267

268268
stim = {
269-
directed_condition:directed_condition,
269+
directed_forgetting_condition:directed_forgetting_condition,
270270
letters: letters,
271271
cue: cue,
272272
probe: probe,
@@ -515,7 +515,7 @@ var start_fixation_block = {
515515
on_finish: function() {
516516
jsPsych.data.addDataToLastTrial({
517517
exp_stage: exp_stage,
518-
trial_num: current_trial
518+
current_trial: current_trial
519519
})
520520
}
521521
}
@@ -534,7 +534,7 @@ var fixation_block = {
534534
on_finish: function() {
535535
jsPsych.data.addDataToLastTrial({
536536
exp_stage: exp_stage,
537-
trial_num: current_trial
537+
current_trial: current_trial
538538
})
539539
}
540540
}
@@ -552,7 +552,7 @@ var ITI_fixation_block = {
552552
on_finish: function() {
553553
jsPsych.data.addDataToLastTrial({
554554
exp_stage: exp_stage,
555-
trial_num: current_trial
555+
current_trial: current_trial
556556
})
557557
current_trial = current_trial + 1
558558
}
@@ -683,7 +683,7 @@ for (i = 0; i < (practice_length); i++) {
683683
on_finish: function() {
684684
jsPsych.data.addDataToLastTrial({
685685
exp_stage: exp_stage,
686-
trial_num: current_trial
686+
current_trial: current_trial
687687
})
688688
}
689689
}
@@ -703,7 +703,7 @@ for (i = 0; i < (practice_length); i++) {
703703
on_finish: function() {
704704
jsPsych.data.addDataToLastTrial({
705705
exp_stage: exp_stage,
706-
trial_num: current_trial
706+
current_trial: current_trial
707707
})
708708
}
709709
}
@@ -722,7 +722,7 @@ for (i = 0; i < (practice_length); i++) {
722722
on_finish: function() {
723723
jsPsych.data.addDataToLastTrial({
724724
exp_stage: exp_stage,
725-
trial_num: current_trial
725+
current_trial: current_trial
726726
})
727727
current_trial = current_trial + 1
728728
}

go_nogo_single_task_network/experiment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var appendData = function(data) {
104104
}
105105

106106
jsPsych.data.addDataToLastTrial({
107-
trial_num: current_trial,
107+
current_trial: current_trial,
108108
})
109109

110110
current_trial +=1

shape_matching_single_task_network/experiment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ var getStim = function() {
109109
} else if (trial_type[2] == 'N'){
110110
distractor_i = 'none'
111111
}
112-
currData.trial_num = current_trial
112+
currData.current_trial = current_trial
113113
currData.shape_matching_condition = trial_type
114114
currData.probe_id = probe_i
115115
currData.target_id = target_i

shape_matching_single_task_network__fmri/experiment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ var getStim = function() {
139139
} else if (trial_type[2] == 'N'){
140140
distractor_i = 'none'
141141
}
142-
currData.trial_num = current_trial
142+
currData.current_trial = current_trial
143143
currData.shape_matching_condition = trial_type
144144
currData.probe_id = probe_i
145145
currData.target_id = target_i

shape_matching_single_task_network__practice/experiment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ var getStim = function() {
138138
} else if (trial_type[2] == 'N'){
139139
distractor_i = 'none'
140140
}
141-
currData.trial_num = current_trial
141+
currData.current_trial = current_trial
142142
currData.shape_matching_condition = trial_type
143143
currData.probe_id = probe_i
144144
currData.target_id = target_i

shape_matching_with_cued_task_switching/experiment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ var appendData = function() {
297297
task_condition: task_switch.task_switch,
298298
cue_condition: task_switch.cue_switch,
299299
shape_matching_condition: shape_matching_condition,
300-
trial_num: trial_num,
300+
current_trial: trial_num,
301301
probe: probe,
302302
target: target,
303303
distractor: distractor,

shape_matching_with_predictable_task_switching/experiment.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ var getFixation = function(){
262262
var appendData = function(){
263263
curr_trial = jsPsych.progress().current_trial_global
264264
trial_id = jsPsych.data.getDataByTrialIndex(curr_trial).trial_id
265+
current_trial+=1
265266

266267
jsPsych.data.addDataToLastTrial({
267268
predictable_condition: predictable_condition,
@@ -271,7 +272,8 @@ var appendData = function(){
271272
target: target,
272273
distractor: distractor,
273274
correct_response: correct_response,
274-
whichQuadrant: whichQuadrant
275+
whichQuadrant: whichQuadrant,
276+
current_trial: current_trial
275277

276278
})
277279

@@ -624,6 +626,7 @@ var practiceNode = {
624626
loop_function: function(data){
625627
practiceCount += 1
626628
stims = createTrialTypes(practice_len)
629+
current_trial = 0
627630

628631
var sum_rt = 0
629632
var sum_responses = 0
@@ -733,6 +736,7 @@ var testNode = {
733736
testCount += 1
734737
stims = createTrialTypes(numTrialsPerBlock)
735738
console.log('hereherhe')
739+
current_trial = 0
736740

737741
var sum_rt = 0
738742
var sum_responses = 0

0 commit comments

Comments
 (0)