أَكْرَمَ الْمُعَلِّمُ الطَّالِبَ — The teacher honored the student.
أَكْرَمَ الطَّالِبَ الْمُعَلِّمُ — The student was the one the teacher honored.
الْمُعَلِّمُ remains nominative subject in both; الطَّالِبَ remains accusative object.
This is a fresh practice pair, not the book’s wording. With visible case endings, word order can vary without changing syntactic roles.