3

Consider the following MWE:

\documentclass{article}
\usepackage{fullpage}
\newcounter{question}
\renewcommand{\thequestion}{\Roman{question}}

% see https://tex.stackexchange.com/a/729773/10898
\newenvironment{question}[2]{% #1 = points, #2 = question text
  \par\addvspace{\topsep}%
  \stepcounter{question}%
  \noindent{\bfseries \thequestion. #2{\unskip\nobreak\hfil\penalty50
  \hspace{2em}\mbox{}\nobreak\hfil(#1)\parfillskip=0pt \finalhyphendemerits=0 \par}}%
  \vspace{\topsep}
}{\par\addvspace{\topsep}}
\begin{document}
\begin{question}{4}{Write the correct one word substitutions for the following.}
\end{question}
\begin{question}{2}{Write the correct one word substitutions for the following.}
\end{question}
\begin{question}{1}{Write the correct one word substitutions for the following.}
\end{question}
\end{document}

sample

This produces the intended effect but I would like instead of (4), (2) or (1) only, that it produces (4 points each), (2 points each), (1 point each). Therefore, if the user inputs 1, that it uses point and for any number greater than one that it ouputs points.

1 Answer 1

3
\documentclass{article}
\usepackage{fullpage}
\newcounter{question}
\renewcommand{\thequestion}{\Roman{question}}
\newcommand\pointvalue{points}

% see https://tex.stackexchange.com/a/729773/10898
\newenvironment{question}[2]{% #1 = points, #2 = question text
  \par\addvspace{\topsep}%
  \stepcounter{question}%
  \ifnum#1=1
    \def\pointvalue{point}%
  \fi
  \noindent{\bfseries \thequestion. #2{\unskip\nobreak\hfil\penalty50
  \hspace{2em}\mbox{}\nobreak\hfil(#1 \pointvalue{} each)\parfillskip=0pt \finalhyphendemerits=0 \par}}%
  \vspace{\topsep}
}{\par\addvspace{\topsep}}
\begin{document}
\begin{question}{4}{Write the correct one word substitutions for the following.}
\end{question}
\begin{question}{2}{Write the correct one word substitutions for the following.}
\end{question}
\begin{question}{1}{Write the correct one word substitutions for the following.}
\end{question}
\end{document}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.