1

I am trying to apply the answer to this question to the overloaded exam-randomizechoices oneparchoices environment; I want oneparchoices to spread out evenly with respect to the available horizontal space. However, when I attempt this, the formatting behaves unexpectedly. I believe this part of the exam-randomizechoices documentation might be essential to figuring this out. I'm not experienced working with latex on a technical level. Also, are there any other ways to achieve the same effect?

enter image description here

\documentclass[11pt]{exam}
\usepackage[margin=1in]{geometry}

\usepackage{xpatch}
\xpatchcmd{\oneparchoices}{\penalty -50\hskip 1em plus 1em\relax}{\hfill}{}{}% must be altered before loading exam-randomizechoices
\usepackage[overload]{exam-randomizechoices}
\setrandomizerseed{314}

%
% other potential options?
% https://muug.ca/mirror/ctan/macros/latex/contrib/exam-randomizechoices/exam-randomizechoices-doc.pdf#page=18

\begin{document}
    \noindent All questions should have evenly spaced multiple choice answers that take up all horizontal spacing.
    \begin{questions}
        \question
        vanilla oneparchoices (works fine):\par
        \begin{oneparchoices}[norandomize]
            \CorrectChoice First
            \choice Second
            \choice Third
            \choice Fourth
        \end{oneparchoices}
        \question
        exam-randomizechoices oneparchoices (unexpected behavior):\par
        \begin{oneparchoices}
            \CorrectChoice First
            \choice Second
            \choice Third
            \choice Fourth
        \end{oneparchoices}
    \end{questions}
\end{document}
2
  • @JohnKormylo I've tried moving the \xpatchcmd after loading the exam-randomizechoices package and nothing happens. There is likely another way to do it, but I cannot figure it out at my experience level.
    – Jon
    Sep 30, 2022 at 13:46
  • Sometimes it works, sometimes it doesn't. Unfortuneately, exam-randomizechoices patchces the heck out of exam class, so there is no telling what the final code looks like. Oct 1, 2022 at 2:55

0

You must log in to answer this question.

Browse other questions tagged .