RALEIGH, N.C. (WNCN) – A new ranking used 32 metrics to compile a list of the best to worst school systems in the U.S.

WalletHub used quality-related metrics like performance, funding, class size, and instructor credentials to compile its list.

Some safety-related metrics include high school students with access to illegal drugs, high school students not attending due to safety concerns, and the presence of school resource officers.

Massachusetts was ranked No. 1 overall and had the highest math and reading tests scores and tied for first with the highest median ACT score.

Source: WalletHub

North Carolina was ranked No. 33 overall, No. 38 for quality, and No. 28 for safety.

Neighboring Virginia was ranked No. 4 overall while South Carolina was ninth-worst.

Alabama has the lowest dropout rate, 8.30 percent, which is nearly 4 times lower than in the District of Columbia, which had the highest rate at 31.10 percent.