\documentclass[10pt,twoside,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[
  %showframe,
  margin=2cm,marginparsep=1mm,marginparwidth=18mm,headsep=8mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{ifthen}
\usepackage{amssymb}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{charter}
\usepackage{lastpage}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{hyperref}

\hypersetup{
  pdftitle={GLoIn-Übungsabgabe Deckblatt},
  pdfauthor={Übungen zu Grundlagen der Logik in der Informatik, WS 2023/24},
  hidelinks,
}

\setlength\parskip{1cm}
\setlength\parindent{0cm}

\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[LO,RE]{Übungen zu Grundlagen der Logik in der Informatik, WS 2023/24}
\fancyhead[LE,RO]{\thepage\,/\,\pageref{LastPage}}
\pagestyle{fancy}
\thispagestyle{empty}

\renewcommand{\LayoutChoiceField}[2]{%
  \begin{tikzpicture}[overlay,xshift=0.2em]
    \draw (0,0) rectangle (0.7em,0.7em);
  \end{tikzpicture}\makebox[1.4em][l]{#2} #1%
}
\def\DefaultHeightofChoiceMenu{0.7em}
\def\DefaultWidthofChoiceMenu{0.7em}

\newcounter{textfieldnr}
\newcounter{parallelgruppenr}

\newcommand{\parallelgruppe}[1]{%
  % this isn't a real for loop, it is only
  % pattern matching:
  \foreach \Day/\Time/\Tutor in
    {#1} {%
     \stepcounter{parallelgruppenr}
     \parbox{.33\textwidth}{%
       {\ChoiceMenu[radio,bordercolor=0 0 0,borderwidth=.5,name=parallelgruppe,radiosymbol=\ding{53}]{%
         \makebox[6mm][l]{\Day,}%
         \makebox[9mm][l]{\Time{}-\pgfmathparse{int(\Time+2)}\pgfmathresult{}} Uhr, \Tutor%
       }{=pg\theparallelgruppenr}}%
     }%
  }%
}
\setlength{\multicolsep}{6.0pt plus 2.0pt minus 1.5pt}

\newcommand{\textgap}[2][]{%
  % #2 = width of the line and text field
  % #1 (optional) = some kind of additional suffix that gets underlined, too
  \stepcounter{textfieldnr}%
  \underline{\parbox[b]{#2}{\TextField[name=txt\thetextfieldnr,width=#2,bordercolor=white]{}}#1}%
}

\begin{document}
\noindent%
\begin{Form}
\begin{minipage}{\textwidth}
  {\Huge{\textrm{GLoIn-Übungsabgabe}}} \\
  \begin{tikzpicture}
  \useasboundingbox (0,0) -- (-\textwidth,0);
  \coordinate (corner) at (-4cm,8mm);
  \draw[line width=1pt] (-\textwidth,0) -- (0,0)
    |- (corner) |- (0,0);
    \node[anchor=west,text depth=0pt] at (-4cm,4mm) {\sffamily Punkte:};
  \end{tikzpicture}
  \\[2mm]
  Blatt Nr: \textgap{1cm}
  \hspace{5mm}
  Parallelgruppe:
  %
  \begin{multicols}{3}
    \parallelgruppe{Mo/10/Kuder}
    \parallelgruppe{Mo/14/Baumgartner}
    \parallelgruppe{Mo/14/Kuder}
    \parallelgruppe{Mo/14/Wegmann}
    \parallelgruppe{Mo/14/Erkelentzis}
    \parallelgruppe{Mo/18/Steinleitner}
    \parallelgruppe{Do/8/Elliger}
    \parallelgruppe{Fr/8/Erkelentzis}
    \parallelgruppe{Fr/10/Vatthauer}
  \end{multicols}%
\end{minipage}%
\\[4mm]
Abgabegruppe (4 oder in Ausnahmefällen 5 Personen): \\[2mm]
\begin{tabular}{@{}l@{\hspace{4mm}}l@{\hspace{4mm}}l@{}}
 \toprule
 Name & Nutzerkennung (\texttt{ab12defg}) & Matrikelnummer \\
 \midrule\\[-0.8em]
 1\phantom{$($}~\textgap{7cm} & \textgap{4cm} & \textgap[\smash{\phantom{$)$}}]{4cm} \\[1.1em]
 2\phantom{$($}~\textgap{7cm} & \textgap{4cm} & \textgap[\smash{\phantom{$)$}}]{4cm} \\[1.1em]
 3\phantom{$($}~\textgap{7cm} & \textgap{4cm} & \textgap[\smash{\phantom{$)$}}]{4cm} \\[1.1em]
 4\phantom{$($}~\textgap{7cm} & \textgap{4cm} & \textgap[\smash{\phantom{$)$}}]{4cm} \\[1.1em]
 $($5~\textgap{7cm} & \textgap{4cm} & \textgap{4cm}$)$\\[0.8em]
 \bottomrule
\end{tabular}
\end{Form}

%\section*{Aufgabe A1}
\end{document}
