Look at this is like this: the present situation (the state of not knowing what the homework is) is the result of the lack of a past action (not listening), so by focusing on the past action the speaker is identifying the cause of the problem.
Applying it to the second dialogue example: present situation (state of not knowing what to do with the problem) is the result of the lack of a past action (encountering this problem). Does it mean past tense should go here as well?
Student A: Do you know what to do?
Student B: No, I
haven't encountered/didn't encounter such a problem
I would like to know when to use each tense when a specific time is not given by any time expression or when clause. If they are specified (eg. when I was a boy, last week, three days ago, when I was driving home) it's pretty straightforward to me that we're talking about a specific moment in the past.
Student A: Do you know what the homework is?
Student B: Yes, I
wrote down/was writing down every single detail. (writing down must have taken place during last class and this is a specific time understood for both speakers, even if not given explicitly - that's why we use
past tense. Even if we want to convey the message "I have all the notes needed", present perfect does not fit here due to the specific time)
Student A: Do you know what the homework is?
Student B: Yes, I
have received an e-mail with the notes from Jack. (the person we're talking to doesn't know the time I received the e-mail - and I can use
present perfect here to convey the message "I have all the notes needed").
I know it's quite chaotic, but I would be so thankful for any hints on how to choose from these two tenses. Especially when the time of an event is not directly given.