# Option to give explanation for the answers of a question (Feature #238)

Status: Start date: Closed 11/20/2013 Normal Anirvan Sarkar 100% LaTeX 1.3.0

Description

It will be nice to add explanations for the answer of a given question.
Something like:

\begin{question}{elevation}
Which has the highest elevation among the following?
\begin{choices}
\correctchoice{Sagarmatha}
\wrongchoice{K2}
\wrongchoice{Mont Blanc}
\wrongchoice{Aconcagua}
\end{choices}
\explain{Sagarmatha which literally means 'Head of sky' is the native name of Mount Everest, the highest mountain in the world.}
\end{question}


The explanations should be optional and should not be displayed in the Questions but can be displayed in the Solution and Catalog file. Also it will be nice to customize the text which is displayed before the explanations using the \AMCtext command.

I am attaching a .sty file which implements this feature for reviewing.

### Associated revisions

Revision 1390:3cd60e9fa4fc

Provides \explain{•} command to give explanation for the answers of a question.
Refs #238

### History

#### #2 Updated by Alexis Bienvenüealmost 6 years ago

Very good idea.
I don't think \SujetExterne is the right thing to test to see if we produce the subject or corrected or so: this command is only defined when calling LaTeX from the GUI. Someone who wants to get the subject compiling by himself won't define \SujetExterne.
I think \AMC@correchead is the right switch to test: it is true for catalog and corrected documents, and false for subject (and individual corrected document). individual corrected document is used when compose is set in annotating (selecting pages from the subject layout), so the explanations should not be written in this mode.

#### #3 Updated by Anirvan Sarkaralmost 6 years ago

Alexis Bienvenüe wrote:

I think \AMC@correchead is the right switch to test

Updated to use \AMC@correchead instead of \SujetExterne.

#### #4 Updated by Anirvan Sarkaralmost 6 years ago

Is there any way to use the \explain command in question like environments only, similar to how \wrongchoice and \correctchoice can be used only inside choices like environments?

#### #5 Updated by Alexis Bienvenüealmost 6 years ago

Is there any way to use the \explain command in question like environments only, similar to how \wrongchoice and \correctchoice can be used only inside choices like environments?

\wrongchoice and \correctchoice use \item, which works only in itemize environments (and choices environment are itemize), but in fact perhaps you could use wrongchoice inside a itemize that is not choices... I did not setup any special thing to allow \wrongchoice only at some places.

#### #6 Updated by Anirvan Sarkaralmost 6 years ago

Now the \explain command can only be used inside question like environments. In the same way it can also be implemented for \wrongchoice and \correctchoice to work only inside choices like environment.

#### #7 Updated by Alexis Bienvenüealmost 6 years ago

Good job: feel free to integrate it in the development tree.

#### #8 Updated by Anirvan Sarkaralmost 6 years ago

From r1497 \explain{•} command can be used in AMC.

#### #9 Updated by Anirvan Sarkaralmost 6 years ago

I was busy with my end semester exams this past few weeks. I have time now and will update the the documentation for the \explain command in this week.

#### #10 Updated by Alexis Bienvenüealmost 6 years ago

Great!

• Status changed from New to In Progress

#### #11 Updated by Anirvan Sarkarover 5 years ago

• Target version set to 1.3.0
• % Done changed from 0 to 100
• Assignee set to Anirvan Sarkar
• Status changed from In Progress to Resolved

#### #12 Updated by Anirvan Sarkarabout 5 years ago

• Status changed from Resolved to Closed