Taking Spanish 1 and 2 at school, 3 online, and then 4 at school.

Hi. At my school, I am not able to take Spanish 3 because of scheduling next year. I was wondering if I would be able to take it online, and then take Spanish 4 the next year at school again, even though the online course would not use the same textbook as the class at school would. Do you think I could take Spanish 3 online and then take Spanish 4 at school the following year? I would also study vocabulary from the Spanish 3 course taught at school, but I won’t be able to take the actual class.