WeBWorK Problems

Unable to locate AnswerFormatHelp.pl macro

Unable to locate AnswerFormatHelp.pl macro

by Erin McNelis -
Number of replies: 6

I recently upgraded the OPL on our WW server (about 2 weeks ago).  I am noticing problems in homework sets copied from a previous course as well as when browsing the OPL.  The error is one I've seen in the forums:

Can't locate macro file |AnswerFormatHelp.pl| via path: |.|,
|[TMPL]/macros|,
|[PG]/macros/|,
|[TMPL]/Library/macros/Union|,
|[TMPL]/Library/macros/Michigan|,
|[TMPL]/Library/macros/CollegeOfIdaho|,
|[TMPL]/Library/macros/FortLewis|,
|[TMPL]/Library/macros/TCNJ|,
|[TMPL]/Library/macros/NAU|,
|[TMPL]/Library/macros/Dartmouth|,
|[TMPL]/Library/macros/WHFreeman|,
|[TMPL]/Library/macros/UMass-Amherst|

But the answers I've found don't seem to help.  The course whose homework set indicated problems was not made from the modelCourse, and going to the Library from within the course didn't seem to remedy the situation as in this forum post.  I also tried updating the localOverides.conf file as mentioned in this forum post, but with no luck.

When I go to the server and check the 

/opt/webwork/library/webwork-open-problem-library/OpenProblemLibrary/macros/FortLewis directory, I do see AnswerFormatHelp.pl.

Any suggestions on what I need to update or change so that the Library problems can find the AnswerFormatHelp.pl macro?  Thank you!

Best wishes,

Erin McNelis (pitiful replacement WW admin for Geoff Goehle at WCU)

In reply to Erin McNelis

Re: Unable to locate AnswerFormatHelp.pl macro

by Alex Jordan -

An emergency solution is to copy that macros file to your course's macros folder. That is not a good solution though in case that macro library is edited in the repository over time.

Is the course able to see other things in the OPL? For example when you go to the Library Browser and view the OPL, do exercises appear? It would be strange for exercises to be visible, but the OPL macros folder to not be.

Maybe check the permissions of the OPL and its relevant subfolders. For example, maybe the permissions on OpenProblemLibrary/macros have been accidentally restricted. They should be readable by all, or at least by the wwadmin group.

Now if the course is really not seeing the OPL at all, does the course's templates/ folder have a symlink "Library", and does that correctly point to the OPL? To check, log in to the server and change directory to:

/opt/webwork/courses/name-of-the-course/templates

and do:

ls -l Library

For example, I get:

lrwxrwxrwx 1 www-data wwdata 71 Aug 14  2014 Library -> /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/

indicating the symlink "Library" is there and pointing to the right place. If the course doesn't have this, then you need to add a symlink. While in that course's templates/ folder, do:

ln -s /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary Library

Double check that path is right for your setup, and check the permissions on the resulting link.

Hope something here helps,
Alex

In reply to Alex Jordan

Re: Unable to locate AnswerFormatHelp.pl macro

by Erin McNelis -

Hi Alex,

I am able to see problems in the OPL from the Library Browser.  Also, when I check permissions on 

/opt/webwork/library/webwork-open-problem-library files I get the following for the macros folder

drwxrwxr-x  22 emcnelis wwadmin         4096 Dec 17  2018 macros

which seems to tell me it should be executable.

When I switch to the courses templates folder I get:

[emcnelis@webwork2 templates]$ ls -l Library

lrwxrwxrwx 1 apache wwdata 69 Aug 11 14:49 Library -> /opt/webwork/library/webwork-open-problem-library/OpenProblemLibrary/

This seemed to be what was needed, right?

I know one of the posts I referenced said the AnswerFormatHelp.pl is actually a contribution to the OPL from Fort Lewis and doesn't live in pg/macros.  Is the fact that the symbolic link to the Library exists in my course templates folder supposed to be what allows AnswerFormatHelp.pl to be accessible by the problems?

Thanks for your ideas,

Erin


In reply to Erin McNelis

Re: Unable to locate AnswerFormatHelp.pl macro

by Alex Jordan -

> This seemed to be what was needed, right?

That looks right *if* that is really the path to the OPL on your system. Can you verify that?

> Is the fact that the symbolic link to the Library exists in my course templates folder supposed to be what allows AnswerFormatHelp.pl to be accessible by the problems?

Yes. Note the error message indicates it is looking in places like [TMPL]/Library/...  that [TMPL] is your course's templates/ folder and then into Library and so on. Navigate into your course's templates folder and check if the following works as intended:

ls Library/macros/FortLewis

Does it show AnswerFormatHelp.pl?

