Skip to content

Tani multi library v01 - improved beta version#876

Closed
taniwallach wants to merge 10 commits into
openwebwork:developfrom
taniwallach:tani_multi_library_v01
Closed

Tani multi library v01 - improved beta version#876
taniwallach wants to merge 10 commits into
openwebwork:developfrom
taniwallach:tani_multi_library_v01

Conversation

@taniwallach

Copy link
Copy Markdown
Member

This is an improved beta version of multi-library support for the library search tools (SetMaker.pm) replacing #874.

  • The library configuration is more complicated than before, so that multiple libraries can be supported.
  • Each library requires several settings. Several files which read library settings were modified to use the new library config structure.
  • Sample settings are in conf/localOverrides.conf.dist
  • The modified OPL-update script expects the library "code name" as in the config settings, and the second library and on should set the noDrop option (to prevent deletion of the database tables shared by all the libraries).
  • The sample config file assumes that the course/templates directory will have symlinks to the libraries.
  • Sample test libraries are available at https://github.com/taniwallach/ww-test-libs

Example setup using the test libraries (including OPL update on 3 libraries):

# cd into the course directory
cd templates
ln -s /opt/webwork/libraries/tl-01  TestLibrary1
ln -s /opt/webwork/libraries/tl-02  TestLibrary2
ln -s /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary   Library
/opt/webwork/webwork2/bin/OPL-update local OPL
/opt/webwork/webwork2/bin/OPL-update local TSTL1 noDrop
/opt/webwork/webwork2/bin/OPL-update local TSTL2 noDrop

Known issue:

  • Do a search on All Libraries and it should show a correct count of problems.
  • Then change back to All Subjects (the count should update properly).
  • The click on View Problems
  • The correct set of problems should be displayed.
  • but the count will be incorrect and the selections will have changes.
  • I currently do not understand how this is happening.

Nathan Wallach added 10 commits August 13, 2018 15:08
	lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
library browser. Needed to change how the config settings are
made in localOverrides.conf so settings for multiple libraries
can be made, and to read in the settings using the new layout.
Changes were also mode to htdocs/js/apps/SetMaker/setmaker.js
to support the choice of a library or "All Libraries".
…aries.

OPL-update has a setting to prevent clearing most tables which is to be
used when libraries other than the first one are processed.

A new OPL download should be reloaded "regularly" and then the additional
libraries should be processed.
Use a single shared DB table to each type with a library code field.
OPL-update creates the tables. Data is added when searches are made
for which the count tables do not have a record yet.
the FakeRequest data used by WebworkXMLRPC object. This is needed
in the code which handles multiple libraries, as the
	lib/WeBWorK/Utils/ListingDB.pm
needs to be able to temporarily set such parameters.
inside the lib_update() routine, as the multi-library code
expects that they will be blank when not needed. This is necessary
for the subcommands:
	getAllLibraries  getAllDBsubjects
	getAllDBchapters getSectionListings
which need access to the counts database data of the appropriate type
and type is determined by the lowest level set.
settings when changing libraries. This approach allows doing the same
search on another library just by changing the library chosen.
subjects, chapters, and sections ONLY if they contain problems.
However, for the "All Libraries" setting it will return all
options from the entire taxonomy.
@taniwallach taniwallach added help wanted Do Not Merge Yet PR to allow others to inspect -- not ready for prime time labels Mar 14, 2019
@taniwallach

Copy link
Copy Markdown
Member Author

This code will apparently need some revision before it can be merged into a tree with UTF-8 support, or the merge conflicts will need to be carefully handled.

Once #934 is merged into develop, I will try (as soon as I can) to prepare create a new PR which gets this code to cleanly merge onto the revised develop branch.

From what I recall, it basically works, and searching against several libraries which were processed by the revised OPL-update as explained above works.

The code is not complete.

There are several things which are marked with FIXME in the code, and in particular there are places where things are still hardwired to use default values (ex. a sub-path starting with Library/) appropriate to the OPL, and which may need to be adjusted to work with different libraries.

In particular more work is needed on:

  • get_library_sets() in lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • getDBextras() in lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • deleteListing() in lib/WeBWorK/Utils/ListingDB.pm
  • getProblemDirectories() in lib/WebworkWebservice/LibraryActions.pm
    but there are almost certainly other parts of the code which require additional work.

Testing of this code by additional people would help.

Comment thread bin/OPL-update
use DBI;

# Command line arguments
# for some reason the first command line argument is disappearing before it gets here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is caused as use OPLUtils seems to cause a shift in the argument, see this excerpt from OPLUtils.pm and my comment there

image

Comment thread bin/OPLUtils.pm
our @EXPORT_OK = qw(build_library_directory_tree build_library_subject_tree build_library_textbook_tree);

# what library are we handling, now is first argument of the function
my $myLib = shift;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect, that this line is not needed.

@taniwallach taniwallach added Must be redone and removed help wanted Do Not Merge Yet PR to allow others to inspect -- not ready for prime time alpha version of new code/feature labels Jul 20, 2023
@dlglin

dlglin commented Jan 15, 2024

Copy link
Copy Markdown
Member

Closed due to inactivity. Can be reopened if activity resumes.

@dlglin dlglin closed this Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants