[LON-CAPA-dev] Installing Modules for LON-CAPA

Guy Albertelli II lon-capa-dev@mail.lon-capa.org
Mon, 26 Sep 2005 15:26:41 -0400 (EDT)

Hi Donnell,

> That sounds great about you adding Math::Complex and
> Math::Cephes::Matrix.  If those were added, I'm sure that 99% of our
> problems would go away.  Is there any way you can tell me when you plan
> to implement those two (or similar modules) into CAPA?

Any changes like this are very unlikely to occur before our next
non-bugfix release. That next release like that will be version 2.1 in

(And it is Lon-CAPA ;-)

> Also, I understand about not allowing for arbitrary modules to be added
> into the CAPA problem sets, that makes sense.  However, how is that
> different from a .library file?  For now, until you guys add
> Math::Complex and Math::Cephes::Matrix (or similar modules), the
> .library route seems to be the way to go.  With the .library file, it
> sounds like we can create our own functions that we can deploy
> throughout our .problem sets.  That sounds good, since that was I was
> originally after to begin with.  However, I am a bit confused.  How is
> adding a .library file not add bloat while a module does?  

Each .library file is parsed at the time of and <import> and used
then, and the resulting information is thrown away at the end of the
.problem evaluation.

This means slowerish homework problems. (Since more time is spent
parsing and compiling Perl code.) (Although the difference here can be
is the hunderths of a second range, depending on homw much code is in
a .library)

> Where can I find information about the creation and installation of
> .library files?  Until the two modules are installed, that sounds like
> how we should proceed.

They basically work just like a .problem 

1) in CSTR select the option 'New library file' and type in a name,
click Go
2) Click Continue
3) Select a template from the list ('Basic Script library' is probably
what you want
4) Edit or EdiXML it
5) stick sub or other variable definitions in to the <script> 
6) publish it

Then in a .problem insert:


After the <import> All subsequent <script> can use the sub and
variable definitions from the <library>

guy@albertelli.com   0-7-2-1-27,137