Am i wrong for talking back?

Hi, im a SHS graduating student. And i just wanna rant my feelings here cause super double sided ng feelings ko rn?? so here’s what happened. I’m living with my parents pa since i’m still in shs, and i was doing schoolworks for the whole day since tinadtad tlga kami ng teachers nmin ng works. 10pm came and pinapatulog na ako nila daddy since maaga pa pasok ko tmrw but i said i’m doing schoolworks pa since ung ginagawa ko is pasahan tomorrow. Then 5min they called me out again to sleep but then i said wait lg since i’m not done with my schoolworks pa nun. then after like 2 more of that, nagalit na si mommy and kinuha niya ung hanger para h4mpasin ako since kanina pa raw ako wait nang wait (they know im a slow learner and i’m trying my best to finish as fast as i can kanina) then habang hin4h4mpas niya prin ako habang nagsasabi ng mga salitang masasakit, i suddenly just snapped and talked back to her since i wanted to defend myself so much and i just had enough. But she got angrier and started spanking me more even on my face. There’s a part of me that believed i did the right thing and there’s a part of me which believes i should’ve just stayed quiet. I need advice.