[LON-CAPA-users] style file

Felicia Berryman lon-capa-users@mail.lon-capa.org
Tue, 09 Dec 2008 12:07:25 -0500


I'm working with someone who is using custom metadata in a problem.  She 
wants to only display the custom metadata for the reference in the problem.

Here is an example problem:
<meta name="color" content="red" />
<meta name="level" content="two" />
<meta name="reference" content="Go Dog Go, PD Eastman, 1961" />
<meta name="shape" content="square" />
<startouttext />Which of the following is a number
<endouttext />
<radiobuttonresponse direction="vertical" id="11" randomize="no">
<foil value="false" name="foilA"><startouttext />A<endouttext /></foil>
<foil value="false" name="foilB"><startouttext />B<endouttext /></foil>
<foil value="true" name="foilC"><startouttext />3<endouttext /></foil>
<foil value="false" name="foilD"><startouttext />D<endouttext /></foil>
<foil value="false" name="foilE"><startouttext />E<endouttext /></foil>

My style file is:
<definetag name="meta" parms="name,content">
<script type="loncapa/perl">
if($name eq 'reference'){$output=$content}
<!-- $var1, $name, and $content display correctly. -->
<web>variable1:$var1, variable2:$var2, output:$output, name:$name, 
content:$content <br /></web>
<!-- tex portions displays all metadata -->
<tex>$name: \verb|$content| \\</tex>

Note that the <script> in the style file breaks the editor.  See
The point of this style file is to print out a library of problems and 
it won't be used in a course, so the potential editor problems shouldn't 
be an issue in this case.

Has anyone else done something like this before?  Any ideas?