[OS X TeX] Variable
Christopher Allen
Christopher.T.Allen.95 at Alum.Dartmouth.ORG
Thu May 4 02:28:41 CEST 2006
On May 3, 2006, at 3:40 PM, Alain Schremmer wrote:
> Up to now, I have just assigned them as i=question number in
> question folder, j = variant number in the file. So, for instance,
> Q22-5 is the fifth variant in file 22 in the question folder. But
> when I enter this by hand—so far I haven't been able to write a
> single Apple script both for lack of time and lack of ability. (The
> programmer's mind is something different or at least so I fathom
> when I listen to my Software Engineer son)
Hmmm... I see possibilities. If I understand the commands properly,
\value{counter} is read as an integer while \arabic{counter} is read
as a string.
My biggest hang-up at the moment is understanding exactly what you
want done with 22 and with 5 here.
> \newproblem{Qi-j}{\includegraphics{Qi-j}}{Answer ij}
>
> What I would like is something like
>
> \newproblem{Qi-j}{\includegraphics{=first argument this
> \newproblem}}{Answer ij}
>
> or better yet
>
> \newproblem{= argument \includegraphics in second argument of this
> \newproblem}{\includegraphics{Qi-j}}{Answer ij}
If I understand correctly, you have a file named 22.tex within
question (question/22.tex) that contains several variants each
labeled as Q22-1, Q22-2, etc. Here 22.tex and Q22-1, Q22-2, etc. are
all strings. As they're strings, I'm wondering if we can somehow use
\arabic{counter} to insert a variable into the string... And now that
I'm looking at probsoln.pdf, I'm noting exactly that is shown as a
possibility on page 6.
Now, what are we trying to get probsoln to do? I think where I'm
confused is I don't know what you want to pass via \doforrandN or
\selectrandomly or whatever else you're using that you want to show
up in the problem. Is it that you want to avoid writing all the j
variants, the idea being to pass j as a parameter that internally
changes a single question that has been written? (Basically, j being
used for <nargs>.) And then your problem is using j when naming a
file in \includegraphics? If so, you ought to be able to set a
counter equal to j. Then use \arabic{that counter} in the string in
\includegraphics. Or maybe I have no idea what you're trying to do.
Chris
PS: I do have a vested interest in this. I'm working on building a
bank of questions for all my tests and exams, myself. I'm still
deciding how I want to arrange things, though.------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
More information about the macostex-archives
mailing list