Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post pilot #598

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions directed_forgetting_single_task_network/experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ var appendProbeData = function(data) {
jsPsych.data.addDataToLastTrial({
correct: correct,
probe_letter: probe,
directed_forgetting_condition: directed_condition,
trial_num: current_trial,
directed_forgetting_condition: directed_forgetting_condition,
current_trial: current_trial,
correct_response: correct_response,
exp_stage: exp_stage,
cue: cue,
Expand Down Expand Up @@ -181,23 +181,23 @@ var getCue = function() {
};

// Will pop out a probe type from the entire probeTypeArray and then choose a probe congruent with the probe type
var getProbe = function(letters,directed_condition,cue) {
var getProbe = function(letters,directed_forgetting_condition,cue) {
var trainingArray = jsPsych.randomization.repeat(stimArray, 1);
var lastSet_top = letters.slice(0,numLetters/2)
var lastSet_bottom = letters.slice(numLetters/2)
if (directed_condition == 'pos') {
if (directed_forgetting_condition == 'pos') {
if (cue == 'BOT') {
probe = lastSet_top[Math.floor(Math.random() * numLetters/2)]
} else if (cue == 'TOP') {
probe = lastSet_bottom[Math.floor(Math.random() * numLetters/2)]
}
} else if (directed_condition == 'neg') {
} else if (directed_forgetting_condition == 'neg') {
if (cue == 'BOT') {
probe = lastSet_bottom[Math.floor(Math.random() * numLetters/2)]
} else if (cue == 'TOP') {
probe = lastSet_top[Math.floor(Math.random() * numLetters/2)]
}
} else if (directed_condition == 'con') {
} else if (directed_forgetting_condition == 'con') {
newArray = trainingArray.filter(function(y) {
return (y != lastSet_top[0] && y != lastSet_top[1] &&
y != lastSet_bottom[0] && y != lastSet_bottom[1])
Expand All @@ -219,7 +219,7 @@ var getProbeHTML = function(){

var getLettersHTML = function(){
stim = stims.pop()
directed_condition = stim.directed_condition
directed_forgetting_condition = stim.directed_forgetting_condition
letters = stim.letters
cue = stim.cue
probe = stim.probe
Expand Down Expand Up @@ -259,14 +259,14 @@ var createTrialTypes = function (numTrialsPerBlock,numLetters){
var stims = []

for (var i = 0; i < numTrialsPerBlock; i++){
var directed_condition = probeTypeArray.pop()
var directed_forgetting_condition = probeTypeArray.pop()
var letters = getTrainingSet(used_letters,numLetters)
var cue = getCue()
var probe = getProbe(letters,directed_condition,cue)
var correct_response = getCorrectResponse(directed_condition)
var probe = getProbe(letters,directed_forgetting_condition,cue)
var correct_response = getCorrectResponse(directed_forgetting_condition)

stim = {
directed_condition:directed_condition,
directed_forgetting_condition:directed_forgetting_condition,
letters: letters,
cue: cue,
probe: probe,
Expand Down Expand Up @@ -515,7 +515,7 @@ var start_fixation_block = {
on_finish: function() {
jsPsych.data.addDataToLastTrial({
exp_stage: exp_stage,
trial_num: current_trial
current_trial: current_trial
})
}
}
Expand All @@ -534,7 +534,7 @@ var fixation_block = {
on_finish: function() {
jsPsych.data.addDataToLastTrial({
exp_stage: exp_stage,
trial_num: current_trial
current_trial: current_trial
})
}
}
Expand All @@ -552,7 +552,7 @@ var ITI_fixation_block = {
on_finish: function() {
jsPsych.data.addDataToLastTrial({
exp_stage: exp_stage,
trial_num: current_trial
current_trial: current_trial
})
current_trial = current_trial + 1
}
Expand Down Expand Up @@ -683,7 +683,7 @@ for (i = 0; i < (practice_length); i++) {
on_finish: function() {
jsPsych.data.addDataToLastTrial({
exp_stage: exp_stage,
trial_num: current_trial
current_trial: current_trial
})
}
}
Expand All @@ -703,7 +703,7 @@ for (i = 0; i < (practice_length); i++) {
on_finish: function() {
jsPsych.data.addDataToLastTrial({
exp_stage: exp_stage,
trial_num: current_trial
current_trial: current_trial
})
}
}
Expand All @@ -722,7 +722,7 @@ for (i = 0; i < (practice_length); i++) {
on_finish: function() {
jsPsych.data.addDataToLastTrial({
exp_stage: exp_stage,
trial_num: current_trial
current_trial: current_trial
})
current_trial = current_trial + 1
}
Expand Down
5 changes: 3 additions & 2 deletions flanker_single_task_network/experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ for (i = 0; i < practice_len; i++) {
if (data.key_press == data.correct_response) {
correct_trial = 1
}
current_trial += 1
current_block = practiceCount

jsPsych.data.addDataToLastTrial({correct_trial: correct_trial,
Expand Down Expand Up @@ -533,13 +534,13 @@ for (i = 0; i < numTrialsPerBlock; i++) {
if (data.key_press == data.correct_response) {
correct_trial = 1
}

current_trial += 1
current_block = testCount

jsPsych.data.addDataToLastTrial({correct_trial: correct_trial,
trial_id: 'test_trial',
current_block: current_block,
current_trial: i
current_trial: current_trial
})
}
};
Expand Down
4 changes: 2 additions & 2 deletions flanker_with_cued_task_switching/experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ var response_keys = {key: [77,90], key_name: ["M","Z"]}

var choices = response_keys.key
var practice_length = 16
var test_length = 240
var exp_len = 240
var numTrialsPerBlock = 40
var numTestBlocks = test_length / numTrialsPerBlock
var numTestBlocks = exp_len / numTrialsPerBlock

var flanker_styles = ['solid','outlined']

Expand Down
2 changes: 1 addition & 1 deletion go_nogo_single_task_network/experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var appendData = function(data) {
}

jsPsych.data.addDataToLastTrial({
trial_num: current_trial,
current_trial: current_trial,
})

current_trial +=1
Expand Down
51 changes: 51 additions & 0 deletions n_back_single_task_network__fmri/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[
{
"name": "N-Back Single Task Network fMRI",
"template":"jspsych",
"run": [
"static/js/math.min.js",
"static/js/jspsych/jspsych.js",
"static/js/jspsych/plugins/jspsych-call-function.js",
"static/js/jspsych/poldrack_plugins/jspsych-poldrack-text.js",
"static/js/jspsych/poldrack_plugins/jspsych-poldrack-instructions.js",
"static/js/jspsych/poldrack_plugins/jspsych-attention-check.js",
"static/js/jspsych/poldrack_plugins/jspsych-poldrack-single-stim.js",
"static/js/jspsych/poldrack_plugins/jspsych-poldrack-categorize.js",
"static/js/jspsych/plugins/jspsych-survey-text.js",
"static/js/jspsych/poldrack_plugins/jspsych-stop-signal.js",
"static/js/utils/poldrack_fmri_utils.js",
"experiment.js",
"static/css/jspsych.css",
"static/css/default_style.css",
"style.css",
"https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.13.3/math.js"


],
"exp_id": "n_back_single_task_network__fmri",
"cognitive_atlas_task_id": "tsk_4a57abb949e1a",
"contributors": [
"Patrick Bissett",
"Jamie Li",
"McKenzie Hagen",
"Russell Poldrack"
],
"time":30,
"reference": "http://psycnet.apa.org/journals/xlm/37/2/392/",
"notes": "Condition refers to whether the trial is practice or high_freq/low_freq (the two test conditions) as well as whether it was a go or SS trial",
"publish":"True",
"experiment_variables": [{
"name":"credit_var",
"type":"credit",
"datatype": "boolean",
"description":"True if avg_rt > 200"
}],
"deployment_variables":{"jspsych_init":
{"fullscreen": true,
"display_element": "getDisplayElement",
"on_trial_finish": "addID('n_back_single_task_network__fmri')"}
}

}
]

Loading