It was, as always is, a little bit difficult to find and understand what another person changed in the cls file.
Personally, I find unacceptable ask students to use a given class file, but also ask them to change something. When I provide a cls file, it is my obligation to provide a class file that students don't need to edit in order to achieve a request I also ask them to do.
To make things simple, I will present your contents separatedly.
thesis.tex
This is your main file, you should add your contents here, preferably using \include and/or \input. I replaced your packages into another file, since I didn't need to edit them. The file input_titletoc will be discussed in the last section, it contains the commands to format your table of contents as you want.
\documentclass[b5paper,twoside,openany,tocchapterhead,10pt]{TheClass}
\input{input_packages}
\input{input_titletoc}
\begin{document}
\addcontentsline{toc}{chapter}{\textbf{ABSTRACT}}
\addcontentsline{toc}{chapter}{\textbf{ACKNOWLEDGEMENTS}}
\tableofcontents
\listoftables
\listoffigures
\addcontentsline{toc}{chapter}{\textbf{LIST OF ALGORITHMS}}
\mainmatter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{my first chapter}
\section{my first section}
\section{my second section}
\subsection{my first subsection}
\subsection{my second subsection}
\subsubsection{my first subsubsection}
\subsubsection{my second subsubsection}
\section{my third section}
\begin{table}
\caption{mytable}
\end{table}
\begin{table}
\caption{mytable}
\end{table}
\begin{table}
\caption{mytable}
\end{table}
\chapter{my second chapter}
\section{my first section}
\section{my second section}
\subsection{my first subsection}
\subsection{my second subsection}
\subsubsection{my first subsubsection}
\subsubsection{my second subsubsection}
\section{my third section}
\begin{figure}
\caption{myfigure}
\end{figure}
\begin{figure}
\caption{myfigure}
\end{figure}
\begin{figure}
\caption{myfigure}
\end{figure}
\renewcommand\appendixname{APPENDICES}
\appendix
\chapter{my appendice}
\section{my first section}
\section{my second section}
\subsection{my first subsection}
\subsection{my second subsection}
\subsubsection{my first subsubsection}
\subsubsection{my second subsubsection}
\section{my third section}
\chapter{my appendice}
\section{my first section}
\section{my second section}
\subsection{my first subsection}
\subsection{my second subsection}
\subsubsection{my first subsubsection}
\subsubsection{my second subsubsection}
\section{my third section}
\end{document}
TheClass.cls
As this file a 200+ lines long and you provided it through a link, I will inform only where you need to update.
At line 160, change update the command iftocflag with the following lines:
\iftocflag
\let\old@chapter = \@chapter
\def\@chapter[#1]#2{
\ifnum\c@chapter=0%
\addtocontents{toc}{\protect\contentsline{part}%
{\hspace{15pt}\normalsize\etchapterheadstyle{\@chapapp}}{}\\
}
\fi%
\old@chapter[#1]{#2}
}
\fi
Instruction ifnum\c@chapter=0 is responsable for writing CHAPTER above the chapters numbers and only before chapters, \hspace{15pt} corrects its displacement horizontally.
Personal note: At lines 227--235, there are a few \newtheorems. I would not define them inside a class file, but in a style file. But this kind of implemetation is more a preference than a rule.
input_packages.tex
I just separated your packages into a file. They don't interfere with your main question.
I think the package geometry is useless. Your class is constructed over the report class and load b5paper. I compiled your file without geometry and it didn't change a thing, but I can say for sure because there might be something hidden which I didn't identify.
\usepackage{titlesec}
\usepackage[english]{babel}
\usepackage{geometry}
\usepackage{tikz}
\usepackage[font=bf]{caption}
\usepackage{array}
\usepackage{booktabs}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0.25pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0.0cm}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\titleformat{\section}
{\normalfont\fontsize{10}{15}\rmfamily\bfseries}
{\thesection}
{1em}
{}
\titleformat{\subsection}
{\normalfont\fontsize{10}{15} \rmfamily\bfseries}
{\thesubsection}
{1em}
{}
\titleformat{\subsubsection}
{\normalfont\fontsize{10}{15}\rmfamily\bfseries}
{\thesubsubsection}
{1em}
{}
\addto\captionsenglish{
\renewcommand{\contentsname}{\bfseries Table of Contents}%
}
\setlength{\parskip}{1\baselineskip}
input_titletoc.tex
The main file to edit the apperance of your table of contents. My answer uses code from How can I edit the table of contents? based on CTAN titletoc and from List of Figures/Tables - eliminate dots? -- actually your have already used it to remove dots in list of tables and figures.
Each \titlecontents{...} formats an object. I edited numbers in order to align the contents as in our example. Line {\contentslabel[\thecontentslabel]{3.0em}\textsc} is responsable for changing the appearence of your chapters' name.
Suggestion: This file with the instructions with titletoc could be inside the class file (.cls) or in a style file (.sty). To learn more about it, please check Style/class tutorials and Writing your own package.
\usepackage{titletoc}
% Remove dots in list of tables and figures
\makeatletter \renewcommand{@dotsep}{10000} \makeatother
\titlecontents{chapter}
[7.0em] %5.3
{\bigskip}
{\contentslabel[\thecontentslabel]{3.0em}\textsc}
{\hspace{-5.5em}\textbf}% unnumbered chapters
{\titlerule[1pc]{ }\contentspage}[\smallskip]%
\titlecontents{section}
[7.0em] % i
{\smallskip}
{\thecontentslabel\enspace}%\thecontentslabel
{\hspace{-5.5em}}
{\titlerule[1pc]{ }\contentspage}%]
\titlecontents{subsection}
[9.0em] %
{\smallskip}
{\thecontentslabel\enspace}%\thecontentslabel
{\hspace{7.12em}}
{\titlerule[1pc]{ }\contentspage}
Results
Finally, your table of contents looks like you wanted, including appendices.



.clsfiles are always trick. We must separate your content from what theclsdoes. Create a new file only with\chapters,\sections and so on. You don't need any text to edit what you want, it speeds up the process and focus on the real issue. Now the trick.cls, it seems you identified the region to edit spacing, try to edit in the.clsas much as you can,makeatlettershall be your last resource. To help you, we gonna need theclsfile (a link maybe) and the basictexto reproduce you table of contents. – FHZ Jul 27 '22 at 11:23