From: Sam H. v. a. <we...@ma...> - 2008-04-04 19:39:59
|
Log Message: ----------- backport (sh002i): 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. Tags: ---- rel-2-4-dev 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.77.2.2 retrieving revision 1.77.2.3 diff -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -Llib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm -u -r1.77.2.2 -r1.77.2.3 --- lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm +++ lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm @@ -340,10 +340,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, )); |