Use identifier as a default for the 'AMCOpen@question' key (Feature #307)


Added by Nicolas Richard over 9 years ago. Updated over 9 years ago.


Status:Resolved Start date:10/16/2014
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:-
Target version:-

Description

Everytime I write an open question, I have to find both an identifier (for the 'question' environment) and a small text to recognize the question on the separate answer sheet. I usually use the same thing at both places, so I suggest to implement this behaviour as the default when using the 'question' key without a value. The patch is very simple, but I'm not sure if it has other consequences :

--- a/doc/sty/automultiplechoice.dtx.in    Tue Oct 14 14:28:27 2014 +0200
+++ b/doc/sty/automultiplechoice.dtx.in    Thu Oct 16 12:11:04 2014 +0200
@@ -3483,7 +3483,7 @@
 \define@key{AMCOpen}{backgroundcol}{\def\AMCocol@Background{#1}}
 \define@key{AMCOpen}{foregroundcol}{\def\AMCocol@Foreground{#1}}
 \define@key{AMCOpen}{Treserved}{\def\AMCotextReserved{#1}}
-\define@key{AMCOpen}{question}{\def\AMCopen@question{#1}}
+\define@key{AMCOpen}{question}[\AMCid@name]{\def\AMCopen@question{#1}}
 \define@key{AMCOpen}{answer}{\def\AMCopen@answer{#1}}
 \define@key{AMCOpen}{contentcommand}[AMCopen@lines]{\def\AMCopen@contentcommand{#1}}
 \newdimen\AMCopen@Hspace\AMCopen@Hspace=.5em

History

Updated by Alexis Bienvenüe over 9 years ago

  • I'm not sure this will work, as \AMCid@name is empty when \define@key is called.
  • This will change AMC behavior and insert questions clues from questions ID (unless question parameter is set) in all open questions, and this could disturb some users. What do you think?

Updated by Nicolas Richard over 9 years ago

Alexis Bienvenüe wrote:

  • I'm not sure this will work, as \AMCid@name is empty when \define@key is called.

At least it seems to work for me. \define@key records \AMCid@name, and expansion happens later, apparently at the right time (i.e. when \AMCid@name is known).

  • This will change AMC behavior and insert questions clues from questions ID (unless question parameter is set) in all open questions, and this could disturb some users. What do you think?

I don't think it changes the behavior : the default is only used if the option 'question' is given without a '=value' ; in the current implementation it will give an error to do that.

My use of the feature is that I set \AMCopenOpts{question} globally. Side note : it would probably be good if there was a way to undo that global setting on a per question basis, but I didn't need it. Perhaps setting 'question={}' to get an empty value would be good enough, but I didn't try.

Updated by Alexis Bienvenüe over 9 years ago

the default is only used if the option 'question' is given without a '=value'

OK: I was missing this point. So there is no problem including this patch - see hg:23fac1ff67b3.

Updated by Alexis Bienvenüe over 9 years ago

Applied in changeset hg:23fac1ff67b3.

  • % Done changed from 0 to 100
  • Status changed from New to Resolved

Also available in: Atom PDF