When any pupils shall attend any agricultural high school or junior college under the provisions of Section 37-27-51, such pupils shall be reported and accounted for the allocation of minimum education program funds and building funds just as though such pupils were attending the regular schools of the district in which they reside. For this purpose reports shall be made to the board of trustees of the school district involved by the agricultural high school or junior college of the number of children in average daily attendance, and the average daily attendance of such pupils shall thereupon be included in reports made to the county or school district under the provisions of Chapters 19 and 47 of this title. The allocation of minimum education program funds and state public school building funds shall be made for such children just as though such children were attending the regular schools of the district. However, all minimum education program funds which accrue to any district as a result of the pupils who are in attendance at such agricultural high school or junior college, except amounts allotted for transportation purposes, shall be paid by the board of trustees of the municipal separate school district or the county board of education, as the case may be, to the agricultural high school or junior college at which the pupils are in attendance, and shall be expended by said agricultural high school or junior college for the instruction of said pupils and for the purposes for which the funds were originally allotted. Funds allotted to the school district for building purposes under Chapter 47 of this title, shall, however, be retained by the school district entitled thereto. The term “school district” as used in Sections 37-27-51 through 37-27-59 shall be defined as including all public school districts in this state and also all agricultural high schools not located on the campus of a junior college.