\documentclass[{{ options.latex_documentclass_options }}]{article}
\usepackage[{{ options.latex_geometry_options }}]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

\{{ options.latex_font_size }}

{% for student in results.students %}
  \begin{minipage}{\textwidth}
    { \bf
    \begin{tabular}{|c|*{5}{c|}}
    \hline
      {{results.general.name}} & {{ student.name }} & Note : {{ student.note }} & Rang : {{ student.rank }} & Moyenne : {{ results.general.avg }} & \'Ecart-type : {{ results.general.std }} \\
    \hline
    \end{tabular}
    }

    \begin{tabular}{|l|*{ {{ results.general.max_questions + 1 }} }{c|}}
    {% for exo, data in student.exercices.items() %}
        \hline
        % nom de l'exercice
        & \multicolumn{ {{ results.general.max_questions + 1 }} }{c|}{ {{ exo }} } \\
        \hline
        
        Questions & {{ data.bar.title | join('&') }} 
        & \multicolumn{ {{ data.bar.extra + 1 }} }{c}{}\\ 
        \cline{1-{{ data.bar.title | length + 1 }} }
        
        % {{ data.bar.extra }} {{ results.general.max_questions }} {{ data.bar.title | length }}

        Réussite & {{ data.bar.success | join('&') }} 
        & \multicolumn{ {{ data.bar.extra + 1 }} }{c}{}\\
        \cline{1-{{ data.bar.title | length + 1 }} }

        Barème & {{ data.bar.points | join('&') }} & \multicolumn{1}{c}{ {{ data.bar.points | sum }} }
        {% if data.bar.extra > 0 %} & \multicolumn{ {{ data.bar.extra }} }{c}{} {% endif %}\\
        \cline{1-{{ data.bar.title | length + 1 }} }

        Sur la copie & {{ data.raw | join('&') }} 
        & \multicolumn{ {{ data.bar.extra + 1 }} }{c}{}\\
        \cline{1-{{ data.bar.title | length + 1 }} }

        En réalité & {{ data.corrected | join('&') }}  & \multicolumn{1}{c}{ {{ data.corrected | sum }} }
        {% if data.bar.extra > 0 %} & \multicolumn{ {{ data.bar.extra }} }{c}{} {% endif %}\\
    {% endfor %}
    \hline
    \end{tabular}
  \end{minipage}
  \vspace{0.3cm}
  \hrule
  \vspace{0.3cm}
{% endfor %}

\end{document}
