diff --git a/bin/dump-past-answers.pl b/bin/dump-past-answers.pl index d4dc3082a7..f9fbb10840 100755 --- a/bin/dump-past-answers.pl +++ b/bin/dump-past-answers.pl @@ -120,7 +120,8 @@ BEGIN pod2usage(2) if $show_help; -@courses = listCourses(WeBWorK::CourseEnvironment->new({ webwork_dir => $ENV{WEBWORK_ROOT} })) unless @courses; +my $minimal_ce = WeBWorK::CourseEnvironment->new({ webwork_dir => $ENV{WEBWORK_ROOT} }); +@courses = listCourses($minimal_ce) unless @courses; sub write_past_answers_csv { my $outFH = shift; @@ -132,7 +133,7 @@ sub write_past_answers_csv { my %OPL_tag_data; for my $courseID (@courses) { - next if $courseID eq 'admin' || $courseID eq 'modelCourse'; + next if $courseID eq ($minimal_ce->{admin_course_id} // 'admin') || $courseID eq 'modelCourse'; my $ce = WeBWorK::CourseEnvironment->new({ webwork_dir => $ENV{WEBWORK_ROOT}, courseName => $courseID }); my $db = WeBWorK::DB->new($ce->{dbLayout});