It is a bit like the normal use, but in terms of time.
This = comparison to something now (close).
That = comparison to something before. (far away)
''I can't do this question. Is the real test THIS difficult?'' (as difficult as this question now?)
''Only 3 out of 50 people passed last time. The test is THAT difficult!!'' (as difficult as that previous event shows.)
Here, ''this'' and ''that'' are used as intensifiers, like ''very'' or ''extremely''.
So the test is ''very'' difficult.