Here's a way using only one file, besides the list of students. In the example I used the filecontents*
environment to make it self-contained.
\begin{filecontents*}{students.lst}
Sam Student
John Doe
Bat Man
\end{filecontents*}
\documentclass{article}
\usepackage{xparse,environ}
\ExplSyntaxOn
\NewDocumentCommand{\printexamtext}{m}
{
\ior_open:Nn \g_mappi_student_list_stream { #1 }
\ior_map_inline:Nn \g_mappi_student_list_stream
{
\tl_set:Nn \studentname {##1}
\mappi_print_exam:
}
}
\ior_new:N \g_mappi_student_list_stream
\cs_new_protected:Npn \mappi_print_exam:
{
\clearpage
\setcounter{page}{1}
\ExamHeader
\BODY
\ExamFooter
}
\ExplSyntaxOff
\NewEnviron{ExamText}[1]{%
\printexamtext{#1}%
}
\newcommand{\ExamHeader}{%
\begin{center}
\LARGE Linear Algebra -- 2014 -- Fall Session \\[2ex]
\large \studentname
\end{center}
\vspace{2cm}
}
\newcommand{\ExamFooter}{%
\vfill
\hrule
\vspace{2ex}
\noindent Please, answer all questions\par
}
\begin{document}
\begin{ExamText}{students.lst}
\noindent\textbf{Exercise 1}
Compute the rank of a matrix of your choice.
\bigskip
\noindent\textbf{Exercise 2}
What are the eigenvalues of the identity matrix?
\bigskip
\noindent\textbf{Exercise 3}
Prove that the zero matrix is not invertible.
\end{ExamText}
\end{document}
The ExamText
environment contains the questions, type it as if it were a normal document. I split up the header and footer to have them in a separate place (for code reusing).

xparse
is not really necessary, it just makes it easier to loop through an external file.