Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LNDG
Multi-Attribute-Task
Commits
d0e3d032
Commit
d0e3d032
authored
Nov 24, 2021
by
Julian Kosciessa
Browse files
add script to test out behavioral presentation (word version default)
parent
ed42ecd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
StateSwitch/Z_testBehavioralPresentation.m
0 → 100644
View file @
d0e3d032
% This script can be used to try out the experiment behaviorally (defaults to word version)
%% specify psychtoolbox path
addpath
(
genpath
(
'/Users/kosciessa/multi-attribute-task/Psychtoolbox'
));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% enter subject ID & task variant %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prompt
=
{
'Enter subject ID:'
,
'Enter paradigm (dynamic/words/visual):'
};
dlg_title
=
'StateSwitch Input'
;
num_lines
=
1
;
defaultans
=
{
'9999'
,
'words'
};
answer
=
inputdlg
(
prompt
,
dlg_title
,
num_lines
,
defaultans
);
setup
.
subj
=
answer
{
1
};
setup
.
task
=
answer
{
2
};
% task materials: 'words', 'visual', 'dynamic'
disp
([
'Continuing with subject '
,
setup
.
subj
,
' and '
,
setup
.
task
,
' task version.'
]);
%% add required paths
pn
.
root
=
[
'/Users/kosciessa/multi-attribute-task/'
];
pn
.
CB
=
[
pn
.
root
,
'checker'
,
filesep
];
addpath
(
pn
.
CB
);
pn
.
MAT
=
[
pn
.
root
,
'dotsx'
,
filesep
];
addpath
(
pn
.
MAT
);
pn
.
SS
=
[
pn
.
root
,
'StateSwitch'
,
filesep
];
addpath
(
pn
.
SS
);
pn
.
Stroop
=
[
pn
.
root
,
'Stroop'
,
filesep
];
addpath
(
pn
.
Stroop
);
addpath
(
genpath
([
pn
.
root
,
'functions'
,
filesep
]));
addpath
(
genpath
([
pn
.
root
,
'helper'
,
filesep
]));
%% create results directory
setup
.
subjectsPath
=
[
pn
.
root
,
filesep
,
'data'
,
filesep
,
setup
.
subj
'_test_'
datestr
(
now
,
'yymmdd_HHMM'
)
filesep
];
mkdir
(
setup
.
subjectsPath
);
diary
([
setup
.
subjectsPath
,
setup
.
subj
,
'_ptbnotes_setup.txt'
]);
version
%% pre-randomize data experimental condition data
ind1
=
str2num
(
answer
{
1
}(
1
));
ind2
=
str2num
(
answer
{
1
}(
2
));
ind3
=
str2num
(
answer
{
1
}(
3
:
4
));
if
numel
(
num2str
(
ind3
))
==
1
ind3_conv
=
[
'0'
,
num2str
(
ind3
)];
else
ind3_conv
=
num2str
(
ind3
);
end
ID
=
[
num2str
(
ind1
),
num2str
(
ind2
),
ind3_conv
];
disp
(
ID
);
% create randomization
expInfo
=
[];
expInfo
=
eval
([
'StateSwitch_createExpInfo_'
,
answer
{
2
},
'_171023'
]);
% save randomization
if
~
exist
([
pn
.
root
,
'expInfo_test'
]);
mkdir
([
pn
.
root
,
'expInfo_test'
]);
end
save
([
pn
.
root
,
'expInfo_test/'
,
ID
,
'_expInfo.mat'
],
'expInfo'
);
%% set up PTB
if
ispc
Screen
(
'Preference'
,
'SkipSyncTests'
,
0
);
else
Screen
(
'Preference'
,
'SkipSyncTests'
,
1
);
oldLevel
=
Screen
(
'Preference'
,
'Verbosity'
,
4
);
% output debugging info
PsychDebugWindowConfiguration
(
0
,
0.3
)
% setenv('PSYCH_ALLOW_DANGEROUS', '1');
end
%% run state switching task
prompt
=
{
'Start on run:'
};
dlg_title
=
'StateSwitch Run Input'
;
num_lines
=
1
;
defaultans
=
{
'1'
};
answer
=
inputdlg
(
prompt
,
dlg_title
,
num_lines
,
defaultans
);
setup
.
StartRunOn
=
str2num
(
answer
{
1
});
cd
(
pn
.
root
);
% settings for trying out the script
setup
.
DEBUG
=
0
;
setup
.
opacity
=
.
4
;
setup
.
keyB
=
1
;
setup
.
ET
.
useET
=
0
;
setup
.
EEG
.
useEEG
=
0
;
setup
.
MR
.
useMR
=
0
;
setup
.
ET
.
falsePupilRec
=
'no'
;
setup
.
ET
.
ELdummymode
=
0
;
setup
.
disp
=
1
;
% load randomization
load
([
pn
.
root
,
'expInfo_test'
,
filesep
,
setup
.
subj
,
'_expInfo.mat'
],
'expInfo'
);
expInfo
=
expInfo_specifyKeys
(
expInfo
);
% update key assignments
expInfo
.
apXYD
=
[
0
0
260
];
expInfo
.
DotsPerFrame
=
288
;
StateSwitch_experiment_171023
(
expInfo
,
setup
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment