Note: Throughout this answer, the sentence presented below a blockquoted bit represents one way how the blockquoted sentence may be understood. These understandings are in no way exclusive, but where contrasted to a second form, it is much more likely that they appear following the form they follow rather than the other one.
German does not have a method of understanding words in a perfective or imperfective sense per se. The English past tenses can be used to show such an aspect:
In German, the past tenses are synonymous and cannot be used to express that distinction. Both the following can be understood in either way:
Ich lernte Deutsch in der Schule.
Context needed.
Ich habe Deutsch in der Schule gelernt.
Context needed.
It is entirely dependent on context whether the sentence is made to mean the first English version or the second.
However, sometimes you can help yourself by switching the verb used. In this case, the similar verb erlernen can be used to express the second version unambiguously:
The only semi-unambiguous way to say ‘I only learnt a little’ would be to add extra words such as nur:
Ich lernte Deutsch nur in der Schule.
You probably forgot, didn’t you?
Ich habe Deutsch nur in der Schule gelernt.
You probably forgot, didn’t you?