Experiment( SubjectCode, SubjectGroup){
Context(){
AssignmentGroup(){
ExperimentName = "Lexical Decision";
new Related = 1;
new Word = 1;
SubjectCode = "pxlab";
new ErrorRate = 100*(ResponseErrorCount/TrialCounter);
new MeanLatency = Trial.IncrementCounter.Value/TrialCounter;
SkipBoundingBlockDisplays = 0;
}
Session(){
Message:A(){
Text = "Lexical Decision\nCondition: %SubjectGroup%\nSubject: %SubjectCode%";
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 1000;
}
TextParagraph(){
Text = ["Your task in this experiment is to decide whether a sequence of letters constitutes a valid word or not.", " ", "If the sequence which is shown is a word, then press the left mouse button.", "If the sequence is not a word, then press the right mouse button.", "Your response must be given while the exclamation mark which is also shown is yellow. Only then will your response be considered as \'correct\'. If your response is too fast or if it takes too long then it will be counted as \'false\'.", " ", "Please press any mouse button to start the experiment."];
}
}
Block( TrialCounter, ResponseErrorCount){
InitCounter(){
Name = "meanLatency";
InitialValue = 0;
}
}
BlockEnd(){
Message(){
Text = ["Mean latency = %MeanLatency@i% ms", " ", "Error rate = %ErrorRate% \\%"];
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 3000;
Color = White;
}
SetParameter(){
Execute = (ErrorRate<=0)||(ErrorRate>=75);
Parameter = "Trial.Message:Target.Duration";
Value = (ErrorRate<=0)? (Trial.Message:Target.Duration-35): (Trial.Message:Target.Duration+35);
}
Feedback(){
Execute = BlockEnd.SetParameter.Execute;
Text = "Response window moved!\nNew window starts at %Trial.Message:Target.Duration% ms";
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 1000;
Color = White;
}
}
Trial( Message:Prime.Text, Message:Target.Text, Related, Word, Message:Sig2.ResponseCode){
FixationMark(){
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 1000;
Color = White;
}
Message:Prime(){
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 35;
Color = White;
}
Message:Mask(){
Text = "xxxxxxxxxx";
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 70;
Color = White;
}
ClearScreen(){
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 500-Trial.Message:Mask.Duration-Trial.Message:Prime.Duration;
}
Message:Sig1(){
Timer = de.pxlab.pxl.TimerCodes.NO_TIMER;
LocationY = -200;
Text = "!";
FontSize = 72;
Color = White;
}
Message:Target(){
Overlay = de.pxlab.pxl.OverlayCodes.JOIN;
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER|de.pxlab.pxl.TimerCodes.START_RESPONSE_TIMER;
Duration = 300;
Color = White;
}
Message:Sig2(){
Overlay = de.pxlab.pxl.OverlayCodes.TRANSPARENT;
Timer = de.pxlab.pxl.TimerCodes.LIMITED_RESPONSE_TIMER|de.pxlab.pxl.TimerCodes.STOP_RESPONSE_TIMER;
Duration = 400;
LocationY = -200;
Text = "!";
FontSize = 72;
Color = Yellow;
// Left button (code=1) translates to index 1 and corresponds to FactorLevel 'word' // Right button (code=3) translates to index 2 and corresponds to FactorLevel 'non-word'
ResponseSet = [0, 1, 3];
}
Message:Sig3(){
Execute = Trial.Message:Sig2.ResponseCode!=de.pxlab.pxl.ResponseCodes.TIME_OUT;
Overlay = de.pxlab.pxl.OverlayCodes.TRANSPARENT;
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 300;
LocationY = -200;
Text = "!";
FontSize = 72;
Color = Green;
}
Feedback(){
ResponseParameter = "Trial.Message:Sig2.ResponseCode";
CorrectCode = Word;
CorrectText = "Correct!\n %ResponseTime@i% ms";
FalseText = (Trial.Message:Sig2.ResponseCode==de.pxlab.pxl.ResponseCodes.TIME_OUT)? "Time out": "Error!\n %ResponseTime@i% ms";
Evaluation = de.pxlab.pxl.EvaluationCodes.COMPARE_CODE;
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 500;
}
IncrementCounter(){
Name = "meanLatency";
Increment = ResponseTime;
}
}
// Command line assignments
AssignmentGroup();
}
Factors(){
CovariateFactor( SubjectGroup, SessionGroup){
FactorLevel( "A", 1);
FactorLevel( "B", 2);
}
IndependentFactor( Related){
FactorLevel( 1);
FactorLevel( 2);
}
IndependentFactor( Word){
FactorLevel( 1);
FactorLevel( 2);
}
DependentFactor( Trial.Feedback.Response);
}
Procedure(){
// Session for SessionGroup A
Session(){
Block( 0, 0){
Trial( "garden", "house", 1, 1, ?);
Trial( "arige", "house", 2, 1, ?);
Trial( "garden", "betle", 1, 2, ?);
Trial( "arige", "betle", 2, 2, ?);
}
Block( 0, 0){
Trial( "table", "chair", 1, 1, ?);
Trial( "huse", "chair", 2, 1, ?);
Trial( "table", "gerben", 1, 2, ?);
Trial( "huse", "gerben", 2, 2, ?);
}
}
// Session for SessionGroup B
Session(){
Block( 0, 0){
Trial( "house", "garden", 1, 1, ?);
Trial( "betle", "garden", 2, 1, ?);
Trial( "house", "arige", 1, 2, ?);
Trial( "betle", "arige", 2, 2, ?);
}
Block( 0, 0){
Trial( "chair", "table", 1, 1, ?);
Trial( "gerben", "table", 2, 1, ?);
Trial( "garden", "huse", 1, 2, ?);
Trial( "gerben", "huse", 2, 2, ?);
}
}
}
}