The right not to incriminate yourself is a basic civil right. The Fifth Amendment is a codification of the right, which was given to you, as our Founding Fathers saw it, by the laws of nature. The Amendment may refer only to some circumstances, but the right was prior to it.
So, the teacher was correct to treat the students about their basic, God-given rights.
Perhaps metaphorical, does it matter? Some people talk of God, others use it as a figure of speech. The meaning is largely the same, in this particular case.
So, the teacher was correct to treat the students about their basic, God-given rights.