summaryrefslogtreecommitdiffstats
path: root/templates/tex.jinja2
blob: 6aa366cb0a70abe1c9ab7615f65444cabc6b45b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
\documentclass{article}

\usepackage[margin=1in]{geometry} % margins
\usepackage{forest} % for the class tree
\usepackage{pdfpages} % for importing the test results pdf
\usepackage{xcolor} % colours
\usepackage{listings}
\lstset{
basicstyle=\small\ttfamily,
columns=flexible,
breaklines=true
}

\newcommand{\errortext}[1]{\textcolor{red}{\textbf{#1}}}

\author{((( student_no )))}
\title{((( name ))) - Automatic marking report}

\begin{document}

\maketitle
\section{Class Tree}

\begin{figure}[h]
    \centering
    \begin{forest}
        ((( recurse_class_tree_forest(class_tree)|indent(8, False) )))
    \end{forest}
    \caption{Class inheritance tree}
\end{figure}

\section{File Analysis}
((* set flat_files = flatten_struct(files) *))
((* for filename, files_contents in flat_files.items() *))
    \subsection{\texttt{((( filename )))}}
    ((* if files_contents["present"] *))
        ((* if files_contents["has_exception"] *))
            \errortext{File cannot be run - has compile time exception.}

            Please note that this file cannot be analysed or have tests preformed upon it-
            this can lead to the whole test suite failing if another module imports this.
                    
            \textbf{Exception Type:} \texttt{((( files_contents["exception"]["type"] )))}
            
            \textbf{Exception String:} \texttt{((( files_contents["exception"]["str"] )))}

            \textbf{Full Traceback:}

            \begin{lstlisting}
((( files_contents["exception"]["traceback"] )))
            \end{lstlisting}
        ((* else *))
            \subsubsection{Documentation:}

            ((( len_documentation(files_contents["documentation"]["comments"], files_contents["documentation"]["doc"]) ))) characters long
            ((* if tex_show_full_docs == "True" *))
                
                \textbf{Comments:}
                ((* if files_contents["documentation"]["comments"] == "None" *))
                    \errortext{No comments present.}
                ((* else *))
                    \begin{lstlisting}
((( files_contents["documentation"]["comments"] )))
                    \end{lstlisting}
                ((* endif *))

                \textbf{Docstring:}
                ((* if files_contents["documentation"]["doc"] == "None" *))
                    \errortext{No docstring present.}
                ((* else *))
                    \begin{lstlisting}
((( files_contents["documentation"]["doc"] )))
                    \end{lstlisting}
                ((* endif *))
            ((* endif *))

            ((* if "classes" in files_contents.keys() *))
                \subsubsection{Classes}


            ((* endif *))

        ((* endif *))
    ((* else *))
        \errortext{File is not present.}
    ((* endif *))
((* endfor *))

\section{Tests}
((* if test_results["pytest_report"] == "*** No Tests ***" *))
    No tests were executed.
((* else *))
    \includepdf[pages={1-},scale=1.0]{((( junit_xml_to_html(test_results["junitxml"], student_no) )))}
((* endif *))

\end{document}