NORTHBROOK, Ill. – An Illinois high-schooler who sued his school after he was expelled for attempting to hack into the teacher grading system was sent back to class by a judge this month.

Court records show the Glenbrook High School sophomore attempted to use a teacher’s user name and password stolen by another student to sign into the teacher grading system.

MORE NEWS: Know These Before Moving From Cyprus To The UK

According to the Chicago Tribune:

The plot was engineered by another student, who created a fake email address that appeared to be from PowerSchool, where students’ grades are electronically recorded.

According to the lawsuit and a report from the district hearing officer, the student who created the fake email sent it to several teachers and asked them to use a provided link to log in. The login page was also fake but allowed the student to capture the passwords of teachers who fell for the scheme, and two of them did, according to the lawsuit and the report.

That student told investigators he was able to “view students grades and edit them,” the hearing officer’s report said.

The student who sued the district with the help of an adult relative claims to have only attempted unsuccessfully to gain access to the grading system.

The lawsuit claims that the other student shared a teacher’s stolen password with the complainant and that he used it to try to gain entry to the grading system but failed. The student also admitted in the lawsuit that he sent emails to two teachers that included the link to the fake website created by his classmate.

The district initially suspended the student for 10 days, then expelled him through the end of the 2017-18 school year to “send a message” about the hacking, the Tribune reports.

“If the teachers’ grades were subject to attack and could be surreptitiously changed, the entire school district would lack credibility,” according to the discipline report.

The 15-year-old’s attorney argues that state law requires schools to consider less severe punishments before resorting to expulsion, and that did not happen. The lawsuit points out that the grade changing scheme did not cause a disruption to the learning process and the student who filed the lawsuit has no history of disciplinary problems.

MORE NEWS: How to prepare for face-to-face classes

Cook County Circuit Judge Thomas Allen seemed to agree that the case has merit, and granted a request to return the student to school “until further order of court.”

The student was allowed to return to class on May 8, and is now scheduled for a fresh court hearing on the matter in August.