Twelve people have been injured in the fourth violent attack in Germany in a week after a failed Syrian asylum seeker set off a bomb in Ansbach.