How to properly set a box name when the corresponding label does not fit with it?

Added by Roberto González over 10 years ago

Hi, everybody.

I have created the attached answer sheet for post correcting, with Alexis help.

As you can see in the pdf file, labels for fields 'Nivel' and 'Asignatura' are outside the corresponding boxes, while every other labels are inside the corresponding boxes.

I have done this by adapting Alexis's suggestion to solve another issue that I had:

For the 'Nivel' field:

\def\NivelCode{ %
{\def\AMCbeginQuestion##1##2{}%
\AMCnobloc\setlength{\parindent}{0pt}%
\def\AMCbeginAnswer{\hspace{0pt}\vbox\bgroup}%
\def\AMCendAnswer{\vspace{-\AMCcodeVspace}\egroup}%
\def\AMCanswer##1##2{\hbox{##1 ##2}\vspace{\AMCcodeVspace}}%
\begin{question}{nivel}\QuestionIndicative%
\begin{choicescustom}[o]\scoring{auto=1}%
\wrongchoice[\phantom{7}]{7}
\wrongchoice[\phantom{8}]{8}
\wrongchoice[\phantom{I}]{I}
\wrongchoice[\phantom{II}]{II}
\wrongchoice[\phantom{III}]{III}
\wrongchoice[\phantom{IV}]{IV}
\end{choicescustom}%
\end{question}}%
}

For the 'Asignatura' field:
\def\AsignaturaCode{ %
{\def\AMCbeginQuestion##1##2{}%
\AMCnobloc\setlength{\parindent}{0pt}%
\def\AMCbeginAnswer{\hspace{0pt}\vbox\bgroup}%
\def\AMCendAnswer{\vspace{-\AMCcodeVspace}\egroup}%
\def\AMCanswer##1##2{\hbox{##1 ##2}\vspace{\AMCcodeVspace}}%
\begin{question}{asignatura}\QuestionIndicative%
\begin{choicescustom}[o]\scoring{auto=1}%
\wrongchoice[\phantom{L}]{Len}
\wrongchoice[\phantom{M}]{Mat}
\wrongchoice[\phantom{H}]{His}
\wrongchoice[\phantom{B}]{Bio}
\wrongchoice[\phantom{F}]{Fis}
\wrongchoice[\phantom{Q}]{Qui}
\wrongchoice[\phantom{I}]{Ing}
\wrongchoice[\phantom{R}]{Rel}
\end{choicescustom}%
\end{question}}%
}

The problem is that, in the ods report, field 'Nivel' values are encoded as 1, 2, 3, 4, 5 and 6, while 'Asignatura' field values are encoded as 1, 2 ,3, ... 8.

I need those fields values to be encoded in the following way inside the generated ods fle:

'Nivel': 7, 8, I, II, III, IV
'Asignatura': Len, Mat, His, Bio, Fis, Qui, Ing, Rel (or L, M, H, B, F, Q, I, and R, if the main option is impossible due to some technical obstacle).

I suspect that putting

\phantom{whatever_you_put_here} 

as the first argument of \wrongchoice leads the system to internally assign the undesired values which I said above, although it produces the desired 'visual' effect in the resulting pdf answer sheet.

Any idea about how to fix it?

P.S: as you will notice, I'm using 'insidebox' option here. How should I proceed if I were using 'outsidebox' option?

Thanks in advance.
Roberto.

DOC-sujet.pdf - The produced answer sheet (72.4 kB)

source.tex - TeX source file (8.4 kB)

PruebaCs3.ods - See here to look the way that the fields were encoded (8.9 kB)


Replies (1)

RE: How to properly set a box name when the corresponding label does not fit with it? - Added by Alexis Bienvenüe over 10 years ago

asignatura is scored as a standard question, and AMC only handles numerical scores. The 1,2,... scores for the answers are set by the \scoring{auto=1} commands.
The workaround here is to post-process the ods file to set the strings you need based on the integer values.

(1-1/1)