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

version 1.388, 2005/08/22 22:21:48 version 1.391, 2005/09/06 09:54:21
Line 1 Line 1
 #  The LearningOnline Network  # The LearningOnline Network
 # Printout  # Printout
 #  #
 # $Id$  # $Id$
Line 508  sub character_chart { Line 508  sub character_chart {
     $result =~ s/&(prod|\#8719);/\\ensuremath\{\\prod\}/g;      $result =~ s/&(prod|\#8719);/\\ensuremath\{\\prod\}/g;
     $result =~ s/&(sum|\#8721);/\\ensuremath\{\\sum\}/g;      $result =~ s/&(sum|\#8721);/\\ensuremath\{\\sum\}/g;
     $result =~ s/&(minus|\#8722);/\\ensuremath\{-\}/g;      $result =~ s/&(minus|\#8722);/\\ensuremath\{-\}/g;
       $result =~ s/–/\\ensuremath\{-\}/g;
     $result =~ s/&(lowast|\#8727);/\\ensuremath\{*\}/g;      $result =~ s/&(lowast|\#8727);/\\ensuremath\{*\}/g;
     $result =~ s/&(radic|\#8730);/\\ensuremath\{\\surd\}/g;      $result =~ s/&(radic|\#8730);/\\ensuremath\{\\surd\}/g;
     $result =~ s/&(prop|\#8733);/\\ensuremath\{\\propto\}/g;      $result =~ s/&(prop|\#8733);/\\ensuremath\{\\propto\}/g;
Line 1386  ENDPART Line 1387  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 2094  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='';
Line 2318  CHOOSE_FROM_SUBDIR Line 2322  CHOOSE_FROM_SUBDIR
       <nextstate>CHOOSE_FROM_ANY_SEQUENCE</nextstate>        <nextstate>CHOOSE_FROM_ANY_SEQUENCE</nextstate>
       <filterfunc>return \$res->is_sequence;</filterfunc>        <filterfunc>return \$res->is_sequence;</filterfunc>
       <valuefunc>return $urlValue;</valuefunc>        <valuefunc>return $urlValue;</valuefunc>
         <choicefunc>return \$res->hasResource(\$res,sub { return !\$_[0]->is_sequence() },0,0);
    </choicefunc>
       <option text='Newpage' variable='FINISHPAGE' />        <option text='Newpage' variable='FINISHPAGE' />
       </resource>        </resource>
     </state>      </state>

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


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