WeBWorK Problems

Missing macro files

Missing macro files

by Lars Jensen -
Number of replies: 9
Hi Everyone,

The webwork distribution seems to be missing some macro files for some of the recently contributed problems. Foe example,

(1) When I view Library/FortLewis/Algebra/2-2-Distributive-law/MCH1-2-2-16-Distributive-law.pg I get this error: Can't locate macro file |contextPolynomialFactors.pl

(2) When I view Library/FortLewis/Algebra/6-1-Exponent-rules/MCH1-6-1-02-Exponent-rules.pg I get this error:

Can't locate object method "new" via package "ChoiceList" (perhaps you forgot to load "ChoiceList"?) at line 116 of [TMPL]/Library/macros/Union/alignedChoice.pl Died within AlignedList::new called at line 106 of [TMPL]/Library/macros/Union/alignedChoice.pl from within main::new_aligned_list called at line 53 of [TMPL]/Library/FortLewis/Algebra/6-1-Exponent-rules/MCH1-6-1-02-Exponent-rules.pg

(3) viewing Library/NewHampshire/unh_schoolib/Order_of_Operations/oopbrm101.pg results in the error: Can't locate macro file |contextLeadingZero.pl

Where can I find the necessary files?

The problems in Library/FortLewis/Algebra/5-6-Linear-systems makes the browser hang - they won't show at all.

Lars
In reply to Lars Jensen

Re: Missing macro files

by Jason Aubrey -
Hi Lars,

To solve problem (1) add to this list of paths in $pg{directories}{macrosPath} the line

"$courseDirs{templates}/Library/macros/FortLewis",


(2) This problem stems from running the NationalProblemLibrary trunk and rel-2-4-patches. This has been the recommended set-up, but it seems that changes were introduced into NationalProblemLibrary/macros that assumed a trunk version of pg/lib. In particular, List.pm has been changed to ChoiceList.pm so as not to cause confusion with the name of the file defining the List MathObject. This will get fixed by itself when the new stable release is released and you switch to that.

As a temporary fix, you can revert the NationalProblemLibrary/macros/Union directory to the revision before those changes were introduced (r890) with the command the following command from inside NationalProblemLibrary/macros:

svn up -r890 Union/

Regarding (3), I'm not familiar with those problems, so I don't know what's up, but I'll check it out and let you know if I find a solution.

Hope this helps,
Jason
In reply to Jason Aubrey

Re: Missing macro files

by Lars Jensen -
Hi Jason,

Thanks for the reply.

Regarding (1), this particular file - contextPolynomialFactors.pl - is missing from the macros/FortLewis directory.

When is the new stable release expected to be ready?

Thanks!
Lars.
In reply to Lars Jensen

Re: Missing macro files

by Arnold Pizer -
Hi Lars,

contextPolynomialFactors.pl is found in the svn trunk version (i.e. the old cvs head version) of /pg/macros. It is not in the macros/FortLewis directory.

You might be able to get by by just downloading that file. If that doesn't work, at least it will not affect anything else.

The new stable release should be ready soon although I certainly do not want to define what soon means. Mike will be working on this and he and his wife have a very well deserved vacation coming up soon. So I think it will be toward the end of August at the earliest.

Arnie
In reply to Arnold Pizer

Re: Missing macro files

by Robin Cruz -

I seem to be having a similar problem as Lars.  I've upgraded the pg folder and the National Problem library folder with SVN--I had a pretty current version of everything as of August thanks to Jason's help and I upgraded the two folders again today using (svn up).  I also tried putting the Union macros folder back to version r890 as Jason suggested to Lars.  The error msg I'm getting is slightly different, so it may be a whole different problem.  Here is the error message and the macros loaded in the problem.

--------------Error message--------------------

Can't locate object method "new" via package "List" (perhaps you forgot to load "List"?) at line 115 of (eval 1761) Died within AlignedList::new called at line 105 of (eval 1761) from within main::new_aligned_list called at line 53 of (eval 1593)

Error details

 Problem3 ERROR caught by Translator while processing problem file:Problems/setM151_01_04_Trig_Functions/1.4.4.pg **************** Can't locate object method "new" via package "List" (perhaps you forgot to load "List"?) at line 115 of (eval 1761) Died within AlignedList::new called at line 105 of (eval 1761) from within main::new_aligned_list called at line 53 of (eval 1593) 

--------------Macros--------------------

loadMacros(
    "PGstandard.pl",
    "PGunion.pl",            # Union College utilities
    "MathObjects.pl",
    "alignedChoice.pl",      # for aligned answer blanks
    "PGcourse.pl",           # Customization file for the course
  );
------------------------------------------

Thanks, for your help.

--rac

In reply to Robin Cruz

Re: Missing macro files

by Davide Cervone -
Try adding "choiceMacros.pl" to the loadMacros() list. I think that was in my original version of PGstandard.pl, but it was removed in the version that eventually made it into the pg/macros directory. I think I updated all of the Union problems to account for that, but they may have been copied as the basis for other problems, that now don't work. (Or you may have an out of date copy of the Union library.)

Davide
In reply to Robin Cruz

Re: Missing macro files

by Michael Gage -
Hi Robin and Lars,

I think this is still a mismatch between the versions of macros found in NationalProblemLibrary/macros and the macros found in webwork/pg.

The new (trunk) versions use ChoiceList.pm while the older rel-2-4-7 uses
List.pm.

This shows up most often for NationalProblemLibrary/macros/Union/alignedChoice.pl because it is very commonly used.

In Lars case I believe he had a new version of the Union macros but an older version of pg hence the calls in alignedChoice.pl for ChoiceList were not recognized.

For Robin, I suspect that she has a new version of pg but an older version of the Union/alignedChoice.pl file (one that calls List rather than ChoiceList).

The best solution would probably be for us to move alignedChoice.pl and perhaps a few other heavily used macro files from macros/Union to the pg/macros folder in the svn repository so that they are always updated in sync with the rest of the pg macros.

Any comments on this? Is there a downside?

-- Mike

In reply to Michael Gage

Re: Missing macro files

by Robin Cruz -

FYI:  I updated the Union macros files this morning and am still getting the same error message. The Union macros I have are revision 1516 and my pg files are 6430.

Regards -- rac

In reply to Robin Cruz

Re: Missing macro files

by Michael Gage -
Thanks, that helps.

I've synced to those revisions and can't reproduce the problem.
Since I don't have that problem here -- try looking at
problem #4 of the standard Orientation set. That works fine for me and calls in all of the macro files that your example does. That problem does show errors if the macros/Union files and the pg/macros files are out of sync.

If problem #4 in Orientation is working for you then could you send your problem file and I'll see if I can reproduce the failure here.

-- Mike
In reply to Michael Gage

Re: Missing macro files

by Robin Cruz -

OK.  I found my problem.  I had an old copy of the alignedchoice macro in the course macros folder.  Apparently, it was placed into a course years ago and just came along as new courses were buit from previous ones. 

Thanks, everyone, for your help.  Your suggestions pointed me in the right direction.

--rac