my guess;
yohan gave the candy to moogyeong to cheer him up, bc he felt guilty of moogyeong's dropping grades. he thought that moogyeong gave candy to yuri is a way of rejecting yohan's feeling
They are pretty stupid tho all this drama and "staying apart" is probably way more distracting for the exams than their previous interactions ever were