This is a complicated question that requires a long answer. I can say that from an Islamic standpoint, God knows the answer but is showing the Devil he’s wrong by letting this play out. We are not fated, you have control and free will. God just knows what choices you will make, we won’t surprise Him.