[LON-CAPA-users] Style sheets

Guy Albertelli II lon-capa-users@mail.lon-capa.org
Tue, 25 Feb 2003 14:09:41 -0500 (EST)


Hi Ray,

>     Is there a problem in using <displayweight />  for both single part and 
> multipart problems.  i.e. which weight is displayed by <displayweight /> and 
> on what else does it depend?

The current wey that <displayweight /> works is
1) it only will do anything once for a specific problem
2) it displays the weight of the part it is in

I.E.

<problem>
<displayweight />
<part id="11">
<displayweight />
</part>
</problem>

in this case the first display weight will run showing the part 0
weight


<problem>
<part id="11">
<displayweight />
</part>
</problem>

In this case the part 11 weight will be shown


Now that I think about it this isn't a very good solution for
<displayweight />



How about this:


1) <displayweight /> only runs once per part
2) <displayweight /> dosen't run if it exists inside the <problem> tag
in a multipart problem
3) I need to add a new function to the <script> environment &multipart()
   which returns a list of parts if it is a multipart problem and
   undef if it isn't.

Then:

<definetag name="problem">
     <render>
         <tex><problem><displaytitle />
                  <block condition="&multipart()">
                     Points: <displayweight />
                  </block>
	 </tex>
         <web><problem>
               <p><font color="#003399"><displaytitle /></font></p>
               <block condition="&multipart()">
                   <p>Points: <displayweight /></p>
               </block>
         </web>
     </render>
</definetag>
 
<definetag name="/problem">
     <render>
         <tex></problem></tex>
         <web><hr /></problem></web>
     </render>
</definetag>

<definetag name="part" parms="id">
     <render>
         <tex><part id="$id">Points:<displayweight /></tex>
         <web><part id="$id">
                   <p>Points: <displayweight /></p>
         </web>
     </render>
</definetag>

<definetag name="/part">
     <render>
         <tex></part></tex>
         <web><hr /></part></web>
     </render>
</definetag>

-- 
guy@albertelli.com  LON-CAPA Developer  0-7-7-4-