--- loncom/interface/lonprintout.pm 2005/08/22 22:21:48 1.388 +++ loncom/interface/lonprintout.pm 2005/08/29 10:06:52 1.389 @@ -1,7 +1,7 @@ -# The LearningOnline Network +# The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.388 2005/08/22 22:21:48 foxr Exp $ +# $Id: lonprintout.pm,v 1.389 2005/08/29 10:06:52 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1386,11 +1386,8 @@ ENDPART $code_type=$result{"type\0$old_name"}; @allcodes=split(',',$result{$old_name}); $num_todo=scalar(@allcodes); - } elsif ($selected_code) { + } elsif ($selected_code) { # Selection value is always numeric. $num_todo = 1; - my ($alpha, $numeric) = split(/:/, $selected_code); - $selected_code = $numeric; # Always use numeric, converted if need be. - $selected_code =~ s/\s+//g; @allcodes = ($selected_code); } elsif ($single_code) { @@ -2096,20 +2093,26 @@ CHOOSE_STUDENTS if ($name =~ /^type\0/) { next; } $namechoice.=''.$name.''; } + + my %all_codes = &Apache::lonnet::get('CODEs', \@names, $cdom,$cnum); + my %code_values; my @all_code_array; foreach my $key (keys %all_codes) { - my $codes = $all_codes{$key}; - my @numeric_codes = split(/,/,$codes); - foreach my $numeric (sort {uc($a) cmp uc($b)} @numeric_codes) { - my $alpha_code = &num_to_letters($numeric); - push (@all_code_array, "$alpha_code : $numeric"); + %code_values = &Apache::grades::get_codes($key, $cdom, $cnum); + foreach my $key (keys %code_values) { + push (@all_code_array, "$key"); } } + my $code_selection = "\n"; - foreach my $code (@all_code_array) { - $code_selection .= ' '.$code."\n"; + foreach my $code (sort {uc($a) cmp uc($b)} @all_code_array) { + my $choice = $code; + if ($code =~ /^[A-Z]+$/) { # Alpha code + $choice = &letters_to_num($code); + } + $code_selection .= ' '.$code."\n"; } open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); my $codechoice='';