-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Rework how set definition files from OPL and Contrib are shown. #2386
Rework how set definition files from OPL and Contrib are shown. #2386
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I like the new options for including set definition files in OPL and Contrib.
However, you are ridding us of our NPL legacy. Heresy @drgrice1 . ;)
9bd188b
to
f9004a2
Compare
When I tried this and check the box to show OPL defs, I only have this one set def file appear:
So it appears there is only one such file (verified with a But that set def file uses relative paths that don't go through the OPL. It has:
So first of all, that's an OPL issue. This set def should either not be there or use But a |
BTW, it seems that |
I am noticing something with this PR. Check the |
Yes, there is only one set definition file in the OPL. It seems the issue with viewing problems from that set definition file also occurs with webwork 2.18, so that isn't new. I will look into the issue with the select menu. |
edddea8
to
e4e9c52
Compare
The issue with the selection not being preserved is fixed now. |
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).
The default disabled "Select a Set Definition File" needs to always be present so that if an option is no longer available due to one of the "List OPL Sets" or "List Contrib Sets" check boxes being unchecked after selecting one of those set definition files, then the default can be selected again.
page when the available options change.
2d3b546
to
5bb90cd
Compare
The one OPL set definition file would actually work in the library browser if it were one directory higher than where it currently is. Currently the file is located in the directory There is a However, none of those will work if these sets are actually imported in the sets manager since it doesn't have a special case allowing for file names in set definition files to be relative the set definition file location. In fact it doesn't even save the set definition file a set is imported from, so how could it do that. I observed this when I was working on this pull request, and it seems to me that these set definition files should be either removed, or updated to have the |
I'm good with this and can merge it. Any reason not to at this point? |
No reason that I know of. I will probably fix the issue with the library browser dying when a file in a set definition file is not found, but will do that in a separate pull request. |
First, the
WeBWorK::Utils::Instructor::getDefList
method no longer searches in thecapaLibrary
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
anduseContribSetDefs
options indefaults.conf
andlocalOverrides.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 #2361 (and does more).