I am having a problem in using multicols environment in exercise environment. Here is my MWE:
\documentclass[11pt]{exam}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{ifthen}
\newboolean{firstanswerofthechapter}
\usepackage{stackengine}
\usepackage{tasks}
\newlength{\longestlabel}
\settowidth{\longestlabel}{\bfseries\sffamily vv}
\settasks{after-item-skip=3pt,%gap for next row
before-skip=2pt,%gap from the text above
after-skip=0pt,%gap for next question
label-width=20pt,%width from left
item-indent=25pt,%indent from left
label=$\EgyptianBlue\bm{(\alph*)}$,
column-sep=0em, label-align=left}
\usepackage[lastexercise,answerdelayed]{exercise}
\begin{document}
\setcounter{Exercise}{0}
\begin{Exercise}
\Question
\Question
\Question
\end{Exercise}
\begin{Answer}
\Question $(a)$
\begin{multicols}{4}
\Question $(a)$
\Question $(a)$
\Question $(a)$
\Question $(a)$
\end{multicols}
\end{Answer}
\setboolean{firstanswerofthechapter}{false}
\shipoutAnswer
\end{document}
There is no problem in the code if I start Answer environment with a \Question, however, if I start with \multicols environment (without any \Question before \multicols), then I get the following error:
Extra }, or forgotten \endgroup.
\endmulticols ...le@items \color@endgroup \egroup
\balance@columns \return@n...
l.60 \end{multicols}
I need to start Answer environment with \multicols. I also want the answers to be typed from left to right like
1. 2. 3. 4.
5. 6. 7. 8.
Please help.