Subject: RE: [LON-CAPA-dev] Installing Modules for LON-CAPA

From: "GARRETT, DONNELL MAZON" <[email-masked]>
Date: Mon, 26 Sep 2005 15:01:42 -0400

Hi

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?

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?  

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.

Thank you so much, 
Donnell
-----Original Message-----
From: [email-masked]
[mailto:[email-masked]] On Behalf Of Guy
Albertelli II
Sent: Monday, September 26, 2005 2:21 PM
To: [email-masked]
Subject: Re: [LON-CAPA-dev] Installing Modules for LON-CAPA

Hi Donnell,

> I've emailed Gerd Kortemeyer a few times about maybe trying to extend
> LON-CAPA's math capabilities.  He emailed me back and said that
LON-CAPA
> does in fact have the concept of a library so that new
> functions/subroutines can be added.  This is music to my ears, as I
told
> him.

Gerd was referring to the .libray file in this case (as opposed to the
loading of new chunks of CPAN routines)

The .libray files are meant to be used as a place to contain common
Perl code for reuse in .problems, through the use of <import>

So to use this idea in you desires, you would in fact creat a .library
file taht contains the definitions of a variety of routines to handle
you needs (For example creat your own matrix/complex handling
routines.)

I suspect the sound of that won't make you very happy.

As for this:

> module called Math::Cephes:Matrix on CPAN
> Math::Cephes:Complex on CPAN

(and additional set of routines could be Math::Complex with are part
of the standard perl install)

There is now way for instructor to 'use' an arbitrary CPAN module.

We have specifically not allowed this for a few reasons
1) each CPAN module increases the static size of each apache child,
thus increasing the amount of memory need for Lon-CAPA to run, (and as
each Apache child right now hovers in the 80-100 meg range continued
bloat here could start causing real issues.)

2) we would like for every homework problem to be able to run on any
machine in the network, and when a homework requires new softare to be
installed on the server in order to run, we would start having issues
here.

That said, we aren't completely against adding new CPAN modules, we
just need to make sure that they are worth the costs they'll impose.

I suspect we will need to add a Complex library soon, we have had
several calls for that, (I'm leaning towards Math::Complex) and as it
looks like we are installing the Math::Cephes::Matrix routines, we
likely could add those without much issue.

-- 
[email-masked]   0-7-2-1-27,137
_______________________________________________
LON-CAPA-dev mailing list
[email-masked]
http://mail.lon-capa.org/mailman/listinfo/lon-capa-dev

---

From: Guy Albertelli II <[email-masked]>
Date: Mon, 26 Sep 2005 15:26:41 -0400 (EDT)

Hi Donnell,

> 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
December.

(And it is Lon-CAPA ;-)

> 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)

> .library files?  Until the two modules are installed, that sounds like

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:

<import>/res/domain/user/path/to/new.library</import>

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