Log Message:
-----------
When viewing a file-based problem library, don't show to problem
library's prefix in the "select a problem collection" popup. This can
significantly shorten the length of the options in that popup, making
them more managable.
Modified Files:
--------------
webwork2/lib/WeBWorK/ContentGenerator/Instructor:
SetMaker.pm
Revision Data
-------------
Index: SetMaker.pm
===================================================================
RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v
retrieving revision 1.81
retrieving revision 1.82
diff -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -u -r1.81 -r1.82
--- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
+++ lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
@@ -347,10 +347,18 @@
}
debug("library is $lib and sets are $library_selected");
my $view_problem_line = view_problems_line('view_local_set', 'View Problems', $self->r);
+ my @popup_menu_args = (
+ -name => 'library_sets',
+ -values => $list_of_prob_dirs,
+ -default => $library_selected,
+ );
+ # make labels without the $lib prefix -- reduces the width of the popup menu
+ if (length($lib)) {
+ my %labels = map { my($l)=$_=~/^$lib\/(.*)$/;$_=>$l } @$list_of_prob_dirs;
+ push @popup_menu_args, -labels => \%labels;
+ }
print CGI::Tr({}, CGI::td({-class=>"InfoPanel", -align=>"left"}, "$name Problems: ",
- CGI::popup_menu(-name=> 'library_sets',
- -values=>$list_of_prob_dirs,
- -default=> $library_selected),
+ CGI::popup_menu(@popup_menu_args),
CGI::br(),
$view_problem_line,
));
|