:salamext:
The fact that the Qur'an and Sunnah both explain that Allah knows, yet at the same time they explain that you have a freedom of choice - then you have to accept both and strive to do good in order to get good.
Imagine, if you never revise for a test - you'll never pass. So the same way, if you never do good - you'll never fulfill the conditions to enter Paradise.
OK I think we are addressing different questions. As I have just mentioned in my reply to brother Umar, I am not questioning why we need to do good. I am not advocating doing evil and blaming it on fate and predestination. I can vaguely remember the story of the camel, where one Sahabee came to Ali (RA) and complained that he had lost his camel in the desert. When questioned further, the Sahabee confessed that he did not tether the camel when he slept, and the camel wandered off. He put his trust in Allah. Ali (RA) advised that first you tie your camel, then put your trust in Allah! {I apologise if this is an incorrect narration, or not authentic - I heard it when I was fairly young}
If I may use your analogy above:
I was the only person responsible for teaching you in class. At the end of the year, I write the test you describe above. You do not revise - and you fail. That is your fault, and you deserve to fail.
Now lets say you do revise for the test. You work very hard and revise everything I told you to. When you sit the test, you find you can't answer the questions. Now I fail you.
You protest that this is unfair. You worked hard and revised for the test. Unfortunately I wrote a test paper that I KNEW you would fail. Even before you sat the test, I knew you would fail. Is this fair and just?