Context Word: procedure. 
Question: PersonX was able to listen to the teacher to learn the procedure while PersonY was looking out the window, as _ was attentive. 
Answer: PersonX
PersonX was able to listen to the teacher to learn the procedure while PersonY was looking out the window, as _ was distracted.