multiversionquiz-2

\documentclass[14pt, oneside]{memoir}
\usepackage{ifthen}
\usepackage{intcalc}
\usepackage{forloop}

\usepackage[absolute,overlay]{textpos}
\usepackage{pdfpages}


\usepackage[textwidth=.75in]{todonotes}

\textheight=9.5in
\voffset=-20pt
\parindent=0pt

\newcounter{mypage}

\pagestyle{empty}


\newcommand{\Quizpage}{\intcalcInc{\intcalcMod{\thepage-1}{20}}}
\newcommand{\quizpage}{\intcalcInc{\intcalcMod{\thepage-1}{4}}}

\newcommand{\bookletnumber}{\intcalcInc{\intcalcDiv{\thepage}{4}}}

\newcommand{\printbookletnumber}{%
\begin{textblock}{2}(2,1)
\Huge{\textbf{\bookletnumber}}
\end{textblock}}


\newcommand{\printpage}{%

%\firstpage{\quizpage} 
\ifthenelse{\equal{\quizpage}{1}}{\printbookletnumber}  {}


\begin{textblock}{2}(0,0)
\includepdf[pages=\thepage ]{dummy.pdf}
\end{textblock}


\begin{textblock}{2}(0,0)
\includepdf[pages=\Quizpage]{Q.pdf}
\end{textblock}
 {\ }
\newpage}


\newpage


\begin{document}

\forloop{mypage}{1}{\value{mypage} < 200}{\printpage}

\end{document}