Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contrib .def files shown even if contrib link is removed. #2361

Open
somiaj opened this issue Mar 16, 2024 · 2 comments
Open

Contrib .def files shown even if contrib link is removed. #2361

somiaj opened this issue Mar 16, 2024 · 2 comments

Comments

@somiaj
Copy link
Contributor

somiaj commented Mar 16, 2024

If the Contrib link is removed from the templates directory, the set .def files from Contrib are still shown in the import set menu, but selecting one of the sets causes webwork to error out with:

Can't open file "/opt/webwork/courses/<course_id>/templates/Contrib/CAPA/set40.def": No such file or directory at /opt/webwork/webwork2/lib/WeBWorK/File/SetDef.pm line 297. 

It may not be proper to remove this link, but since I don't use Contrib problems I was removing it to hopefully limit the number of .def files shown, and ran across this.

@drgrice1
Copy link
Sponsor Member

You should not remve the Contrib link. If you don't want the Contrib set definition files to appear, just set $options{useContribDefFiles} = 0 in localOverrides.conf.

@drgrice1
Copy link
Sponsor Member

Note there is also an option to not show OPL set definition files. It is $options{useOPLdefFiles}.

I am planning to make it so that the links are no longer in the modelCourse, and links are created as needed in the course templates directory (or better instead of links at all find a better way of providing access to the files provided by the links).

