(a) Every person offered as a witness, before any testimony shall be given by him, shall be duly sworn that the evidence he shall give relating to the matter between , plaintiff, and , defendant, shall be the truth, the whole truth, and nothing but the truth.
(b) If a witness, on being produced, shall be objected to as incompetent, or his testimony, when offered, shall be objected to as irrelevant, the objections shall be heard and determined by the justice.