Avila was shot through the glass and dropped to the floor, Daniel told ABC News, but she still told her students to stay quiet and said she was playing dead. A student in the class was also injured when the gunman shot through the door.
Daniel said he hid under a table next to a wall with some classmates. Daniel and his terrified peers stayed quiet, listening to the gunshots and the gunman banging on the neighboring door.
"I personally can't thank my son's teacher enough," Daniel's mother, Briana Ruiz, told ABC News. "I think what she did saved all of their lives."
MORE: What we know about 21 Texas school shooting victims; teacher's widower dies of heart attack
Though Daniel survived, he lost his beloved cousin, Ellie Garcia, who was in a neighboring classroom and among the 19 children slain in the massacre.
"I was worried a lot for her because I didn't hear any screaming from the class," he said.
Although her son is enduring mental trauma from the massacre, Ruiz said the 9-year-old insisted on speaking to journalists to take the focus off the gunman and shine it on the victims.
"That's why I agreed to let him do this. If he feels like it's going to help him, I'm OK with it, because I do want him to recover," she said.
MORE: Uvalde grieves, says goodbyes at visitations, funerals amid investigation
Since the shooting, Ruiz said her son hasn't wanted to go into his bedroom and has stopped playing video games.
"When I ask him why he doesn't want to play, he says, 'I don't want to hear gun shots.' We're not watching cable -- any mention of shooting does trigger him," she said. "That's something they're gonna have to live with forever and it's going to be hard."
SEE ALSO: Video appears to show Texas 911 dispatchers relaying info from kids in Robb Elementary classroom
Ruiz said the gunman was a former student of hers, when she was a teaching assistant.
As for Daniel's feelings about the gunman: "I feel mad at him. I play football with a lot of those guys and they didn't make it out."
Since 2017, mass shootings in the United States -- described as shooting incidents in which at least four people are injured or killed -- have nearly doubled year over year. Already, there have been 212 mass shooting incidents in 2022 -- a 50% increase from 141 shootings in May 2017. The graphic above shows the number of shooting incidents per state. Mobile users: Click here to see our map of mass shootings in the US from the last five years
The number of people injured or killed does not include the suspect or perpetrator. These graphics show the number of victims across all mass shootings from the last five years.
ABC News' Marcus Moore contributed to this report.