5. Let the quadratic function $f(x)=a x^{2}+b x+c$ (where $a, b, c$ are integers), and 4 students calculate the function values. Student A gets: $f(7)=$ -1; Student B gets: $f(1)=3$; Student C gets: $f(4)=-4$; Student D gets: $f(2)=4$. Among them, only 1 student made a mistake, then the student who made the mistake is ( ).
(A) A
(B) B
(C) C
(D) D
5.B.

Since $f(m)-f(n)=(m-n)(a m+a n+b)$, then $(m-n) \mid(f(m)-f(n))$.
Verification: $(7-1) \mid(-1-3),(7-4) \mid(-1+4)$,
$$
\begin{array}{l}
(7-2) \mid(-1-4),(1-4) \mid(3+4), \\
(1-2) \mid(3-4),(4-2) \mid(-4-4) .
\end{array}
$$

Therefore, B made a calculation error.