AMCopen with more than one line of boxes

Added by S. McKay almost 9 years ago

Hi,
I may have asked this before, I don't know. I use the following code for AMCOpen:

\AMCOpen{}{\foreach \n in {0,...,\thepointsmone}{\wrongchoice{\n}\scoring{\n}}
\correctchoice{#2}\scoring{#2}}

\thepointsmone is defined as whatever #2 is minus one. This allows me to setup amcopen just by knowing the number of points I want. This works well as long as the points are 10 or less. (Even with 10, its crowded.) I usually make sure I just keep my points to 10 or less, but I recently had a colleague who wanted to make a problem worth 20 points.

I used to use

% \AMCOpen{}{\begin{minipage}{0.34\textwidth}
% \baselineskip=2\baselineskip
% \foreach \n in {1,...,\thepointsmone}{\wrongchoice{\n}\scoring{\n}}
% \correctchoice{#2}\scoring{#2}
% \end{minipage}}

which would create multiple lines if there were too many boxes, but creates problems of its own. (I think I got the idea of using minipage from this forum, but can't remember). It appears to be sensitive to font and box size choices. For example, sometimes the box and its label will be on different lines. There may be a way to define a minipage based on defaults or commands in AMC that will prevent that problem. If there is, I would appreciate advice.

I figured it might be easy to just make sure the boxes go to a new line after multiples of 10, but it appears that AMCOpen ignores new line directives. So, I am at a loss how to do this programmatically.

Thanks for any advice, and apologies if this has already been asked/answered.

S.M.


Replies (14)

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

Fun enough, I have just had the same need (multiline) and the same experience (\newline doesn't work). And I don't have yet the answer on how one should proceed.

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

It seems that \AMCopen is built on the choicescustom environment. Therefore, we should be able to modify the environment in which the answers are displayed.
For instance, I tried something like this :

\def\AMCbeginAnswer{\begin{minipage}{0.5\textwidth}}
\def\AMCendAnswer{\end{minipage}}
\def\AMCanswer#1#2{#1 #2}

which should place the chekbox in a minipage.
But it failed.
I also try to simulate the choices and the choiceshoriz environment in the AMCopen context. I tried to change the place where I put these definitions, I tried \gdef. But it still refuses to work.
I am still confident it should work, but I must be missing something in the implementation of \AMCbeginAnswer etc.

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

Following a second (more attentive) reading, I understand the question is : "I need to be able to give between zero and 20 points for an Open question", the problem being the space available for the 20 checkboxes.
A quick workaround, is to use checkboxes with different "weights" affected to them, for instance : one weighed "1", two weighed "2", one weighed "5", one weighed "10". With these 5 checkboxes, you can code any number between 0 and 20.

RE: AMCopen with more than one line of boxes - Added by Davide G.M. Salvetti almost 9 years ago

I would suggest to just use base two, which is what I do: using checkboxes with weights 1, 2, 4, 8, 16, ..., you can efficiently code any number up to 2^n-1, n being the number of checkboxes, which has to be at least and needs not to be more than int(log_2 N)+1, N being your desired maximum. In fact, by checking or not you are using an alphabet with two digits (checked meaning one, not checked meaning zero), therefore coding with base two powers is but a very natural consequence.

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

Exactly, that was my first thought in fact, for the reasons you exposed.
Then I thought that dealing with powers of 2 was (a little) painful. I thought then to the money change system used to make any number with coins/notes.

I made a little study to check the efficiency of the two systems.
Pro "base 2": = same number of choices
+ "natural", easier to compute with computer
+ more efficient in terms of number of ticks necessary (by ~15%) with a uniform probability of the marks.
Pro "money change" = same number of choices
+ a little easier to compute mentally
+ more efficient in terms of number of ticks necessary when marks are weighed with a standard law² (by ~5%)

Therefore, the two systems are roughly equivalent in terms of efficiency ; it's just a question of taste, of aversion to base 2 calculus !

² I used a mean of 10, a deviation of 2 ; higher the deviation is, better is the base 2 system, but in narrow margins

Codage_0-20_ticks.xlsx - Comparison (15.1 kB)

RE: AMCopen with more than one line of boxes - Added by Frédéric Bréal almost 9 years ago

I'm not sur to have really understood et correctly translated the posts but may be this code could be usefull

\begin{questionmult}{Test}%
\scoring{default.BitZero=0,default.BitOne=0,default.BitTwo=0,Default.BitThree=0,Default.BitFour=0,formula=(16*BitFour+8*BitThree+4*BitTwo+2*BitOne+BitZero),MAX=20}%
text
\AMCOpen{lines=3}{\correctchoice{16}\scoring{set.BitFour=1}\correctchoice{8}\scoring{set.BitThree=1}\correctchoice{4}\scoring{set.BitTwo=1}\correctchoice{2}\scoring{set.BitOne=1}\correctchoice{1}\scoring{set.BitZero=1}}
\end{questionmult}
}

RE: AMCopen with more than one line of boxes - Added by S. McKay almost 9 years ago

Hi,
This has been a really interesting discussion. However, none of the ideas seem to solve my problem exactly.

The problem with Davide's idea of using binary (though genius, really) is two-fold. First, I am using this system for multi-section exams with many graders. (The graders only grade one problem over all sections). Asking them to convert to binary to give their score seems to me to be adding a level of complexity that I don't want to have. (Although it seems that the longer you use the system the easier this would be.) Second, graders should not be able to enter a score higher than the stated score. For example, suppose I want a maximum score of 18 on a problem. I would need 5 boxes, 1,2,4,8, and 16. In that case the maximum score they can mark is 31. Since my graders often take their queue from the boxes given, this leads to confusion. However, as I said, its a really interesting idea and suggests some possibilities.

The problem with AI DUS's idea is that it seems the AMCOpen would need to be custom made, where I am trying to automate the process. However, maybe I need to think about that more. This idea has also pointed out some options to me.

Gérard Carpeaux: Does the code that you posted work with the current production version of AMC (1.2.1 I think)?  I've never seen code like that.  I certainly is possible its in the manual, because I've missed things before, but I haven't seen it.

Thanks all. I have some ideas now.

One idea is that for questions worth more than 10 points, have each box increment by 2 instead of one, and have a "+1" box at the end they can check if they want to assign an odd number of points. I worry that this will lead to graders just assigning an even number of points however. It does have the advantage that the most boxes the grader needs to mark is two, and the mental arithmetic is virtually zero.

Thoughts?

RE: AMCopen with more than one line of boxes - Added by Frédéric Bréal almost 9 years ago

Does the code that you posted work with the current production version of AMC (1.2.1 I think)?

Yes, it does.
See the section 6.5.2 Scoring strategy (english documentation)

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

I find Gerard's way to implement the 1,2,4,8 etc. checkboxes interesting : it shows how scoring formulas can work. However, to have the 1,2,4,8 etc. scores, it is probably easier to just put \scoring{m=1,b=0},\scoring{m=2,b=0},\scoring{m=4,b=0},\scoring{m=8,b=0} etc. after the \wrongchoices to have the desired effect.

Regarding automation, I created a series of macros with several \wrongchoice \correctchoice with \scoring according to a typology of answers.

\def\TafpjNXthreeAll#1#2#3#4#5#6{\%#1#2#3 : criteria marked ; #4#5#6 : maximal marks
\hspace{0.2cm}#1\wwos[A]{a}{}\wwos[B]{f}{}\wwos[C]{p}{m=\eval{#4/2}}\wwos[D]{j}{m=#4}%
\hspace{0.2cm}#2\wwos[E]{a}{}\wwos[F]{f}{}\wwos[G]{p}{m=\eval{#5/2}}\wwos[H]{j}{m=#5}%
\hspace{0.2cm}#3\wwos[I]{a}{}\wwos[J]{f}{}\wwos[K]{p}{m=\eval{#6/2}}\wwos[L]{j}{m=#6}%
\hspace{0.2cm}All:\wwos[M]{a}{}\wwos[N]{f}{}\ccos[O]{j\ }{b=\eval{#4+#5+#6}}
}

As an example, I just have to enter :
\TafpjNXthreeAll{resultOK,precisionOK,explanationOK,1,0.5,2}

to create 3 lots of 4 checkboxes with the number of points I want to give : 'a' stands for no answer, 'f' for false, 'p' for partially correct, 'j' for correct, for the grader to choose according the situation. Points are automatically evaluated for partial and in the \correctchoice that will give the maximum points possible (for the annotation report). The same, even simpler, could do the job regarding the two systems proposed.

Regarding the automation again, I used base 2 numbers for an alternative to the \AMCcode macro. I automated the creation of the scores to depict what has been checked. I use a TeX loop with a variable \var, initially set to 1, that is multiplied by 2 at each stage (by \advance\var\var ) so that \scoring{b=0,m=\var} do the job automatically. Drawback, it needs some (limited) knowledge in TeX.

Regarding the maximum points with 5 checkboxes, 2^5-1, it suffices to introduce a MAX=18 in the scoring, to limit the score to 18.

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

A solution for the problem could be to have 20 checkboxes, with no space between them, with possibly a reduced width (with \AMCsetScoreZone{width=1.5em,height=0.75ex}). The mark could then be easily coded by choosing the right checkboxes between the two bounds figuring 0 and 20. The \scoring{auto=0} allows a scoring of 0 to 20 for the checkboxes.

RE: AMCopen with more than one line of boxes - Added by Frédéric Bréal almost 9 years ago

obviously, Al Dius is right. This way is easier but i type b=16 inside m=16

\begin{questionmult}{Test3}\bareme{MAX=20}%
non bit
\AMCOpen{lines=3}{\correctchoice{16}\scoring{b=16}\correctchoice{8}\scoring{b=8}\correctchoice{4}\scoring{b=4}\correctchoice{2}\scoring{b=2}\correctchoice{1}\scoring{b=1}}
\end{questionmult}

\AMCsetScoreZone

This option works during annotation and with the test version (not the stable)

\scoring{auto=0}

Have you tried ?
The documentation says With this parameter, the value of the response numbered i will be auto + i -1. This
option is mainly used with \QuestionIndicative

I tried this but the score is only 1/5 whatever the ticked box. I have an error if i don't type questionmult.

\begin{questionmult}{Test2}\scoring{auto=0}%
score auto
\AMCOpen{lines=3}{\correctchoice{1}\correctchoice{2}\correctchoice{3}\correctchoice{4}\correctchoice{5}}
\end{questionmult}

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

Implementation is not always exactly what you think it could be ... but still the concept is working.

  • \scoring{auto=0} doesn't work in this context of open question. I used it briefly in an alternative to the \AMCcode and it worked fine. It's a shame it doesn't work here because it would be perfectly adequate. So I did by hand (I could have done a \loop with a little more time).
  • I didn't need to shorten the checkboxes as initially thought because I had enough space.
  • I maintained all questions "wrongchoice" except the last one with a scroing of 20 : this way, the total for the annotation is 20, and I don't need any MAX=... directive. (Gérard, this was the reason of my choice for "wrongchoice" : only the last checkbox, I use when all is fine instead of checking all "good" checkboxes, it is quicker and correct for the annotation. Because I have "half points" alternatives, if I had correctchoices, I would have more than the total : 0,5 for partial answer and 1 for good answer which makes a total of 1,5 in annotation instead of my desired maximum of 1. I could use the MAX=1 directive just as you did, but in search for automation, it is an extra addition.)
  • I added space every 5 to ease the graduation and indicated multiple of 5.

The result is attached and the source code is here :

\element{OpenQuestion}{
\begin{question}{OpenQuestion01}
Answer the question,the best you can.\hfill
\AMCOpen{lines=5}{
\wrongchoice{0\hspace{0.3cm}}\scoring{m=0}
\wrongchoice{}\scoring{m=1}
\wrongchoice{}\scoring{m=2}
\wrongchoice{}\scoring{m=3}
\wrongchoice{}\scoring{m=4}
\wrongchoice{5\hspace{0.3cm}}\scoring{m=5}
\wrongchoice{}\scoring{m=6}
\wrongchoice{}\scoring{m=7}
\wrongchoice{}\scoring{m=8}
\wrongchoice{}\scoring{m=9}
\wrongchoice{10\hspace{0.3cm}}\scoring{m=10}
\wrongchoice{}\scoring{m=11}
\wrongchoice{}\scoring{m=12}
\wrongchoice{}\scoring{m=13}
\wrongchoice{}\scoring{m=14}
\wrongchoice{15\hspace{0.3cm}}\scoring{m=15}
\wrongchoice{}\scoring{m=16}
\wrongchoice{}\scoring{m=17}
\wrongchoice{}\scoring{m=18}
\wrongchoice{}\scoring{m=19}
\correctchoice{20}\scoring{b=20}}
\end{question}}

C8EWFS_5.PNG - FInal aspect (115.5 kB)

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

Regarding the title of the thread, having checkboxes on several lines, I manage to do so, and more (I used the \tabenum environment from the "tablists" package), thanks to the introduction of a minipage around the \wrongchoice and \correctchoice. (see results attached)

However I am still frustrated :
  • I can't control the width of the minipage (let's say it is automatically set ;) ),
  • the text to indicate checkboxes for graders only, is placed after the checkboxes,
  • while \AMCopen is built around the \customchoices environment, I am unable to implement the \AMCbeginAnswer, \AMCendAnswer and the \AMCanswer commands. Probably, I don't put the \def definitions at the right place.

If anybody has a clue ...

CXYJJN_D.PNG - \AMCopen with several lines of boxes (134.2 kB)

RE: AMCopen with more than one line of boxes - Added by Al DUS almost 9 years ago

Regarding the use of \scoring{auto=...} (I cannot edit my before last message) :
it works, but only within the "question" environment, not within the "questionmult" one. It is more elegant than with \scoring{...} for each checkbox. However, I didn't try the effect on annotations.

\element{OpenQuestion}{
\begin{question}{OpenQuestion04}
Answer the question,the best you can, last chance for auto !.\hfill
\AMCOpen{lines=3}{\scoring{b=0,auto=0}%
\wrongchoice{0\hspace{0.3cm}}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{5\hspace{0.3cm}}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{10\hspace{0.3cm}}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{15\hspace{0.3cm}}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{}
\wrongchoice{}
\correctchoice{20}\scoring{b=20}}
}
\end{question}}

(1-14/14)