In one of your responses to an earlier question you wrote:
“God is testing man, by giving him free will to choose between right and wrong. It does not matter, if the results are already known to the Almighty or not. The thing that matters is that whether or not man is free to do right, if he chooses to, or not. According to the Qur’an, God put man in this test, because man himself chose to be tested. God gave man the choice to accept this test or turn down the offer.”
The matter of fact is that it is God who put the man in this test i.e. He must have known that man would submit. It is true that God is Omniscient. He already knows the future because of his infinite knowledge. He also knows that who will go to heaven and who to hell even out of those who are not yet born.
Then the question arises is:
What is the pleasure or joy in looking at something (i.e. creating earth and testing humans) that you already know and it has no significance in comparison to your infinite knowledge?
Because of our limited knowledge, we can only understand that, which God has informed us. We are neither in a position to understand all aspects of God’s decisions nor every aspect of the wisdom entailed in His actions.
What we do know, with reference to your comments, is that each human soul that has been put in the test during the life of this world has been granted a comparative potential as well as the freedom to do right as well as wrong in this test. Thus, it is man’s own choices that shall play the decisive role in man’s ultimate destiny, not God’s pre-existing knowledge of these choices.
God’s omniscience does not restrict man’s freedom, just as His omniscience does not restrict His own freedom.
I hope this helps.