I rewrote the code to generate the answer grid. I hope that's not a problem.
I made a command \answergrid
that takes 3 arguments: the number of questions, the number of possible answers per question and the third argument is a semi-colon separated list of answers.
\answergrid {10} {4} {1;2;4;3;2;3;1;2;0;0}
\documentclass{article}
\usepackage{tikz}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\answergrid}{ m m m }{
\begin{tikzpicture}[y=.6cm]
\seq_set_split:Nnn \l_tmpa_seq{;}{#3}
\newcounter{answer}
\int_step_inline:nnnn {1} {1} {#2} {
\stepcounter{answer}
\node at (##1+1,#1) {\Alph{answer}};
}
\int_step_inline:nnnn {1} {1} {#1} {
\node[fill=black,minimum~width=6mm,minimum~height=4mm] at (0, #1-##1) {};
\node at (1, #1-##1) {##1};
\int_step_inline:nnnn {1} {1} {#2} {
\node[draw,minimum~width=7mm,minimum~height=4mm] at (####1+1, ##1-1) {};
\int_compare:nNnTF {####1} = {\seq_item:Nn \l_tmpa_seq {#1-##1+1}} {
\node[fill,draw,minimum~width=7mm,minimum~height=4mm] at (####1+1, ##1-1) {};
}{
\node[draw,minimum~width=7mm,minimum~height=4mm] at (####1+1, ##1-1) {};
}
}
}
\end{tikzpicture}
}
\ExplSyntaxOff
\begin{document}
\sffamily\small
PREFERENCE\par
\answergrid {10} {4} {1;2;4;3;2;3;1;2;0;0}
\end{document}
It's important for the semi-colon separated list to have at least as much elements as the number of questions. If you don't want to mark any answers, just give a list of zeros {0;0;0;...;0;0;}
EDIT: according to the changes requested in the comments I added an optional argument. This argument is the first number of the question list. So
\answergrid [21] {20} {4} {1;2;4;3;2;3;1;2;0;0;1;2;4;3;2;3;1;2;0;0}
generates 20 questions numbered 21 to 40. That way you can use
\answergrid {20} {4} {1;2;4;3;2;3;1;2;0;0;1;2;4;3;2;3;1;2;0;0}
\answergrid [21] {20} {4} {1;2;4;3;2;3;1;2;0;0;1;2;4;3;2;3;1;2;0;0}
to get 40 questions.
\documentclass{article}
\usepackage{tikz}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\answergrid}{ O{1} m m m }{
\begin{tikzpicture}[y=.5cm]
\seq_set_split:Nnn \l_tmpa_seq{;}{#4}
\int_step_inline:nnnn {1} {1} {#3} {\node at (##1+1,#2) {\int_to_Alph:n{##1}};}
\int_step_inline:nnnn {#1} {1} {#1+#2-1} {
\node at (0, #1+#2-##1-1) {Question}; \node at (1, #1+#2-##1-1) {##1};
\int_step_inline:nnnn {1} {1} {#3} {
\node[draw,minimum~width=7mm,minimum~height=4mm] at (####1+1, ##1-#1) {};
\int_compare:nNnTF {####1} = {\seq_item:Nn \l_tmpa_seq {#1+#2-##1}} {\node[fill,minimum~width=7mm,minimum~height=4mm] at (####1+1, ##1-#1) {};}{}
}
}
\end{tikzpicture}
}
\ExplSyntaxOff
\begin{document}
\sffamily\small
\answergrid {20} {4} {1;2;4;3;2;3;1;2;0;0;1;2;4;3;2;3;1;2;0;0}
\answergrid [21] {20} {4} {1;2;4;3;2;3;1;2;0;0;1;2;4;3;2;3;1;2;0;0}
\end{document}