I have designed a quiz with hundreds of questions and answers in a list. The answer to a given question is on the line immediately below it, but not all questions have answers provided. The LaTeX code for a shorter version of the quiz appears below.
\documentclass{article}
\newcommand{\qsn}{\item[$\bullet$] \normalfont}
\newcommand{\ans}{\item[$\circ$] \bfseries}
%\newcommand{\ans}{%} % this doesn't work
\begin{document}
\begin{list}{$\bullet$}{}
\qsn What are the colors on the Italian flag?
\ans Green, red, and white.
\qsn Pick a number between 30 and 40.
\qsn How many lives does a cat have?
\ans Nine.
\end{list}
\end{document}
Now I would like to prepare a second version of the quiz, but with the answers omitted (just in the final PDF document, not in the LaTeX file). Is there a quick way of doing this by redefining only \ans? My initial thought was to redefine \ans by \newcommand{\ans}{%}, but of course that won't work. I've looked at packages like comment and versions, but they all seem to require either braces or a \begin/\end pair around the material to be omitted. I also want to be able to go back and forth easily between versions of the quiz by just using the appropriate definition for \ans (i.e., by putting a % in front of the definition I don't want to use).
Thanks.
\newcommand\ans..
with\newlinecommand{\ans}{}