God did not ordain everything that has happened to us. Some of it happened because we did not listen to him, to his Spirit, or his direction. We determined to go our own way and would not listen to Him. He does allow that even when He knows we are setting ourselves up for hurt.
Some of the stuff happened because there is evil in the world. God did not direct that person to rape you or murder your mother just to teach you something. What that person did was sin, and God cannot be tempted with sin, neither does he tempt others to sin (James 1:13). However, God will use even the hard things in our lives for good if we let Him–and often even when we fight Him all the way. We shouldn’t contuse the two.