How to measure and quantify concentration or focus?
Short answer
Attention can be quantified with a sustained attention to response task.

Background
I think with focus or concentration you mean sustained attention to a certain task. A sustained attention to response task (SART) (Silverstein &amp; Palumbo, 1998) could be helpful to you (here is a free PsychoPy script). SART seems to be a reliable measure for attention (Smilek et al., 2010). 

Basically SART consists of a set of stimuli (e.g., simple shapes) and the subject is asked to repeatedly give a response (e.g. a button press) when a certain event occurs (e.g. a shape changes color). Reductions in correct rates, increased lapse rates, and/or decreased reaction times all may signal reduced attention to the task. 

Admittedly I am not too familiar with these tests, but I do have a lot of experience with people loosing attention during tedious psychophysical tasks :) I hope the links and references provided here may be of further help.

References
- Silverstein &amp; Palumbo, Computers in Human Behavior (1998); 14(3): 463-75
- Smilek et al., Neuropsychologia (2010); 48(9): 2564-70