When considering this answer, please note that just because something is a grammatical English sentence, that doesn't mean it counts as a correct answer to a question on an exam. It all depends on what the question actually asked and on any 'ground rules' that the teacher may have set up.
Having said all that, there is nothing wrong with your sentence as an English sentence. It is fine both as far as formal grammar and as far as rules of good writing. As far as the latter, I'm not saying that the sentence couldn't be improved. However, I am saying that any modification in order to improve it would be a matter of personal preference and style, not of grammar.
If your teacher is really saying that, as a matter of grammar, which must immediately follow the word it refers to, then your teacher is indeed mistaken, in several respects. First of all, the antecedent of which need not be a single word at all; it may be a whole noun phrase (NP) or a whole nonfinite clause (the latter, in fact, is the case in your sentence). Second, the reason why people sometimes say such things is to help novices avoid writing confusing and ambiguous sentences. The actual rule (of good writing) is that it should be clear to the reader what it is that which refers to. If it is clear, then there is no problem.
Here is a relevant passage from CGEL (p. 1035). Note that, in CGEL's terminology, your relative clause (which forces the learner to concentrate) is a supplementary relative clause:
The supplementary relative is also distinguished from the integrated relative in that it permits a much wider range of antecedents, as is evident from such examples as:
 i Pat is afraid of snakes, which I'm sure Kim is too. [AdjP]
ii Pat is afraid of snakes, which doesn't surprise me at all. [clause]
The antecedents for which here are an AdjP [adjective phrase) in [i] and a whole clause in [ii], the relative clauses being interpreted as "I'm sure Kim is afraid of snakes too" and "That Pat is afraid of snakes doesn't surprise me at all". The antecedent can indeed be a piece of text syntactically unconnected to the relative, as when a lecturer finishes one topic and then moves on to the next with the supplementary relative Which brings me to my next point.
Here are more examples from published literature:
So far no such reaction has been found, which may be due simply to... (source)
(Speaking of circumcision:) In general both Greeks and Romans found the custom repulsive and ridiculous, which led to tensions especially with Jews. (source)
Change takes a long time to sink in here, which is also why, whenever I identified myself as the writer come to write about the village and La Récréation, they looked momentarily puzzled. (source)
Illumined and elevated by his grace and favor, they adored what they saw in him, which they did not previously see because of their blindness and lowliness. (source)
Abigail also regularly wrote personal letters, which was her method of staying in touch with friends. (source; note that it is which was and not which were. Therefore, which doesn't refer to letters, which would require the plural were, but to 'regularly writing personal letters', which takes singular agreement.)