# [LON-CAPA-users] CAPA translator

Robert McQueen lon-capa-users@mail.lon-capa.org
Sun, 17 Mar 2002 15:46:01 -0500

Hi All {{Happy Very Belated Birthday Felicia}} :D

I have an old question that popped into mind while revisiting the
problem conversion script we use here at OU.  How does one handle the
situation below?  Is there a way to do it other than using <display> tags?
---------------------
ORIGINAL CAPA FORMAT:
---------------------
/LET N11=random(1,4)
/DIS(tex("\vskip .10in ","")) /DIS(tex("\input
/OUp200lib/pictures/set8tab",""))
/DIS(var_in_tex(N11))/DIS(tex(".tex",""))  /DIS(tex("\end{center}",""))

---------------------
LON-CAPA FORMAT:
---------------------
<script type="loncapa/perl">
$N11=&random(1,4); </script> <startouttext /><hr /> <tex>\vskip .10in \input /OUp200lib/pictures/set8tab$N11.tex\end{center}</tex>
<endouttext />
---------------------
This would not work because of the misinterpretation of the "$" sign, correct? Can one intermix <display> tags and <tex> tags such as shown below? --------------------- LON-CAPA FORMAT: --------------------- <script type="loncapa/perl">$N11=&random(1,4);
</script>
<startouttext /><hr />
<tex>\vskip .10in \input
/OUp200lib/pictures/set8tab}</tex><display>&var_in_tex($N11)</display><tex>.tex\end{center}</tex> <endouttext /> --------------------- To me it seems that the first version I specified in LON-CAPA format would be a lot more legible and intuitive but does not work. Is there a <varintex>/<texvar> tag? Is there one being developed? A possible solution would be to have such an xml tag be a child element of <tex> to delimit variables and/or have it be able to stand on it's own. One could also have two tags, such as <var> and <varintex>, where <var> would only be a child of <tex> and <varintex> would be able to stand-alone or also be a child of <tex> and have the same capability of <var>. Or one could not have <var>, just <varintex>...whatever floats your boat. ;) I know the above description may be a bit confusing, sorry about that. But the 3 possible formats are shown below for clarity: --------------------- LON-CAPA FORMAT 1: --------------------- <script type="loncapa/perl">$N11=&random(1,4);
</script>
<startouttext /><hr />
<tex>\vskip .10in \input
/OUp200lib/pictures/set8tab<var>$N11</var>.tex\end{center}</tex> <endouttext /> --------------------- Format 1 utilizes the <var> implementatation. --------------------- LON-CAPA FORMAT 2: --------------------- <script type="loncapa/perl">$N11=&random(1,4);
</script>
<startouttext /><hr />
<tex>\vskip .10in \input
/OUp200lib/pictures/set8tab}</tex><varintex>$N11</varintex><tex>.tex\end{center}</tex> <endouttext /> --------------------- Format 2 utilized <varintex> as a stand-alone tag. --------------------- LON-CAPA FORMAT 3: --------------------- <script type="loncapa/perl">$N11=&random(1,4);
</script>
<startouttext /><hr />
<tex>\vskip .10in \input
/OUp200lib/pictures/set8tab}<varintex>\$N11</varintex>.tex\end{center}</tex>
<endouttext />
---------------------
Format 3 utilizes <varintex> as a child of <tex>.  My idea would be to
either have all 3 formats be available or at least the last 2.  How does
this sound?
---------------------

Later.

Robert M.
Ohio University

>From: Felicia Berryman <felicia@lon-capa.org>
>To: lon-capa-users@mail.lon-capa.org
>Subject: Re: [LON-CAPA-users] CAPA translator
>Date: Thu, 07 Mar 2002 14:39:38 -0500
>
>Hi Ray,
>
> > <m> is good but there seem to be various things that don't translate
>well.
> >  So I expect to be relying on <web> and <tex> tags a bit.
> > I believe  that <web> and <tex>  are supposed to work respectively to
>send
> > output to  the HTML parser (for the web only) and to the TeX parser (for
> > printing only).  If that is not how they work I would like to know.
>
>That is how they work.
>
> >   Anyway, I eagerly await  PRT to see how this all pans out in practice.
> > I am trusting that the &web function (in particular) will work well.
> > If there is a better way to do what Hon-Kie is asking about, I'd also
>like to
> > know.
>
>In my opinion, I don't think it really matters how you convert.  You can
>let a script do as much as possible and get things done quickly with
>less people, but you will probably have hard to read code.  On the other
>hand, you can do the opposite extreme and have your problems look more
>LON-CAPA than CAPA, but it will take more time.  In either case, you can
>get problems to be usable.  Please note, that certain HTML tags, such as
><b>, will be converted to TeX from the PRT button.  I've directed my
>students to use html if possible.  I did this mostly, because I have a
>bad habit of avoiding TeX (so I can't teach them much) and I figure that
>the trend will be that students will not expect a printout.
>
>Felicia
>--
>Felicia Berryman
>LON-CAPA Coordinator
>Michigan State University
>   Email:  felicia@lon-capa.org
>   Phone:  (517)432-9866
>http://www.lon-capa.org
>_______________________________________________
>LON-CAPA-users mailing list
>LON-CAPA-users@mail.lon-capa.org
>http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

_________________________________________________________________