Code: Select all
\documentclass[11pt,twoside]{book}
\usepackage[total={6.25in,10in},left=1.25in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{fancyhdr}
\fancyhf{}
\pagestyle{fancy}
\fancyhead[LE]{\itshape\small\MakeUppercase{\leftmark}}
\fancyhead[RE]{}
\fancyhead[CO,CE]{}
\fancyhead[LO]{}
\fancyhead[RO]{\itshape\small\MakeUppercase{\rightmark}}
\fancyfoot[CE,CO]{\textsc{Student class title}}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[RE,LO]{}
\setlength{\headheight}{14pt}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\pagestyle{plain}
\setcounter{tocdepth}{3}
\tableofcontents
\pagestyle{fancy}
\chapter{First chapter title}
Blabla!
\section{A section title}
Blabla bla!
\newpage
More blabla bla!
\newpage
\section{The last section title}
\newpage
\chapter*{Some problems for the students} % <--- Shown as an unumbered chapter in the ToC
\addcontentsline{toc}{chapter}{Some problems for the students}
Blabla
\newpage
More blablabla!
\newpage
\section*{Answers to problems} % <--- This title should be shown in the header instead of the last numbered section
\addcontentsline{toc}{section}{Answers to problems}
Blablabla
\end{document}