Epagris 144c62f9ad - LaTeX template improved: submission count, challenge fill and skip counts added
- "List best results only" option added to each report generation functionality
2024-10-01 15:55:30 +02:00

167 lines
4.8 KiB
TeX

% !TeX spellcheck = hu_HU
% !TeX encoding = UTF-8
% !TeX program = xelatex
\documentclass[10pt]{article}
%% Importing packages
% General things
\usepackage[magyar]{babel}
\usepackage[a4paper,margin=10mm,footskip=5mm]{geometry}
\usepackage{fontspec}
\usepackage[fontsize=7pt]{fontsize}
\usepackage{titlesec}
% For frame layout and content
\usepackage{xcolor}
\usepackage[framemethod=tikz,xcolor]{mdframed}
\usepackage{progressbar}
% For hyperlinks
\usepackage[hidelinks]{hyperref}
%% Setting up document
% Setting up colors globally
\definecolor{colbg}{HTML}{D3E5E5} % Background
\definecolor{coltit}{HTML}{176767} % Question title
\definecolor{coltxl}{HTML}{EFEFEF} % Light text
\definecolor{coltxd}{HTML}{000000} % Dark text
\definecolor{colpbm}{HTML}{176767} % Correct progressbar
\definecolor{colpbs}{HTML}{75A6A6} % Incorrect progressbar
\definecolor{colpbb}{HTML}{A0A0A0} % Progressbar background
\definecolor{colanc}{HTML}{176767} % Correct answer background
\definecolor{colani}{HTML}{D3E5E5} % Incorrect answer background
\definecolor{colsbg}{HTML}{AA8A7D} % Group title background
\definecolor{colsfg}{HTML}{EFEFEF} % Group title text color
\definecolor{colqsb}{HTML}{176767} % Quiz sequence number background
\definecolor{colqsf}{HTML}{EFEFEF} % Quiz sequence number text color
% Setting up outer frames
\mdfsetup{
nobreak,
linewidth=0pt,
roundcorner=0.3em,
backgroundcolor=colbg,
}
% Setting up progressbars
\progressbarchange{
heightr=1.25,
roundnessa=0.2em,
borderwidth=0pt,
subdivisions=1,
ticksheight=0pt,
linecolor=colbg,
emptycolor=colpbb,
filledcolor=colpbm,
labelcolor=coltxl
}
% Replacing ToC text
\addto\captionsmagyar{%
\renewcommand{\contentsname}%
{\huge Csoportok}%
}
% Add dotfill to ToC
\makeatletter
\patchcmd{\l@section}{\hfil}{%
\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfill}{}{}
\makeatother
% Set all font styles to the regular one (we don't have any other)
\setmainfont{AutourOne}[
UprightFont={*-Regular},
BoldFont={*-Regular},
ItalicFont={*-Regular},
BoldItalicFont={*-Regular},
SmallCapsFont ={*-Regular},
SlantedFont ={*-Regular}
]
%% Creating new environments and commands
% Just as the command says
\newcommand{\inputIfFileExists}[1]{\IfFileExists{#1}{\input{#1}}{}}
% A new command to add unnumbered sections which appear in ToC
\newcommand{\unnumsec}[1]{\section*{#1}%
\addcontentsline{toc}{section}{#1}}
% Set section title style
\titleformat{\unnumsec}{\Large\bfseries}{\thesection}{1em}{}
% Macros for answers
\newcommand{\answerCorrect}[2]{\progressbar{#1} & \begin{minipage}{0.8\columnwidth}\begin{mdframed}[backgroundcolor=colanc]\color{coltxl}{#2}\end{mdframed}\end{minipage}\\}
\newcommand{\answerIncorrect}[2]{\progressbar[filledcolor=colpbs]{#1} & \begin{minipage}{0.8\columnwidth}\begin{mdframed}[backgroundcolor=colani]\color{coltxd}{#2}\end{mdframed}\end{minipage}\\}
% Macros for questions.
\newmdenv[backgroundcolor=colqsb,align=left,innerleftmargin=0.2em,innerrightmargin=0.2em]{qsn} % Question sequence number
% Environment for questions. The parameter is the question itself, the contents of the environment should consist of \answer*{}{} macros and nothing else
\newenvironment{question}[2]{
\begin{center}
\begin{mdframed}
\raisebox{0.05em} {
\begin{minipage}{0.6cm}
\begin{qsn}[userdefinedwidth=0.5cm]
\begin{flushright}
\color{colqsf}\arabic{qc}.
\end{flushright}
\end{qsn}
\end{minipage}
}
%
{\color{coltit}\large #1\par}\medskip
%
{\hspace{1em}\small #2~kitöltő}\vspace{0.6em}\par
\stepcounter{qc}
\begin{tabular}{c c}
}{
\end{tabular}
\end{mdframed}
\end{center}
}
% An environment to create a quiz containing questions. The parameter is either the title of the quiz, or the name of the course
\newenvironment{quiz}[2]{
% Create highlighted group title
\begin{mdframed}[backgroundcolor=colsbg]
{
\color{colsfg}
\unnumsec{#1}
{\small #2~kitöltő}
\vspace{0.4em}
}
\end{mdframed}
% Reset question counter
\setcounter{qc}{1}
}{
\clearpage
}
\begin{document}
\begin{center}
\Huge \IfFileExists{title.tex}{\input{title.tex}}{Kvíz eredmények}
\end{center}
\Large
\tableofcontents
\normalsize
\clearpage
% Create question counter
\newcounter{qc}
\inputIfFileExists{content.tex}
\end{document}