DAVENPORT, Ia. — Kaitlyn MacDonald had just finished taking attendance, she testified on Friday, when Luke Andrews entered the classroom, slammed a green folder and a Chromebook case on a table and pulled out a gun.

Andrews, then 12, pointed the gun at MacDonald, a student teacher, and said he wanted everyone on the ground, she said.

Only some students noticed what was happening, she said, and she tried to get the attention of Dawn Spring, the social studies teacher in the room.

“Miss Spring! Miss Spring!” she called.

“In my head, I figured, if he were to start shooting and we were to protect the students, I wanted her to be facing it,” MacDonald told jurors. “I didn’t want her to get shot (from) behind and not know what had happened.”

Four witnesses testified in a Scott County courtroom Friday morning, all recollecting their interactions with Andrews, now 13, on and before the day he brought a gun to North Scott Junior High in Eldridge last Aug. 31. The Davenport boy is being tried as a youthful offender in adult court on charges of attempted murder, assault while displaying a dangerous weapon and carrying weapons on school grounds.

On Thursday, a school counselor described how she and Spring wrestled the gun from Andrews outside her office.

Friday morning, Spring took the witness stand. She testified that once MacDonald got her attention in the classroom, Andrews was holding the gun in the direction of other students.

Spring said she walked toward Andrews, "in hopes to distract him from the students," and said, "something to the effect of, 'Oh man, it looks like you're having a really bad day.'"

Andrews walked toward Spring, and they faced each other near the front of the class, about 3 or 4 feet apart, Spring said.

"As he approaches me and we come face to face, he says nothing. I say nothing. He puts the gun up at face level and pulls the trigger," Spring said. "I thought I heard an audible click from the gun, and then he turned the gun and kind of looked at it funny, like, 'that's weird,' kind of a look at it, then he put it up in my face a second time."

She batted the gun away from her face with her hand at least twice more, she said.

"At that point, I said, 'Oh, you're really upset. Let's go out in the hallway to talk,'" Spring testified. "And thank goodness, he cooperated and we both walked out into the hall."

More:School employees describe tense minutes in hallway after boy pulled out gun in class

MacDonald emotionally described what was going through her mind during the ordeal. She said she was "fully expecting to have to dive in front of students," if Andrews started shooting.

Through tears, she told jurors she "had a moment where I accepted the fact that I was going to die. So I thought about how I was never going to have my own classroom. ... I guess I was just thinking I was never going to be a wife, be a mom."

Anxious moments in classroom after Andrews left

On Thursday, witnesses described a chaotic scene in the hallway once Andrews and Spring left the room together.

But inside the classroom, MacDonald said, students were frozen in fear.

The former student teacher said she instructed students to line up against the side wall while she held the door shut, unsure of what would happen in the hallway. Another teacher with a key helped her lock the door, she said.

Several seventh-graders were crying, and some had anxiety attacks, MacDonald testified.

She said she saw one student repeatedly making the sign of the cross.

"It's nothing I would ever want anyone to experience," she said.

Emails, searches found on computers

Joshua Tipsword, a network specialist for the North Scott school district, said he was tasked with reviewing Andrews' use of his Chromebook, a district-owned laptop that students, starting in seventh grade, use for assignments and get to take home during the school year.

Students have Google accounts to send school-related emails and complete projects, he explained to jurors.

Jurors saw a comment from Andrews on a classmate's online presentation the day before the incident that said: "10/10 there is a surprise tomorrow."

He also sent emails to two students that read, "I have a gun you will see soon," the documents showed.

Andrews sent emails to classmates in the days before the incident that included cartoon images depicting self-inflicted violence, Tipsword testified. Many of the emails were sent between 1 a.m. and 4 a.m. and did not receive responses.

Davenport Police Cpl.​​​​ Richard Nahnybida, a forensic computer examiner, said he analyzed data collected from a desktop computer in Andrews' home.

Referencing the police report he created, Nahnybida said he found two Google searches — "how do guns work" and "where is a pistol's safety" — from the night of Aug. 30, he said. Other searches about video games were made the same day.

The evidence portion of the trial is expected to end Monday, with jurors hearing closing arguments on Tuesday, Chief Judge Marlita Greve said Friday. If convicted, Andrews would be under the jurisdiction of Iowa's juvenile justice system until he turns 18.

His father, Joseph Andrews III, was charged with control of a firearm by a felon on Aug. 31, the same day his son brought the gun to school. Authorities found guns in the elder Andrews' bedroom, court records show. He is scheduled to go on trial in October.

More:Trial begins for Iowa middle-schooler accused of attempting to shoot his teacher in front of classmates

Shelby Fleig covers news and features for the Register. She can be reached at shelbyfleig@dmreg.com and 515-214-8933.

Your subscription makes work like this possible. Subscribe today at DesMoinesRegister.com/Deal.