In Bavarian grammar schools, large written tests must be announced at least a week in advance, and so must short tests. There is one exception, the Stegreifaufgabe. Stegreifaufgaben werden nicht angekündigt, beziehen sich auf höchstens zwei unmittelbar vorangegangene Unterrichtsstunden.
They are not announced, and they may cover at most the two lessons immediately before. The name comes from aus dem Stegreif, from the stirrup. The dictionary DWDS explains it as originally without getting off the horse, that is, without preparation.