the class is on a field trip in the mountains hiking with their teacher.
The class was sitting in school taking a test.
Sitting in school taking a test is not something you do in the mountains while hiking.
(-x)
(-x)