This question arises from this one that was specific to the exam document class, but there should, I imagine, be wider applicability here as well as usefulness outside of using exam.
\documentclass[10pt,addpoints]{exam}
\newcounter{magicrownumbers}
\newcommand\rownumber{\stepcounter{magicrownumbers}\arabic{magicrownumbers}}
\begin{document}
\begin{questions}
\question Question one.
\question Question two.
\question Question three.
\end{questions}
\bgroup
\def\arraystretch{2.5}
{\setlength{\tabcolsep}{2em}
\begin{tabular}{|c|c|c|c|}
\hline
Problem & Understood & Confused & \phantom{someemptytext}Note\phantom{someemptytext} \\
\hline
\rownumber & {} & {} & {}\\
\hline
\rownumber & {} & {} & {}\\
\hline
\rownumber & {} & {} & {}\\
\hline
\end{tabular}}
\egroup\\
Total number of questions: \numquestions.
\end{document}
I used help from this question for the row numbers, but it seems like there should be an easy workaround for what I am trying to accomplish here. The table is how I would like it to look except I want the number of rows generated to be dictated by \numquestions from the exam class. As can be seen from the code, all \numquestions rows (3 in this case) are of the type
\rownumber & {} & {} & {}\\
\hline
Is there a way I can use \numquestions to make a table generate \numquestions rows of the type above?




tabularxis used only for convenience; instead of changing\arraystretch, I insert a big strut. The body of the table is generated with\int_step_inline:nnnn, not that difficult.;-)– egreg Aug 06 '17 at 20:54:-)– Daniel W. Farlow Aug 06 '17 at 20:57questionsenvironment or does that ruin the structural integrity of your answer (I know you said you could build a table based on the value ofquestionwhen thequestionsenvironment ends). I ask because that was originally my main intention (with usingnumquestionssomewhere) but your answer is rather beyond me in terms of whether or not that would be a minor change or a complete restructuring. – Daniel W. Farlow Aug 06 '17 at 21:25:-)– Daniel W. Farlow Aug 07 '17 at 19:41examdocument class whenhyperrefis loaded? I've posted a question about this here, but thought I would ask you on this original thread. – Daniel W. Farlow Jan 23 '18 at 05:01