A Pennsylvania high school is apologizing after students were given a math homework assignment that asked which family member had sexually assaulted a girl.

The assignment focused on Maya Angelou and her autobiography “I Know Why the Caged Bird Sings.” It provided an algebra formula that asked: “Angelou was sexually abused by her mother’s — at age 8, which shaped her career choices and motivation for writing.” Pennridge High School students needed to solve the formula before deciding whether the answer was boyfriend, brother or father.

Screenshots of the homework posted by news organizations showed the subsequent question reads: “Trying to support her son as a single mother, she worked as a pimp, prostitute and —.” Another formula must be solved to determine if the answer was bookie, drug dealer or nightclub dancer.

READ MORE: ‘Math is challenging’: Calgary Mayor Nenshi and MP Michelle Rempel engage in Twitter spat

The homework was coupled with a word puzzle about the book and author, The Intelligencer newspaper reported Friday.

Story continues below advertisement

The assignment was from a website that allows teachers around the world to share resources.

“We apologize to anyone who was offended by the content of the assignment and have taken steps to avoid such occurrences in the future,” Pennridge Superintendent Jacqueline Rattigan said in a statement, adding the district had received complaints. Tweet This

A similar homework assignment caused controversy in Fort Myers, Florida, in 2015. In that case, a middle school teacher also downloaded the algebra homework from an external website. The district said the veteran teacher didn’t carefully examine the homework and called it an oversight that wouldn’t be repeated.

“I Know Why the Caged Bird Sings,” published in 1969, is assigned reading in many high schools, but is also occasionally attacked for its content.

Angelou’s passages about her rape and teen pregnancy have made it a perennial on the American Library Association’s list of works that draw complaints from parents and educators.

“‘I thought that it was a mild book. There’s no profanity,” Angelou, who died in 2014, told The Associated Press. “It speaks about surviving, and it really doesn’t make ogres of many people. I was shocked to find there were people who really wanted it banned, and I still believe people who are against the book have never read the book.”