1

I use exam-randomizechoices like this

%\documentclass[12pt,a4paper]{exam}
\documentclass[12pt,a4paper,answers]{exam}
\usepackage[randomize,overload]{exam-randomizechoices}
\newcommand{\correctchoicelabel}{\fbox{\thechoice}}
\CorrectChoiceEmphasis{\renewcommand{\choicelabel}{\correctchoicelabel}}

\begin{document}
    \section{Questions}
    \begin{questions}
        \question What is 2+2?
        \begin{choices}
            \choice 1
            \choice 2
            \choice 3
            \CorrectChoice 4
        \end{choices}

        \question What is 2+2?
        \begin{choices}
            \choice 1
                \CorrectChoice 4
            \choice 2
            \choice 3
        
        \end{choices}
        
        \question What is the result of $1+2$?
        \begin{choices}
             \choice 1
             \choice 2
             \CorrectChoice 3
             \choice 4
        \end{choices}
    
    \question What is the result of $1+1$?
    2
        \begin{choices}
         \choice 1
         \CorrectChoice 2
         \choice 3
         \choice 4
    \end{choices}

                
    \end{questions}
    \subsection{Keys}
    \centering
    \printkeytable
\end{document}

How can I arrange the \choice in horizontal?

enter image description here

1 Answer 1

4

Use the oneparchoices environment instead of the choices environment and insert a blank line before \begin{oneparchoices}

\documentclass[12pt,a4paper,answers]{exam}
\usepackage[randomize,overload]{exam-randomizechoices}
\newcommand{\correctchoicelabel}{\fbox{\thechoice}}
\CorrectChoiceEmphasis{\renewcommand{\choicelabel}{\correctchoicelabel}}

\begin{document}
    \section{Questions}
    \begin{questions}
        \question What is 2+2?
        
        \begin{oneparchoices} %<<<<<<<<<<< with  blank line before
            \choice 1
            \choice 2
            \choice 3
            \CorrectChoice 4
        \end{oneparchoices}
        
        \question What is 2+2?
        
        \begin{oneparchoices}
            \choice 1
            \CorrectChoice 4
            \choice 2
            \choice 3               
        \end{oneparchoices}
        
        \question What is the result of $1+2$?
        
        \begin{oneparchoices}
            \choice 1
            \choice 2
            \CorrectChoice 3
            \choice 4
        \end{oneparchoices}
        
        \question What is the result of $1+1$?

        \begin{oneparchoices}
            \choice 1
            \CorrectChoice 2
            \choice 3
            \choice 4
        \end{oneparchoices}
                    
    \end{questions}

    \subsection{Keys}
    \centering
    \printkeytable
\end{document}

a

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .