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

clean up in-person displays #601

Open
wants to merge 2 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
14 changes: 7 additions & 7 deletions cued_task_switching_single_task_network__fmri/experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getITI_resp() { //added for fMRI compatibility

//feedback functions added for in-person version
var getRefreshFeedback = function() {
return '<div class = bigbox><div class = picture_box><p class = block-text><font color="white">' + refresh_feedback_text + '</font></p></div></div>'
return '<div class = bigbox><div class = picture_box><p class = instruct-text><font color="white">' + refresh_feedback_text + '</font></p></div></div>'
}

var getRefreshTrialID = function() {
Expand Down Expand Up @@ -119,7 +119,7 @@ var randomDraw = function(lst) {


var getFeedback = function() {
return '<div class = bigbox><div class = picture_box><p class = block-text><font color="white">' + feedback_text + '</font></p></div></div>'
return '<div class = bigbox><div class = picture_box><p class = instruct-text><font color="white">' + feedback_text + '</font></p></div></div>'
}


Expand Down Expand Up @@ -353,11 +353,11 @@ var current_trial = 0
var CTI = 150 //cue-target-interval or cue's length (7/29, changed from 300 to 150; less time to process the cue should increase cue switch costs and task switch costs)
var exp_stage = 'practice' // defines the exp_stage, switched by start_test_block

var task_list = '<ul><li><i>Parity</i> or <i>Odd-Even</i>: Press your ' + response_keys.key_name[
var task_list = '<ul><li><strong><i>Parity</i> or <i>Odd-Even</i>: Press your ' + response_keys.key_name[
0] + ' key if even and your ' + response_keys.key_name[1] + ' key if odd.' +
'</li><li><i>Magnitude</i> or <i>High-Low</i>: Press your ' + response_keys.key_name[
0] + ' key if the number is greater than 5 and your ' + response_keys.key_name[1] +
' key if less than 5.</li></ul>'
' key if less than 5.</strong></li></ul>'

var prompt_task_list = '<ul style="text-align:left"><li><i>Parity</i> or <i>Odd-Even</i>: ' + response_keys.key_name[0] +
' if even and ' + response_keys.key_name[1] + ' if odd.' +
Expand Down Expand Up @@ -538,9 +538,9 @@ for (var i = 0; i < refresh_length + 1; i++) {
stimulus: getStim,
is_html: true,
key_answer: getResponse,
correct_text: '<div class = fb_box><div class = center-text><font size = 20>Correct!</font></div></div>',
incorrect_text: '<div class = fb_box><div class = center-text><font size = 20>Incorrect</font></div></div>',
timeout_message: '<div class = fb_box><div class = center-text><font size = 20>Respond Faster!</font></div></div>' +
correct_text: '<div class = upperbox><div class = center-text>Correct!</font></div></div>',
incorrect_text: '<div class = upperbox><div class = center-text>Incorrect</font></div></div>',
timeout_message: '<div class = upperbox><div class = center-text>Respond Faster!</div></div>' +
prompt_task_list,
choices: choices,
data: {
Expand Down
Binary file modified cued_task_switching_single_task_network__fmri/images/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cued_task_switching_single_task_network__fmri/images/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cued_task_switching_single_task_network__fmri/images/3.png
Binary file modified cued_task_switching_single_task_network__fmri/images/4.png
Binary file modified cued_task_switching_single_task_network__fmri/images/6.png
Binary file modified cued_task_switching_single_task_network__fmri/images/7.png
Binary file modified cued_task_switching_single_task_network__fmri/images/8.png
Binary file modified cued_task_switching_single_task_network__fmri/images/9.png
58 changes: 13 additions & 45 deletions cued_task_switching_single_task_network__fmri/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,21 @@ margin-right:0%;
background-color: none;
text-align: center;
}
/*
.instructBox {
width: 80vw;
height: 10vw;
position:absolute;
top:10%;
left:50%;
margin-right: 0%;
transform: translate(-50%,-50%);
background-color: none;
font-size: 24px;
} */

/* taken from stop_signal__fmri */
/*MODIFIED FOR IN SCANNER PRESENTATIONS*/
ul {
list-style-type: none;
text-align: center;
display: inline-block;
font-size: 30px;
font-size: 40px;
line-height: 120%;
margin-bottom: 1em;
color: white
}


.instructbox {
width: 50vw;
width: 70vw;
height: 60vh;
position:absolute;
top:45%;
Expand All @@ -117,42 +105,22 @@ ul {
text-align: center;
}

/* .instruct-text {
width:100%;
text-align: center;
margin: 0 auto;
margin-bottom: 1em;
font-size: 30px;
line-height: 120%;
color: white;
} */

/* .instruct-text {
width:100%;
text-align: center;
margin: 0 auto;
margin-bottom: 1em;
font-size: 35px;
line-height: 120%;
color: white;
} */
/*
.instruct-text {
width:100%;
text-align: left;
margin: 0 auto;
margin-bottom: 1em;
font-size: 35px;
line-height: 120%;
color: white;
} */
.center-text {
text-align:center;
font-size: 85px;
position: relative;
top: 50%;
-ms-transform: translateY(-50%);
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}

.instruct-text {
width:100%;
text-align: left;
margin: 0 auto;
margin-bottom: 1em;
font-size: 30px;
font-size: 40px;
line-height: 120%;
color: white;
}
Expand Down
34 changes: 17 additions & 17 deletions cued_task_switching_single_task_network__practice/experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getITI_resp() { //added for fMRI compatibility

//feedback functions added for practice version
var getPracticeFeedback = function() {
return '<div class = bigbox><div class = picture_box><p class = block-text><font color="white">' + practice_feedback_text + '</font></p></div></div>'
return '<div class = bigbox><div class = picture_box><p class = instruct-text><font color="white">' + practice_feedback_text + '</font></p></div></div>'
}

var getPracticeTrialID = function() {
Expand Down Expand Up @@ -344,11 +344,11 @@ var current_trial = 0
var CTI = 150 //cue-target-interval or cue's length (7/29, changed from 300 to 150; less time to process the cue should increase cue switch costs and task switch costs)
var exp_stage = 'practice' // defines the exp_stage, switched by start_test_block

var task_list = '<ul><li><i>Parity</i> or <i>Odd-Even</i>: Press your ' + response_keys.key_name[
var task_list = '<ul><li><strong><i>Parity</i> or <i>Odd-Even</i>: Press your ' + response_keys.key_name[
0] + ' key if even and your ' + response_keys.key_name[1] + ' key if odd.' +
'</li><li><i>Magnitude</i> or <i>High-Low</i>: Press your ' + response_keys.key_name[
0] + ' key if the number is greater than 5 and your ' + response_keys.key_name[1] +
' key if less than 5.</li></ul>'
' key if less than 5.</strong></li></ul>'

var prompt_task_list = '<ul style="text-align:left"><li><i>Parity</i> or <i>Odd-Even</i>: ' + response_keys.key_name[0] +
' if even and ' + response_keys.key_name[1] + ' if odd.' +
Expand All @@ -372,12 +372,12 @@ var ITIs_stim = []
var ITIs_resp = []

//practice feedback variables
var practice_feedback_text = '<div class = instructbox><p class = block-text>In this task, you will have to respond to a sequence of numbers by pressing your middle and index fingers. How you respond to the numbers will depend on the current task, which can change every trial.</p>'+
'<p class = block-text>On some trials you will have to indicate whether the number is odd or even, and on other trials you will indicate whether the number is higher or lower than 5. Each trial will start with a cue telling you which task to do on that trial.</p>' +
'<p class = block-text>The cue before the number will be a word indicating the task. There will be four different cues indicating two different tasks. The cues and tasks are described below:</p>' +
var practice_feedback_text = '<div class = instructbox><p class = instruct-text>In this task, you will have to respond to a sequence of numbers by pressing your middle and index fingers. How you respond to the numbers will depend on the current task, which can change every trial.</p>'+
'<p class = instruct-text>On some trials you will have to indicate whether the number is odd or even, and on other trials you will indicate whether the number is higher or lower than 5. Each trial will start with a cue telling you which task to do on that trial.</p>' +
'<p class = instruct-text>The cue before the number will be a word indicating the task. There will be four different cues indicating two different tasks. The cues and tasks are described below:</p>' +
task_list +
'<p class = block-text>During practice, you will see a reminder of the rules. <i> This will be removed for the test</i>. </p>'+
'<p class = block-text>When you are ready to begin, please press the spacebar. </p>'+
'<p class = instruct-text>During practice, you will see a reminder of the rules. <i> This will be removed for the test</i>. </p>'+
'<p class = instruct-text>When you are ready to begin, please press the spacebar. </p>'+
'</div>'
var practice_trial_id = "instructions"
var practice_feedback_timing = -1
Expand Down Expand Up @@ -508,10 +508,10 @@ for (var i = 0; i < practice_length + 1; i++) {
stimulus: getStim,
is_html: true,
key_answer: getResponse,
timeout_message: '<div class = fb_box><div class = center-text><font size = 20>Respond Faster!</font></div></div>' +
timeout_message: '<div class = upperbox><div class = center-text><font size = 20>Respond Faster!</font></div></div>' +
prompt_task_list,
correct_text: '<div class = fb_box><div class = center-text><font size = 20>Correct!</font></div></div>',
incorrect_text: '<div class = fb_box><div class = center-text><font size = 20>Incorrect</font></div></div>',
correct_text: '<div class = upperbox><div class = center-text><font size = 20>Correct!</font></div></div>',
incorrect_text: '<div class = upperbox><div class = center-text><font size = 20>Incorrect</font></div></div>',
choices: choices,
data: {
trial_id: 'practice_trial'
Expand Down Expand Up @@ -573,7 +573,7 @@ var practiceNode = {

if (accuracy > accuracy_thresh){
practice_feedback_text +=
'</p><p class = block-text>Done with this practice.'
'</p><p class = instruct-text>Done with this practice.'

task_switches = jsPsych.randomization.repeat(task_switches_arr, numTrialsPerBlock / 4)
task_switches.unshift({task_switch: 'na', cue_switch: 'na', go_no_go_type: jsPsych.randomization.repeat(['go','nogo'],1).pop()})
Expand All @@ -582,20 +582,20 @@ var practiceNode = {

} else if (accuracy < accuracy_thresh){
practice_feedback_text +=
'</p><p class = block-text>We are going to try practice again to see if you can achieve higher accuracy. Remember: <br>' + prompt_task_list
'</p><p class = instruct-text>We are going to try practice again to see if you can achieve higher accuracy. Remember: <br>' + prompt_task_list
if (missed_responses > missed_response_thresh){
practice_feedback_text +=
'</p><p class = block-text>You have been responding too slowly. Please respond as quickly and as accurately as possible.'
'</p><p class = instruct-text>You have been responding too slowly. Please respond as quickly and as accurately as possible.'
}

if (ave_rt > rt_thresh) {
practice_feedback_text +=
'</p><p class = block-text>You have been responding too slowly.'
'</p><p class = instruct-text>You have been responding too slowly.'
}

if (practiceCount == practice_thresh){
practice_feedback_text +=
'</p><p class = block-text>Done with this practice.'
'</p><p class = instruct-text>Done with this practice.'

task_switches = jsPsych.randomization.repeat(task_switches_arr, numTrialsPerBlock / 4)
task_switches.unshift({task_switch: 'na', cue_switch: 'na', go_no_go_type: jsPsych.randomization.repeat(['go','nogo'],1).pop()})
Expand All @@ -604,7 +604,7 @@ var practiceNode = {
}

practice_feedback_text +=
'</p><p class = block-text>Redoing this practice. When you are ready to continue, please press the spacebar.'
'</p><p class = instruct-text>Redoing this practice. When you are ready to continue, please press the spacebar.'

return true

Expand Down
Binary file modified cued_task_switching_single_task_network__practice/images/1.png
Binary file modified cued_task_switching_single_task_network__practice/images/2.png
Binary file modified cued_task_switching_single_task_network__practice/images/3.png
Binary file modified cued_task_switching_single_task_network__practice/images/4.png
Binary file modified cued_task_switching_single_task_network__practice/images/6.png
Binary file modified cued_task_switching_single_task_network__practice/images/7.png
Binary file modified cued_task_switching_single_task_network__practice/images/8.png
Binary file modified cued_task_switching_single_task_network__practice/images/9.png
50 changes: 5 additions & 45 deletions cued_task_switching_single_task_network__practice/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,75 +81,35 @@ margin-right:0%;
background-color: none;
text-align: center;
}
/*
.instructBox {
width: 80vw;
height: 10vw;
position:absolute;
top:10%;
left:50%;
margin-right: 0%;
transform: translate(-50%,-50%);
background-color: none;
font-size: 24px;
} */

/* taken from stop_signal__fmri */
/* ul {
/* MODIFIED FOR IN-PERSON PRACTICE */
ul {
list-style-type: none;
text-align: center;
display: inline-block;
font-size: 30px;
line-height: 120%;
margin-bottom: 1em;
color: white
} */

ul {
list-style-type: none;
text-align: center;
display: inline-block;
color: white
}

}

.instructbox {
width: 50vw;
height: 60vh;
position:absolute;
top:45%;
top:35%;
left:50%;
margin-right:-50%;
transform: translate(-50%,-50%);
text-align: center;
}

/* .instruct-text {
width:100%;
text-align: center;
margin: 0 auto;
margin-bottom: 1em;
font-size: 30px;
line-height: 120%;
color: white;
} */

/* .instruct-text {
width:100%;
text-align: center;
margin: 0 auto;
margin-bottom: 1em;
font-size: 35px;
line-height: 120%;
color: white;
} */

.instruct-text {
width:100%;
text-align: left;
margin: 0 auto;
margin-bottom: 1em;
font-size: 35px;
font-size: 28px;
line-height: 120%;
color: white;
}
Expand Down
18 changes: 9 additions & 9 deletions n_back_single_task_network__fmri/experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getITI_resp() { //added for fMRI compatibility

//feedback functions added for in-person version
var getRefreshFeedback = function() {
return '<div class = bigbox><div class = picture_box><p class = block-text><font color="white">' + refresh_feedback_text + '</font></p></div></div>'
return '<div class = bigbox><div class = picture_box><p class = instruct-text><font color="white">' + refresh_feedback_text + '</font></p></div></div>'
}

var getRefreshTrialID = function() {
Expand Down Expand Up @@ -122,7 +122,7 @@ var getResponse = function() {
}

var getFeedback = function() {
return '<div class = bigbox><div class = picture_box><p class = block-text><font color="white">' + feedback_text + '</font></p></div></div>'
return '<div class = bigbox><div class = picture_box><p class = instruct-text><font color="white">' + feedback_text + '</font></p></div></div>'
}


Expand Down Expand Up @@ -280,7 +280,7 @@ var instructTimeThresh = 0 ///in seconds
var credit_var = 0


var practice_len = 15 // must be divisible by 5
var practice_len = 10 // must be divisible by 5
var exp_len = 220 //150 // must be divisible by 5 --9:30
var numTrialsPerBlock = 55 // must be divisible by 5 and we need to have a multiple of 2 blocks (2,4,6) in order to have equal delays across blocks
var numTestBlocks = exp_len / numTrialsPerBlock //should be divisble by 2 ^^
Expand All @@ -291,7 +291,7 @@ var missed_thresh = 0.10

var delays = jsPsych.randomization.repeat([1, 2], numTestBlocks / 2) //jsPsych.randomization.repeat([1, 2, 3], numTestBlocks / 3)

var delay = 1
var delay = 2 //1

var pathSource = "/static/experiments/n_back_single_task_network__fmri/images/"
var fileTypePNG = ".png'></img>"
Expand Down Expand Up @@ -344,10 +344,10 @@ var ITIs_resp = []
var refresh_feedback_text = '<div class = instructbox>'+
'<p class = instruct-text>In this task, you will see a letter on every trial.</p>'+
'<p class = instruct-text>You will be asked to match the current letter to the letter that appeared either 1, 2, or 3 trials ago depending on the delay given to you for that block.</p>'+
'<p class = instruct-text>Press your '+possible_responses[0][0]+' if the letters match, and your '+possible_responses[1][0]+' if they mismatch.</p>'+
'<p class = instruct-text><strong>Press your '+possible_responses[0][0]+' if the letters match, and your '+possible_responses[1][0]+' if they mismatch.</strong></p>'+
'<p class = instruct-text>Your delay (the number of trials ago which you must match the current letter to) will change from block to block. You will be given the delay at the start of every block of trials.</p>'+
'<p class = instruct-text>Capitalization does not matter, so "T" matches with "t".</p> '+
'<p class = instruct-text><i>Your delay for this upcoming practice round is 1</i>.</p> '+
'<p class = instruct-text><strong><i>Your delay for this upcoming practice round is 1</i>.</strong></p> '+
'<p class = instruct-text>During practice, you will see a reminder of the rules. <i> This will be removed for the test</i>. </p>'+
'<p class = instruct-text>To let the experimenters know when you are ready to begin, please press any button. </p>'+
'</div>'
Expand Down Expand Up @@ -472,9 +472,9 @@ for (i = 0; i < practice_len + 2; i++) { //was changed from + 3 as delays went f
data: {
trial_id: "practice_trial"
},
correct_text: '<div class = fb_box><div class = center-text><font size = 20>Correct!</font></div></div>',// + prompt_text_list,
incorrect_text: '<div class = fb_box><div class = center-text><font size = 20>Incorrect</font></div></div>',// + prompt_text_list,
timeout_message: '<div class = fb_box><div class = center-text><font size = 20>Respond Faster!</font></div></div>' + prompt_text_list,
correct_text: '<div class = upperbox><div class = center-text>Correct!</font></div></div>',// + prompt_text_list,
incorrect_text: '<div class = upperbox><div class = center-text>Incorrect</font></div></div>',// + prompt_text_list,
timeout_message: '<div class = upperbox><div class = center-text>Respond Faster!</font></div></div>' + prompt_text_list,
timing_stim: 1000, //1000
timing_response: 2000, //2000
timing_feedback_duration: 500,
Expand Down
Binary file modified n_back_single_task_network__fmri/images/lowercase_B.png
Binary file modified n_back_single_task_network__fmri/images/lowercase_D.png
Binary file modified n_back_single_task_network__fmri/images/lowercase_G.png
Binary file modified n_back_single_task_network__fmri/images/lowercase_T.png
Binary file modified n_back_single_task_network__fmri/images/lowercase_V.png
Binary file modified n_back_single_task_network__fmri/images/uppercase_B.png
Binary file modified n_back_single_task_network__fmri/images/uppercase_D.png
Binary file modified n_back_single_task_network__fmri/images/uppercase_G.png
Binary file modified n_back_single_task_network__fmri/images/uppercase_T.png
Binary file modified n_back_single_task_network__fmri/images/uppercase_V.png
Loading