<div dir="ltr"><div><div><div><div><div>I like to use it with the sty file together with css file. Each time it encounters a part tag, I like it to display<br><br></div>Part A<br><br></div>and then automatically increments the counter. However, some problems have only one part but have the part tag (even though it is not need). In that case I do not want to display "Part A". So my thought is if there is only one part, the script within the sty file can bypass the display.<br>
<br></div>It would be great if visibleparts can be incorporated in the EXT function. This will make it more robust.<br><br></div>Thanks,<br></div>-hk<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 30, 2013 at 7:00 PM, Stuart Raeburn <span dir="ltr"><<a href="mailto:raeburn@msu.edu" target="_blank">raeburn@msu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Hi,<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there a way to determine the number of parts in a problem using the EXT<br>
function? or the part order?<br>
</blockquote>
<br></div>
No, not currently.<br>
<br>
Could you provide more details of how and where you would like to use this information?<br>
<br>
The expression: &EXT('resource.0.hiddenparts')<u></u>; will give you a list of part IDs of hidden parts (set via Parameter) for the current user.<br>
<br>
I could also add an additional item to lonnet::EXT(), e.g., accessible via: &EXT('resource.visibleparts'), to return a comma-separated list of part IDs for parts viewable by the current user (in course context). The implementation would make use of $res->parts() from <a href="http://lonnavmaps.pm" target="_blank">lonnavmaps.pm</a><br>

<br>
On a separate note, when authoring a problem you can also set up a counter in the problem itself, e.g., at the beginning of the problem you could include:<br>
<script type="loncapa/perl">$numparts = 0; </script><br>
<br>
and then include an additional script block within each part containing:<br>
<script type="loncapa/perl">$numparts ++; </script><br>
<br>
The total number of displayed parts would then be available after all parts had been parsed.<br>
<br>
<br>
Stuart Raeburn<br>
LON-CAPA Academic Consortium<div><div class="h5"><br>
<br>
<br>
Quoting hkng <<a href="mailto:hkng@fsu.edu" target="_blank">hkng@fsu.edu</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Is there a way to determine the number of parts in a problem using the EXT<br>
function? or the part order?<br>
<br>
Thanks,<br>
-hk<br>
<br>
</blockquote>
<br></div></div>
______________________________<u></u>_________________<br>
LON-CAPA-users mailing list<br>
<a href="mailto:LON-CAPA-users@mail.lon-capa.org" target="_blank">LON-CAPA-users@mail.lon-capa.<u></u>org</a><br>
<a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users" target="_blank">http://mail.lon-capa.org/<u></u>mailman/listinfo/lon-capa-<u></u>users</a><br>
<br>
<br>
</blockquote></div><br></div>