Installation

How to automate init of depths, locations, location_addresses?

Re: How to automate init of depths, locations, location_addresses?

by Andrew Parker -
Number of replies: 1

instead of copying the subroutine verbatim, import the function itself. It's defined in CourseManagement, so our wwsh script only actually needs two lines.

# tell WeBWorK to import 'initNonNativeTables' from WeBWorK/Utils/CourseManagement.pm
use WeBWorK::Utils::CourseManagement 'initNonNativeTables';

# execute the subroutine as called in CourseAdmin.pm
my $table_update_result = initNonNativeTables($ce, $ce->{dbLayoutName});

# see what's in the return value
warn Dumper($table_update_result);
exit;


In reply to Andrew Parker

Re: How to automate init of depths, locations, location_addresses?

by Allan Metts -

Thanks for posting this, Andrew.  I haven't had a chance to try it on an un-initialized system yet, but it looks like it's exactly what I need.  I'll update the GitHub issue I created previously with your suggestion.