A former Lower Moreland High School teacher was sentenced Friday to 30 days in jail and 60 days of house arrest for having sex with a student.

Erica Ann Ginnetti, 35, was an AP calculus teacher at Lower Moreland High School in 2013 when she had sex with a 17-year-old male student.

Ginnetti cried in court Friday morning as she read a letter of apology, and said she has repaired her relationship with her husband and children and built a new career as a fitness instructor.

Montgomery County Court Judge Garrett D. Page said her remorse did not lessen the seriousness of her crime.

"One bad day because of sexual hunger has resulted in all this avalanche of harm," Page said.

Ginnetti is one of several Philadelphia-area teachers to be charged with or convicted of sexual assault involving students in recent months.

Crimes like Ginnetti's are serious because teachers are role models and parents trust them to care for their children, Assistant District Attorney Sophia Polites said in court on Friday.

"This case is about the trust that we as a society place on teachers, and a betrayal of that trust," Polites said.

Ginnetti approached the student at a school dance and began flirting with him in spring 2013. The two communicated daily, exchanging messages, photos, and videos via cellphone.

"That's candy to a young man," Page told her during the sentencing hearing.

Ginnetti and the teenager had sex in July 2013 in her car, which was at an industrial park along the border of Philadelphia and Lower Moreland.

"I have learned that actions have consequences," Ginnetti told the judge.

She can no longer be a teacher and now teaches fitness classes and volunteers at church. In court, she offered an apology to her former student as "closure to this nightmare."

Ginnetti was fired from her teaching job after her arrest. She pleaded guilty in December to institutional sexual assault - because she was a teacher - and disseminating sexually explicit materials.

The maximum sentence for the two crimes was seven to 14 years in prison.

Her attorney, Marc Neff, asked for house arrest instead of prison so that Ginnetti could be a mother to her three young children. He said she was a gifted math teacher who was passionate about her work. Dozens of letters were submitted to the judge on her behalf.

Ginnetti will also face three years of probation and must register as a sex offender.

Polites said the victim and his family, who were not in the courtroom Friday, faced harassment in their community and on social media. The victim's grades dropped during his senior year of high school, and in a letter to the judge he said he still struggles with social interactions.

"He had a point in his life that was dark" for months after the crime and Ginnetti's arrest, Polites said.

Page complemented Ginnetti's efforts to change her life but said she must spend some time in jail to reflect on what she did.

"Life is not fair," Page said as he announced her sentence.

"I don't believe you're a bad human being," he said. "You did a bad act. So I have to punish you."