Notwithstanding any other provision of this code, no school district, city or county board of education, county superintendent of schools, or any officer or employee of such district or board shall be responsible or in any way liable for the conduct or safety of any pupil of the public schools at any time when such pupil is not on school property, unless such district, board, or person has undertaken to provide transportation for such pupil to and from the school premises, has undertaken a school-sponsored activity off the premises of such school, has otherwise specifically assumed such responsibility or liability or has failed to exercise reasonable care under the circumstances.
In the event of such a specific undertaking, the district, board, or person shall be liable or responsible for the conduct or safety of any pupil only while such pupil is or should be under the immediate and direct supervision of an employee of such district or board.