Diff for /loncom/interface/lonprintout.pm between versions 1.388 and 1.389

version 1.388, 2005/08/22 22:21:48 version 1.389, 2005/08/29 10:06:52
Line 1 Line 1
 #  The LearningOnline Network  # The LearningOnline Network
 # Printout  # Printout
 #  #
 # $Id$  # $Id$
Line 1386  ENDPART Line 1386  ENDPART
      $code_type=$result{"type\0$old_name"};       $code_type=$result{"type\0$old_name"};
      @allcodes=split(',',$result{$old_name});       @allcodes=split(',',$result{$old_name});
      $num_todo=scalar(@allcodes);       $num_todo=scalar(@allcodes);
  } elsif ($selected_code) {   } elsif ($selected_code) { # Selection value is always numeric.
      $num_todo = 1;       $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);       @allcodes = ($selected_code);
  } elsif ($single_code) {   } elsif ($single_code) {
   
Line 2096  CHOOSE_STUDENTS Line 2093  CHOOSE_STUDENTS
     if ($name =~ /^type\0/) { next; }      if ($name =~ /^type\0/) { next; }
     $namechoice.='<choice computer="'.$name.'">'.$name.'</choice>';      $namechoice.='<choice computer="'.$name.'">'.$name.'</choice>';
  }   }
   
   
         my %all_codes = &Apache::lonnet::get('CODEs',          my %all_codes = &Apache::lonnet::get('CODEs',
      \@names, $cdom,$cnum);       \@names, $cdom,$cnum);
    my %code_values;
  my @all_code_array;   my @all_code_array;
  foreach my $key (keys %all_codes) {   foreach my $key (keys %all_codes) {
     my $codes = $all_codes{$key};      %code_values = &Apache::grades::get_codes($key, $cdom, $cnum);
     my @numeric_codes = split(/,/,$codes);      foreach my $key (keys %code_values) {
     foreach my $numeric (sort {uc($a) cmp uc($b)} @numeric_codes) {   push (@all_code_array, "$key");
  my $alpha_code = &num_to_letters($numeric);  
  push (@all_code_array, "$alpha_code : $numeric");  
     }      }
  }   }
   
  my $code_selection = "<choice></choice>\n";   my $code_selection = "<choice></choice>\n";
  foreach my $code (@all_code_array) {   foreach my $code (sort {uc($a) cmp uc($b)} @all_code_array) {
     $code_selection .= '   <choice computer="'.$code.'">'.$code."</choice>\n";      my $choice  = $code;
       if ($code =~ /^[A-Z]+$/) { # Alpha code
    $choice = &letters_to_num($code);
       }
       $code_selection .= '   <choice computer="'.$choice.'">'.$code."</choice>\n";
  }   }
  open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab');   open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab');
  my $codechoice='';   my $codechoice='';

Removed from v.1.388  
changed lines
  Added in v.1.389


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>