From: jj v. a. <we...@ma...> - 2006-01-09 19:19:02
|
Log Message: ----------- Fixed the following bug: if you are importing multiple sets and (stupidly) include the line "the following file(s)" in your multiple selection (which can happen if you are trying to get everything), then you would get a cryptic error and nothing would be imported. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor: ProblemSetList.pm Revision Data ------------- Index: ProblemSetList.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm,v retrieving revision 1.87 retrieving revision 1.88 diff -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -Llib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm -u -r1.87 -r1.88 --- lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm +++ lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm @@ -1364,6 +1364,11 @@ my $db = $r->db; my $dir = $ce->{courseDirs}->{templates}; + # if the user includes "following files" in a multiple selection + # it shows up here as "" which causes the importing to die + # so, we select on filenames containing non-whitespace + @setDefFiles = grep(/\S/, @setDefFiles); + # FIXME: do we really want everything to fail on one bad file name? foreach my $fileName (@setDefFiles) { die "won't be able to read from file $dir/$fileName: does it exist? is it readable?" |