scenario = "ERP_only_eng";

pcl_file = "ERP_only.pcl";
no_logfile = false;

write_codes = true;              
pulse_width= 10;
  
active_buttons = 3;   
button_codes = 1,2,3;
stimulus_properties = description, string, question_string, string, expected_answer, string;
event_code_delimiter = ",";

default_font_size=30;
default_font = "Arial";
default_text_color = 255,255,255;
	
begin;

# Instructions
picture {} default;
picture { text {caption = "+";font_size = 60;};  x=0;y=0;} fix1;
picture { text {caption = "- - -";font_size = 60;};  x=0;y=0;} knipper;
picture { text {caption = "START PRACTICE ROUND \n Press Spacebar to start with the practice round";font_size = 22;};x=0;y=0;} beginexp;  
picture { text {caption = "END OF PRACTICE ROUND \n Press Spacebar to continue";};x=0;y=0;} eindoefen;
picture { text {caption = "START EXPERIMENT \n \n Press Spacebar to start with experiment";font_size = 22;};x=0;y=0;} begintest;
picture { text {caption = "LISTEN CAREFULLY";font_size = 22;};x=0;y=0;} aandacht;
picture { text {caption = "END OF EXPERIMENT \n Thank you for your participation";};x=0;y=0;} eindexp;   


picture { text {caption = " WELCOME and thank you for your participation
\n
Your task in this experiment is as follows: Soon, you will hear English sentences
You only have to listen to these sentences
Sometimes you will see an English word and you will have to choose whether this word was related to the previous audio fragment
You can do this by pressing the left Shift button (Yes) or the right Shift button (No) on the keyboard 
When you see '- - -' on the screen, you can blink 
When indicated you can press Spacebar to go to the next audio fragment
\n 
We shall first start with the practice round
Press Spacebar to continue";font_size = 24;};x=0;y=0;} uitlegval;

#picture text for the breaks
picture { text { caption = " BREAK!
Press Spacebar to continue when you are ready";};x=0;y=0;} pauze1;


# Sound and name definition
sound { wavefile { filename = "";preload = false;} s;} snd;

#Question definition
text { caption = "temp";} questext;

trial {
	trial_duration = forever;
	trial_type = correct_response;
	stimulus_event{
		picture { text questext;x =0;y=0;} question;
		target_button = 2, 3;
	} questionevent;
} questiontrial;

trial {
	trial_duration = 1000;
	trial_type = fixed;
	picture fix1;
} nothingtrial;

# Instructions before start of experiment
trial {
   trial_type = correct_response;
	trial_duration = forever;
   picture uitlegval;
   target_button = 1;
   response_active = true;
}uitlegexp;

trial {
	trial_type = correct_response;
	trial_duration = forever;
	picture beginexp;
	target_button =1;
	response_active = true;
}startpractice;

# End of Practice
trial {
   start_delay = 1000;
	trial_type = correct_response;
	trial_duration = forever;
   picture eindoefen;
   target_button = 1;
   response_active = true;
}endpractice;

# Begin of Testitems
trial {
   trial_type = correct_response;
	trial_duration = forever;
   picture begintest;
   target_button = 1;
   response_active = true;
}starttest;

# End of Testitems
trial {
   start_delay = 1000;
	trial_type = correct_response;
	trial_duration = forever;
   picture eindexp;
   target_button = 1;
   response_active = true;
}endexp;

# Delay after each textbox
trial {
	trial_duration = 1000;
}payattention;

# Main trial definition. Play wav sound and sends markers at the beginning and ending of the critical words
trial {                  
	trial_duration = 1000;
	trial_type = fixed;
   picture fix1;
} fixatiekr;

trial {
   monitor_sounds = true;
   trial_type = fixed;
   trial_duration = stimuli_length;

	stimulus_event {
		picture fix1;
	} fixatiekruis;
	
	#play sound 100ms after start picture, sends out code 'onset' for the beginning of the sentence
	stimulus_event {
		sound snd;
		time = 100;
		code = "onsetwav";							 
	} wavevent;
	
	#critical marker1	only onset
	stimulus_event {
		nothing {};
		deltat = 0;
		code = "onsetcw1";
   } eventlab1;

	#critical marker2	 verb onset	
   stimulus_event {
		nothing {};
		deltat = 0;
		code = "onsetcw2";
	} eventlab2;

	#critical marker3	the onset
	stimulus_event {
		nothing {};
		deltat = 0;
		code = "onsetcw3";
   } eventlab3;

	#critical marker4	object onset	
   stimulus_event {
		nothing {};
		deltat = 0;
		code = "onsetcw4";
	} eventlab4;
} playsent;

# Moment to blink
trial {
	trial_duration = 2000;           
	trial_type = fixed;
	picture knipper;                   
	stimulus_event {
		picture knipper;
		target_button = 1;
		code = "knipper";
	} eventblok;
}blink;

trial {
	trial_duration = forever;           
	trial_type = correct_response;
	picture { text {caption = "Press Spacebar to continue";font_size = 22;};x=0;y=0;} hervatexp;                    
	target_button = 1;
	response_active = true;
}startnapauze;

# Break
/* 
Total: 382 trials (240 exp, 142 fillers)
Every 5 minutes small self-pased break: 17 - 34 - 51 - 68 - 85 - 102 - 118 - 136 - 153 - 170 - 187 - 204 - 221 - 238 - 255 - 272 - 289 - 306 - 323 - 340 - 357 - 374 
Every 15 minutes 2 minutes forced break: 51 - 102 - 153 - 204 - 255 - 306 - 357 
*/

trial {
   trial_duration = forever;
	trial_type = first_response;
	picture pauze1;
	target_button = 1;
	response_active = true;
} smallbreak; 

trial {
   trial_duration = 120000; #2 minutes
	trial_type = fixed;
	picture { bitmap { filename = ""; preload = false; } breakpic; x=0; y =0; };
} forcedbreak; 
