McAllan urges schools to act ahead of new legislation on mobiles in class