The state's public education system was ranked second best in a national evaluation released yesterday by WalletHub

Massachusetts took the No. 1 spot in the study, earning a 78.16 overall score. New Jersey came in second with a 66.92 total score, followed by New Hampshire at 64.65.  

In order to determine the best and worst states for public-school education, WalletHub’s analysts compared the 50 states and the District of Columbia across two key dimensions including quality and safety.

Sign Up for E-News

Statisticians evaluated quality dimensions using 21 metrics that included test scores, graduation rates, Advanced Placement availability and achievement, and pupil-to-teacher ratios. Quality counted for 60 percent of a state's score.

Safety was measured using statistics that indicated campus assaults, the use of drugs, reported incidents of violence, students bringing weapons to school, bullying rate, and youth incarceration.  In the area of safety, New Jersey ranked No. 15.

New Jersey also ranked in the top 5 states cited for having the lowest dropout rate, the highest math and reading scores, and the lowest pupil/teacher ratios.  New Jersey was not near the bottom of any test indicators, according to the report.

The report was based on data from a variety of federal agencies, including the National Center for Educational Statistics, U.S. Census Bureau and the Office of Juvenile Justice and Delinquency Prevention.

In a separate study by MarketHub, New Jersey ranked No. 1 as the "Best State for Teachers" in the United States.