Following this post, I would like to do a checkbox list, with enumerate elements. Before each enumerate label, an empty checkbox is present. In the MWE below, I'd like to have the box in front of the third element checked. (But still be numbered c.)
\documentclass{article}
\usepackage{pifont,amssymb} % for the symbols
\usepackage[shortlabels]{enumitem}
\newlist{answerlist}{enumerate}{2}
\setlist[answerlist]{label={$\square$ \hspace{1pt}\alph.}}
\newcommand{\cmark}{\ding{51}}%
\newcommand{\correct}{
\rlap{$\square$ \hspace{1pt}\alph{\theenumi}.}{\raisebox{2pt}{\large\hspace{1pt}\cmark} *a}%
\hspace{-2.5pt}
}
\newcommand{\correctanswer}{\item[\correct] }
\begin{document}
\begin{answerlist}
\item One
\item Two
\correctanswer Test
\end{answerlist}
\end{document}
But the \correctanswer above generates an error because the counter \theenumi seems to be zero at that point.

\refdoesn't seem to work for me anymore, or at least only intermittently (I'm having reproducing exactly when it breaks) after changing an\itemto a\correctanswer. Doesn't matter for people not referencing the lists, but worth noting probably. – hasManyStupidQuestions Apr 15 '22 at 21:13