Section 39. A qualified student enrolled in a public secondary school may enroll as a student in Massachusetts public institutions of higher education. The student shall earn both secondary school and college credits. Students may enroll either full time or for individual courses. The board of education in consultation with the board of higher education, shall define which students may qualify for this program, establish criteria for admission, and otherwise administer this program. For the purpose of encouraging the enrollment of nonpublic secondary school students in the system of public institutions of higher education, such students shall be eligible to participate in the program established by this section; provided, however, that the crediting of such attendance for the purpose of receiving a high school diploma shall be in the sole discretion of the nonpublic school.