Two students from separate middle schools have been charged with making written threats to kill or conduct a mass shooting.