It looks like we are learning English, instead of Polish in this course. I would like to learn Polish from Duolingo but looks like there are a lot of barriers. From my opinion, if we use "this afternoon" in this sentence, it should be "I wrote a book this afternoon" or "I will write a book this afternoon." If we use "am writing" in the sentence, it should be "I am writing a book now."
I hope there will be more flexibility in accepting the answers.