\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage[bloc,separateanswersheet,automarks]{automultiplechoice}

\begin{document}

\def\insertMainQuestionA
{
    \\\textsc{Passage:}\\       % Header to be displayed before question A
    
    Consider the quadratic equation $ax^{2} - bx + c = 0,$ where $a, b, c \,\epsilon\, \mathbb{N}$ , which has two distinct real roots belonging to the interval (1, 2).\par
    \vspace*{.5cm}
    \insertgroup{subQuestionA}      % This inserts sub-questions for main question A.
}

\element{subQuestionA}
{
    \begin{question}{QA01}
        The least value of $a$ is
        \begin{choiceshoriz}
            \wrongchoice{4}
            \wrongchoice{6}
            \wrongchoice{7}
            \correctchoice{5}
        \end{choiceshoriz}
    \end{question}
}

\element{subQuestionA}
{
    \begin{question}{QA02}
        The least value of $b$ is
        \begin{choiceshoriz}
            \wrongchoice{10}
            \correctchoice{11}
            \wrongchoice{13}
            \wrongchoice{15}
        \end{choiceshoriz}
    \end{question}
}

\def\insertMainQuestionB
{
    \\\textsc{Passage:}\\       % Header to be displayed before question B
    
    Let us consider the equation $x^{2} - (m - 3) x + m = 0, (m \,\epsilon\,\mathbb{R})$. Answer the following questions.\par
    \vspace*{.5cm}
    \insertgroup{subQuestionB}      % This inserts sub-questions for main question B.
}

\element{subQuestionB}
{
    \begin{question}{QB01}
        The set of values of $m$ such that the given quadratic equation has one root smaller than 2 and the other root greater than 2.
        \begin{choiceshoriz}
            \wrongchoice{$(-\infty,10)$}
            \correctchoice{$(10,\infty)$}
            \wrongchoice{$(-\infty,10)\cup(10,\infty)$}
            \wrongchoice{$(-\infty,-10)$}
        \end{choiceshoriz}
    \end{question}
}

\element{subQuestionB}
{
    \begin{question}{QB02}
        The set of values of $m$ such that the given quadratic equation has both roots greater then 2
        \begin{choiceshoriz}
            \wrongchoice{$[10,\infty)$}
            \wrongchoice{$(-9,10)$}
            \wrongchoice{$[9,10]$}
            \correctchoice{$[9,10)$}
        \end{choiceshoriz}
    \end{question}
}

\element{subQuestionB}
{
    \begin{question}{QB03}
        The set of values of $m$ such that the given quadratic equation has exactly one root between (1, 2).
        \begin{choiceshoriz}
            \wrongchoice{$(-\infty,10)$}
            \wrongchoice{$(9,10)$}
            \correctchoice{$(10,\infty)$}
            \wrongchoice{$(9,10]$}
        \end{choiceshoriz}
    \end{question}
}

\element{mainQuestion}
{
    \noindent
	\insertMainQuestionA
}

\element{mainQuestion}
{
    \noindent
	\insertMainQuestionB
}

\onecopy{3}
{
	\shufflegroup{subQuestionA}
	\shufflegroup{subQuestionB}
	
	\shufflegroup{mainQuestion}
	
	\insertgroup{mainQuestion}
	
	\AMCcleardoublepage

    \AMCformBegin

    %%% beginning of the answer sheet header

    \begin{center}
        \bf Answer sheet
    \end{center}

    \begin{minipage}{.47\linewidth}
    \namefield{\fbox{%
        \begin{minipage}{.9\linewidth}Name and Roll Number

            \vspace*{.5cm}\dotfill
            \vspace*{1mm}
        \end{minipage}}
        }
    \end{minipage}\vspace{2mm}

    \vspace{2mm}\noindent\hrule

    %%% end of the answer sheet header

    \AMCform
    
    \AMCcleardoublepage

}
\end{document}
