
Como posso fazer perguntas personalizadas usando exam
a aula? Por exemplo, preciso criar 3 questões diferentes, mas com rótulos A1, B1 e C1 e possivelmente com cores diferentes.
Algo assim
\begin{questions}
\Aquestion
This question starts with item label A1, and the text of this question is in blue color.
\Aquestion
This question starts with item label A2, and the text of this question is in blue color.
\Bquestion
This question starts with item label B1, and the text of this question is in red color.
\Cquestion
This question starts with item label C1, and the text of this question is in green color.
\Bquestion
This question starts with item label B2, and the text of this question is in red color.
\end{questions}
Responder1
O método a seguir pode não ser infalível, mas funciona conforme o esperado, sem perder muitas das opções de aulas de exame.
Etapas que tentamos:
- Defina contadores para cada tipo, digamos
aqn
,bqn
, etc., - Aumente-os dentro de
\def
forAquestion
,Bquestion
, etc., - Redefina o
\questionlabel
com base no seu contador e no texto necessário para prefixá-lo. - Claro que você pode adicionar qualquer formatação antes disso. Mas esteja atento ao fato de que esta formatação também se aplica a qualquer coisa abaixo dessas questões.
Se o método acima for adequado para você, você pode implementá-lo. Eu dei meu código aqui. Obviamente, você pode querer adicionar mais alguns.
\documentclass{exam}
\usepackage{color}
\newcounter{aqn}
\newcounter{bqn}
\newcounter{cqn}
\def\Aquestion{
\stepcounter{aqn}
\renewcommand*{\questionlabel}{A\theaqn.}
\color{blue}
\question }
\def\Bquestion{
\stepcounter{bqn}
\renewcommand*{\questionlabel}{B\thebqn.}
\color{red}
\question
}
\def\Cquestion{
\stepcounter{cqn}
\renewcommand*{\questionlabel}{C\thecqn.}
\color{green}
\question
}
\begin{document}
\begin{questions}
\Aquestion
This question starts with item label A1, and the text of this question is in blue color.
\Aquestion
This question starts with item label A2, and the text of this question is in blue color.
\Bquestion
This question starts with item label B1, and the text of this question is in red color.
\Cquestion
This question starts with item label C1, and the text of this question is in green color.
\Bquestion
This question starts with item label B2, and the text of this question is in red color.
\end{questions}
\end{document}