The attorney general on application shall give an opinion, in writing, to county, city, town, public pension fund attorneys, or the attorneys for the board of a school district or unorganized territory on questions of public importance; and on application of the commissioner of education shall give an opinion, in writing, upon any question arising under the laws relating to public schools. On all school matters such opinion shall be decisive until the question involved shall be decided otherwise by a court of competent jurisdiction.