openwebwork / webwork2

Course management front end for WeBWorK
http://webwork.maa.org/wiki/Main_Page
Other
143 stars 165 forks source link

Problem library symlinks broken when using Docker #1016

Open jerrac opened 4 years ago

jerrac commented 4 years ago

Setting up problem libraries when using Docker seems off to me. An instructor was having issues with a problem set, the issue was that webwork wasn't able to find the OpenProblemLibrary/ASU-topics directory. After some work I found that the course template was expecting a symlink from templates/Library to OpenProblemLibrary in the OPL directory.

There are instructions on setting this up for a non-docker system here: http://webwork.maa.org/wiki/Installation_Manual_for_2.12_on_Ubuntu_16.04#Install_the_Open_Problem_Library I'm assuming they apply to 2.15 just as well as 2.12.

Where in the Docker setup process should the mentioned links be created? Did I miss some docs somewhere?

Oh, and shouldn't the symlinks that have been committed to git here: https://github.com/openwebwork/webwork2/tree/WeBWorK-2.15/courses.dist/modelCourse/templates point at a slightly different location? If the Library symlink is supposed to point at https://github.com/openwebwork/webwork-open-problem-library/tree/master/OpenProblemLibrary, then shouldn't the other two be pointed a directory above OpenProblemLibrary?

Apologies for any incoherence, I was in a meeting while diagnosing all this and it's left me a bit out of it.

taniwallach commented 4 years ago

As far as I know, problem "paths" should refer to Library/x/y/z.pg and not to OpenProblemLibrary/x/y/z.pg as the standard installation assumes that the name of the symbolic link is just Library and this is what is set up in the model course, etc.

The installation instructions you referred to have:

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

for exactly that reason.

There is code to automatically create the symbolic link for Library when necessary: see the browse_library_panel subroutine in SetMaker2.pm so there is no need to create this link in the Git repository or in the Docker setup.

You might be able to "bypass" your issue by adding an extra symbolic link with the name OpenProblemLibrary in the template directory but would also probably need to add some settings to localOverrides.conf to add that as an additional library.

mgage commented 4 years ago

It's possible to create additional symlinks to libraries for local use. We used to have a rochesterLibrary symlink that pointed to OPL/Rochester directly and had many problem set definition files that used those paths. It's convenient for cases where a school or course has curated a collection of problems they want used for a course and wish to direct new instructors for the course to the already vetted collection. Such usage also makes portability problematic. We should remove those special case arrangements from the general distribution as we find them. This will become a bigger issue as we try to create tools so that an instructor at one school can easily transfer their course homework sets to a colleague at another school.

jerrac commented 4 years ago

So, the long term solution would be to ask instructors to update their problem sets with paths based on the Library symlink to OPL?

jerrac commented 4 years ago

Ok, so, in my localOverrides file, I have this:

$courseFiles{problibs}    = {
    Library          => "OPL Directory",
    capaLibrary      => "CAPA",
    Contrib          => "Contrib",
# the following are not really needed but you can
# create links to your own private libraries this way.
    rochesterLibrary => "Rochester",
    unionLibrary     => "Union",
    asuLibrary       => "Arizona State",
    dcdsLibrary      => "Detroit CDS",
    dartmouthLibrary => "Dartmouth",
    indianaLibrary   => "Indiana",
    osuLibrary       => "Ohio State",

};

From the comments above that section in the conf file, that should create buttons in the Library browser for each of those libraries.

The only button from that list that shows up is "OPL Directory".

That is because the only unbroken symlink in the templates directory is the "Library" symlink pointed at <opl>/OpenProblemLibrary.

To get, say "Ohio State" to show up, I'd need a symlink called osuLibrary in the templates directory pointed at <opl>/OpenProblemLibrary/OSU. Right?

All that said, it does sound like the Library symlink is all I really need for anything in the <opl>/OpenProblemLibrary directory. But that doesn't cover anything in <opl>/Contrib. The symlinks that are in git to Contrib and CAPA are broken because they try to use the Library symlink that is pointed a directory down from the actual Contrib directory.

So, what would be the long term solution to enabling Contrib?

mgage commented 4 years ago

I think you can create a link along the lines of ln -s /opt/webwork/libraries/webwork-open-problem-library/Contrib Contrib

This will make the Contrib button work. I'm willing to consider making this a standard part of the set up for the docker download.