-
-
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
Load OPL set definitions from files instead of searching the OPL directory. #1653
Load OPL set definitions from files instead of searching the OPL directory. #1653
Conversation
30e04f8
to
af33320
Compare
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.
It works for me, and should speed up the loading of the set editor.
I'm not sure the location where the file is being saved should be in htdocs
as no remote use of the files are apparently being planned. The data is just loaded by code in lib/WeBWorK/ContentGenerator/Instructor.pm
.
bin/generate-OPL-set-def-lists.pl
Outdated
depth_then_iname_sort(\@contrib_set_defs); | ||
|
||
# Write the lists to the files in htdocs/DATA. | ||
if ($ce->{options}{useOPLdefFiles}) { |
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.
I do not think the creation of the JSON files should depend on these variables.
Some courses could override the default set in defaults.config
so the files should always be available on the server.
The file is saved in Yeah, I thought of the issue of a course overriding the default. I will remove that check. |
6c5d956
to
2eb32f5
Compare
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.
Works great!
2eb32f5
to
688c630
Compare
…ctory. This is done in the getDefList method of lib/WeBWorK/ContentGenerator/Instructor.pm. The only time that method is called is when the homework sets editor is loaded. Note that the course's templates directory is still searched, but the Library and Contrib subdirectories are pruned and so not look into. A new script `bin/generate-OPL-set-def-lists.pl` is created that generates the needed data files by searching the OPL directory. Note that this script is executed by `bin/OPL-update`. For now, this script is executed in docker-entrypoint.sh when the docker container is started. However, these files should be added to the OPL release built by webwork2/bin/OPL_releases/release.sh, and dealt with in the same way as the other files in webwork2/htdocs/DATA. Of course, that whole process needs to be updated and removed from the personal fork it is currently in. The release there is now more than two years old. The defaults.config option $option{useOPLdefFiles} still is checked to determine if OPL set defintion files will be loaded and listed, but note that the $options{setDefSearchDepth} is ignored for this. The new defaults.config option $option{useContribDefFiles} determines if set definition files from the Contrib directory will be loaded and listed. This also ignores depth. So the search depth option only applies to local directories for the course.
generate both set def list files.
loads the set definitions for the "Set Definition Files" part, and remove the method it was using that was not as full featured.
688c630
to
1ecdb0d
Compare
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.
This sped up the loading of the HW sets editor for me by an order of magnitude.!!! Yeah.
This is done in the getDefList method of lib/WeBWorK/ContentGenerator/Instructor.pm. The only time that method is called is when the homework sets editor is loaded. Note that the course's templates directory is still searched, but the Library and Contrib subdirectories are pruned and so not look into.
A new script
bin/generate-OPL-set-def-lists.pl
is created that generates the needed data files by searching the OPL directory. Note that this script is executed bybin/OPL-update
. For now, this script is executed in docker-entrypoint.sh when the docker container is started. However, these files should be added to the OPL release built by webwork2/bin/OPL_releases/release.sh, and dealt with in the same way as the other files in webwork2/htdocs/DATA. Of course, that whole process needs to be updated and removed from the personal fork it is currently in. The release there is now more than two years old.The defaults.config option $option{useOPLdefFiles} still is checked to determine if OPL set defintion files will be loaded and listed, but note that the $options{setDefSearchDepth} is ignored for this. The new defaults.config option $option{useContribDefFiles} determines if set definition files from the Contrib directory will be loaded and listed. This also ignores depth. So the search depth option only applies to local directories for the course.