drgrice1 added a commit to drgrice1/webwork2 that referenced this issue Mar 31, 2024
First, the `WeBWorK::Utils::Instructor::getDefList` method no longer
searches in the `capaLibrary` directory (if that link exists in the
course's templates directory).  Those set definition files are in
Contrib, and so are already listed when the set definition files in
Contrib are listed.  That method also now sorts first by library, then
depth, and then upper case set name.  The library order is first local
set definitions (anything not in Library or Contrib), then the one set
in Library, and then the sets in Contrib. The method also does not
return the Library or Contrib set definitions at all unless the Library
or Contrib links exist and are readable in the course's templates
directory.

Next, the `useOPLsetDefs` and `useContribSetDefs` options in
`defaults.conf` and `localOverrides.conf.dist` have been removed, and
are no longer honored.  Instead there are now check boxes in the import
form on the "Sets Manager" page and when viewing set definition files in
the "Library Browser" that when checked include the set definition files
from OPL or Contrib. The check boxes are not checked by default. These
check boxes are not shown if the Library or Contrib links do not exist
or are not readable.

The "Include OPL" and "Include Contrib" check boxes that determine if
OPL or Contrib problems are included when listing problems on the "Open
Problem Library" page of the library browser were moved from the "View
Problems" line below to below the buttons on the right, and are only
shown when browsing OPL problems, and not for all of the other buttons
(like "Course Files", "Course Sets", "Set Definitions Files", etc.) for
which those check boxes do not apply.

This fixes issue openwebwork#2361 (and does more).
drgrice1 added a commit to drgrice1/webwork2 that referenced this issue Apr 4, 2024
First, the `WeBWorK::Utils::Instructor::getDefList` method no longer
searches in the `capaLibrary` directory (if that link exists in the
course's templates directory).  Those set definition files are in
Contrib, and so are already listed when the set definition files in
Contrib are listed.  That method also now sorts first by library, then
depth, and then upper case set name.  The library order is first local
set definitions (anything not in Library or Contrib), then the one set
in Library, and then the sets in Contrib. The method also does not
return the Library or Contrib set definitions at all unless the Library
or Contrib links exist and are readable in the course's templates
directory.

Next, the `useOPLsetDefs` and `useContribSetDefs` options in
`defaults.conf` and `localOverrides.conf.dist` have been removed, and
are no longer honored.  Instead there are now check boxes in the import
form on the "Sets Manager" page and when viewing set definition files in
the "Library Browser" that when checked include the set definition files
from OPL or Contrib. The check boxes are not checked by default. These
check boxes are not shown if the Library or Contrib links do not exist
or are not readable.

The "Include OPL" and "Include Contrib" check boxes that determine if
OPL or Contrib problems are included when listing problems on the "Open
Problem Library" page of the library browser were moved from the "View
Problems" line below to below the buttons on the right, and are only
shown when browsing OPL problems, and not for all of the other buttons
(like "Course Files", "Course Sets", "Set Definitions Files", etc.) for
which those check boxes do not apply.

This fixes issue openwebwork#2361 (and does more).
drgrice1 added a commit to drgrice1/webwork2 that referenced this issue Apr 10, 2024
First, the `WeBWorK::Utils::Instructor::getDefList` method no longer
searches in the `capaLibrary` directory (if that link exists in the
course's templates directory).  Those set definition files are in
Contrib, and so are already listed when the set definition files in
Contrib are listed.  That method also now sorts first by library, then
depth, and then upper case set name.  The library order is first local
set definitions (anything not in Library or Contrib), then the one set
in Library, and then the sets in Contrib. The method also does not
return the Library or Contrib set definitions at all unless the Library
or Contrib links exist and are readable in the course's templates
directory.

Next, the `useOPLsetDefs` and `useContribSetDefs` options in
`defaults.conf` and `localOverrides.conf.dist` have been removed, and
are no longer honored.  Instead there are now check boxes in the import
form on the "Sets Manager" page and when viewing set definition files in
the "Library Browser" that when checked include the set definition files
from OPL or Contrib. The check boxes are not checked by default. These
check boxes are not shown if the Library or Contrib links do not exist
or are not readable.

The "Include OPL" and "Include Contrib" check boxes that determine if
OPL or Contrib problems are included when listing problems on the "Open
Problem Library" page of the library browser were moved from the "View
Problems" line below to below the buttons on the right, and are only
shown when browsing OPL problems, and not for all of the other buttons
(like "Course Files", "Course Sets", "Set Definitions Files", etc.) for
which those check boxes do not apply.

This fixes issue openwebwork#2361 (and does more).
drgrice1 added a commit to drgrice1/webwork2 that referenced this issue Apr 13, 2024
First, the `WeBWorK::Utils::Instructor::getDefList` method no longer
searches in the `capaLibrary` directory (if that link exists in the
course's templates directory).  Those set definition files are in
Contrib, and so are already listed when the set definition files in
Contrib are listed.  That method also now sorts first by library, then
depth, and then upper case set name.  The library order is first local
set definitions (anything not in Library or Contrib), then the one set
in Library, and then the sets in Contrib. The method also does not
return the Library or Contrib set definitions at all unless the Library
or Contrib links exist and are readable in the course's templates
directory.

Next, the `useOPLsetDefs` and `useContribSetDefs` options in
`defaults.conf` and `localOverrides.conf.dist` have been removed, and
are no longer honored.  Instead there are now check boxes in the import
form on the "Sets Manager" page and when viewing set definition files in
the "Library Browser" that when checked include the set definition files
from OPL or Contrib. The check boxes are not checked by default. These
check boxes are not shown if the Library or Contrib links do not exist
or are not readable.

The "Include OPL" and "Include Contrib" check boxes that determine if
OPL or Contrib problems are included when listing problems on the "Open
Problem Library" page of the library browser were moved from the "View
Problems" line below to below the buttons on the right, and are only
shown when browsing OPL problems, and not for all of the other buttons
(like "Course Files", "Course Sets", "Set Definitions Files", etc.) for
which those check boxes do not apply.

This fixes issue openwebwork#2361 (and does more).
drgrice1 added a commit to drgrice1/webwork2 that referenced this issue Apr 13, 2024
First, the `WeBWorK::Utils::Instructor::getDefList` method no longer
searches in the `capaLibrary` directory (if that link exists in the
course's templates directory).  Those set definition files are in
Contrib, and so are already listed when the set definition files in
Contrib are listed.  That method also now sorts first by library, then
depth, and then upper case set name.  The library order is first local
set definitions (anything not in Library or Contrib), then the one set
in Library, and then the sets in Contrib. The method also does not
return the Library or Contrib set definitions at all unless the Library
or Contrib links exist and are readable in the course's templates
directory.

Next, the `useOPLsetDefs` and `useContribSetDefs` options in
`defaults.conf` and `localOverrides.conf.dist` have been removed, and
are no longer honored.  Instead there are now check boxes in the import
form on the "Sets Manager" page and when viewing set definition files in
the "Library Browser" that when checked include the set definition files
from OPL or Contrib. The check boxes are not checked by default. These
check boxes are not shown if the Library or Contrib links do not exist
or are not readable.

The "Include OPL" and "Include Contrib" check boxes that determine if
OPL or Contrib problems are included when listing problems on the "Open
Problem Library" page of the library browser were moved from the "View
Problems" line below to below the buttons on the right, and are only
shown when browsing OPL problems, and not for all of the other buttons
(like "Course Files", "Course Sets", "Set Definitions Files", etc.) for
which those check boxes do not apply.

This fixes issue openwebwork#2361 (and does more).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants