The number of students would not change between before the test and after the test. 3+8 and 4+7 both = 11 so finding out how many students would equal one ratio can then be used to find how many equal 3 and 8.
If 92 students are equal to 4 in the ratio, then 1 in the ratio is worth 23 students. This is important as then when you times 23 by 7 you find out how many students there are in the regular maths class, 161 students. Plussing these two together gives you a total of 253 students.
Using this 253 you can divide it by 11 to find out how much 1 number would be in the ratio, it equals 23. Using this you can then times 23 by both 3 and 8 to find the original class sizes, 3x23 = 69, and 23x8 = 184.
Making the origional class size of the advaced class 69 studnets, and the regular maths class size 184.