Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.1403 and 1.1405

version 1.1403, 2019/01/27 23:16:36 version 1.1405, 2019/02/15 20:56:18
Line 77  use CGI::Cookie; Line 77  use CGI::Cookie;
   
 use Encode;  use Encode;
   
 use vars qw(%perlvar %spareid %pr %prp $memcache %packagetab $tmpdir  use vars qw(%perlvar %spareid %pr %prp $memcache %packagetab $tmpdir $deftex
             $_64bit %env %protocol %loncaparevs %serverhomeIDs %needsrelease              $_64bit %env %protocol %loncaparevs %serverhomeIDs %needsrelease
             %managerstab);              %managerstab);
   
Line 4361  sub bubblesheet_converter { Line 4361  sub bubblesheet_converter {
     if ((&domain($cdom) ne '') &&      if ((&domain($cdom) ne '') &&
         ($fullpath =~ m{^\Q$perlvar{'lonDocRoot'}/userfiles/$cdom/\E$match_courseid/scantron_orig}) &&          ($fullpath =~ m{^\Q$perlvar{'lonDocRoot'}/userfiles/$cdom/\E$match_courseid/scantron_orig}) &&
         (-e $fullpath) && (ref($config) eq 'HASH') && ($format ne '')) {          (-e $fullpath) && (ref($config) eq 'HASH') && ($format ne '')) {
         my %csvcols = %{$config};          my (%csvcols,%csvoptions);
           if (ref($config->{'fields'}) eq 'HASH') {  
               %csvcols = %{$config->{'fields'}};
           }
           if (ref($config->{'options'}) eq 'HASH') {
               %csvoptions = %{$config->{'options'}};
           }
         my %csvbynum = reverse(%csvcols);          my %csvbynum = reverse(%csvcols);
         my %scantronconf = &get_scantron_config($format,$cdom);          my %scantronconf = &get_scantron_config($format,$cdom);
         if (keys(%scantronconf)) {          if (keys(%scantronconf)) {
Line 4397  sub bubblesheet_converter { Line 4403  sub bubblesheet_converter {
                 my %lettdig = &letter_to_digits();                  my %lettdig = &letter_to_digits();
                 my %diglett = reverse(%lettdig);                  my %diglett = reverse(%lettdig);
                 my $numletts = scalar(keys(%lettdig));                  my $numletts = scalar(keys(%lettdig));
                   my $num = 0;
                 while (my $line=<$fh>) {                  while (my $line=<$fh>) {
                       $num ++;
                       next if (($num == 1) && ($csvoptions{'hdr'} == 1));
                     $line =~ s{[\r\n]+$}{};                      $line =~ s{[\r\n]+$}{};
                     my %found;                      my %found;
                     my @values = split(/,/,$line);                      my @values = split(/,/,$line);
Line 4454  sub bubblesheet_converter { Line 4463  sub bubblesheet_converter {
                                 $found{'FirstQuestion'} .= $values[$i];                                  $found{'FirstQuestion'} .= $values[$i];
                             }                              }
                         } elsif (exists($csvbynum{$i})) {                          } elsif (exists($csvbynum{$i})) {
                             $values[$i] =~ s/^\s+//;                              if ($csvoptions{'rem'}) {
                             if ($csvbynum{$i} eq 'PaperID') {                                  $values[$i] =~ s/^\s+//;
                               }
                               if (($csvbynum{$i} eq 'PaperID') && ($csvoptions{'pad'})) {
                                 while (length($values[$i]) < $scantronconf{$maplength{$csvbynum{$i}}}) {                                  while (length($values[$i]) < $scantronconf{$maplength{$csvbynum{$i}}}) {
                                     $values[$i] = '0'.$values[$i];                                      $values[$i] = '0'.$values[$i];
                                 }                                  }
Line 14800  BEGIN { Line 14811  BEGIN {
   
 }  }
   
   # ------------- set default texengine (domain default overrides this)
   {
       $deftex = LONCAPA::texengine();
   }
   
 $memcache=new Cache::Memcached({'servers'           => ['127.0.0.1:11211'],  $memcache=new Cache::Memcached({'servers'           => ['127.0.0.1:11211'],
  'compress_threshold'=> 20_000,   'compress_threshold'=> 20_000,
          });           });
Line 15525  Returns: Line 15541  Returns:
                       for the sheet of paper                        for the sheet of paper
       FirstName   - column that the first name starts in        FirstName   - column that the first name starts in
       FirstNameLength - number of columns that the first name spans        FirstNameLength - number of columns that the first name spans
   
       LastName    - column that the last name starts in        LastName    - column that the last name starts in
       LastNameLength - number of columns that the last name spans        LastNameLength - number of columns that the last name spans
       BubblesPerRow - number of bubbles available in each row used to        BubblesPerRow - number of bubbles available in each row used to

Removed from v.1.1403  
changed lines
  Added in v.1.1405


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