Experiment(){
Context(){
AssignmentGroup(){
ExperimentName = "Response Key Codes";
SubjectCode = "pxlab";
TrialFactor = 100;
}
Session(){
Instruction(){
Text = ["Echo Response Key Codes", " ", "Press any response key and the program will tell you its code.", "Press the ESC-key to stop the \'experiment\'.", " ", "Press any key now to start!"];
}
}
Trial( TrialCounter, Message.ResponseCode){
Message(){
Text = "Type any response key!";
Timer = de.pxlab.pxl.TimerCodes.RESPONSE_TIMER;
}
Feedback(){
Text = "ResponseCode = %Trial.Message.ResponseCode@i%";
Timer = de.pxlab.pxl.TimerCodes.CLOCK_TIMER;
Duration = 1000;
}
/* Note that BlockState modifications are only valid if they are done in a Trial */
SetParameter(){
Parameter = "BlockState";
Value = (Trial.Message.ResponseCode==de.pxlab.pxl.KeyCodes.ESCAPE_KEY)? de.pxlab.pxl.StateCodes.BREAK: de.pxlab.pxl.StateCodes.EXECUTE;
}
}
// Command line assignments
AssignmentGroup();
}
Procedure(){
Session(){
Block(){
Trial( ?, ?);
}
}
}
}