Remember there is the emergency fallback option to put a copy of the macro library somewhere else like in the course's macros folder. Or maybe better, a symlink from there to the real one.

In reply to Alex Jordan

Re: Unable to locate AnswerFormatHelp.pl macro

by Erin McNelis -

Here's what I have in my courses/templates/Library etc folder.  I'm noticing that 

[emcnelis@webwork2 FortLewis]$ pwd

/opt/webwork/courses/Math320Fall20McNelis/templates/Library/macros/FortLewis

[emcnelis@webwork2 FortLewis]$ ls -l

total 176

-rwxrwxr-x 1 emcnelis wwadmin       9041 Jun  5  2013 AnswerFormatHelpHTML.tgz

-rwx------ 1 emcnelis domain users 63898 Aug 10 16:14 AnswerFormatHelp.pl

-rwxrwxr-x 1 emcnelis wwadmin       3814 Dec 22  2015 ConditionalHint.pl

-rwxrwxr-x 1 emcnelis wwadmin       6318 Jun  5  2013 JavaView.pl

-rwxrwxr-x 1 emcnelis wwadmin      15582 Jun  5  2013 JavaViewRectangularPlot3D.pl

-rwxrwxr-x 1 emcnelis wwadmin       6034 Jun  5  2013 LiveGraphicsCylindricalPlot3D.pl

-rwxrwxr-x 1 emcnelis wwadmin       5514 Jun  5  2013 LiveGraphicsParametricCurve3D.pl

-rwxrwxr-x 1 emcnelis wwadmin       7477 Jun  5  2013 LiveGraphicsParametricSurface3D.pl

-rwxrwxr-x 1 emcnelis wwadmin      12176 Jun  5  2013 LiveGraphicsRectangularPlot3D.pl

-rwxrwxr-x 1 emcnelis wwadmin       6528 Jun  5  2013 LiveGraphicsVectorField2D.pl

-rwxrwxr-x 1 emcnelis wwadmin       7922 Jun  5  2013 LiveGraphicsVectorField3D.pl

-rwxrwxr-x 1 emcnelis wwadmin       6412 Dec 19  2013 MatrixUnimodular.pl

-rwxrwxr-x 1 emcnelis wwadmin       5000 Dec 22  2015 PeriodicRerandomization.pl

-rwxrwxr-x 1 emcnelis wwadmin       3309 Jun  5  2013 VectorField2D.pl

I wasn't sure why the permissions and roles are different for AnswerFormatHelp.pl.  It seems it was changed in my upgrade of our OPL.

Although I can put a copy in my course files, this won't help others using WeBWorK this semester.  I think we have about 20 courses used by faculty right now, and I'm guessing they'll have similar problems if people tried to use the AnswerFormatHelp.pl macro.

Also,

> That looks right *if* that is really the path to the OPL on your system. Can you verify that?

It seems as if that's pointing to the right spot.  I would assume the OPL on my system is given by the following directory:

[emcnelis@webwork2]$ ls /opt/webwork/library/webwork-open-problem-library/OpenProblemLibrary/

270                LoyolaChicago  OKState                    UBC

272                ma112DB        OPES                       UCSB

274                ma117DB        OPL_global_statistics.sql  UMass-Amherst

AlfredUniv         ma122DB        org.sparta                 UMN

ASU-topics         ma123DB        OSU                        Union

BentleyUniversity  maCalcDB       PCC                        Utah

Berkeley           macros         Piedmont                   UVA-FinancialMath

CollegeOfIdaho     MC             Rochester                  UVA-Stat

CSUN               METU-NCC       SaintMichaels              UVA-Stew5e

CSUOhio            MiamiUOhio     SDSU                       Valdosta

Dartmouth          Michigan       Simpson                    VERSION

FortLewis          Misc           SUNYSB                     Westmont

GRPS               Mizzou         Taxonomy                   WHFreeman

Hope               MontanaState   Taxonomy2                  Wiley

Indiana            NAU            TCNJ                       WinonaState

JFreeman           NewHampshire   test_problems

LaTech             NUIG           Textbooks


In reply to Erin McNelis

Re: Unable to locate AnswerFormatHelp.pl macro

by Alex Jordan -

Aha, the permissions on that file are not set correclty.

You can manually fix that file's permissions, or I believe that in webwork2/bin, there is a utility you can run that sets OPL file permissions. I forget what it is called, but look in that folder and see if something stands out.

In reply to Alex Jordan

Re: Unable to locate AnswerFormatHelp.pl macro

by Erin McNelis -

Thank you for your help and patience, Alex.  I *think* that did it.  Thank you for the pointer to webwork2/bin.  I looked in the setfilepermissions utility and changed permissions with chmod 755 based on the line

system("chmod -R 755 $libroot");