Diff for /loncom/interface/londocs.pm between versions 1.645 and 1.648

version 1.645, 2017/12/18 22:56:45 version 1.648, 2017/12/29 15:55:21
Line 677  sub group_import { Line 677  sub group_import {
                     $toolhash{$item} = &unescape($toolhash{$item});                      $toolhash{$item} = &unescape($toolhash{$item});
                 }                  }
                 if ($folder =~ /^supplemental/) {                  if ($folder =~ /^supplemental/) {
                     delete($toolhash{'gradable'});                       delete($toolhash{'gradable'});
                   } else {
                       $toolhash{'gradable'} =~ s/\D+//g;
                 }                  }
                 if (ref($ltitoolsref) eq 'HASH') {                  if (ref($ltitoolsref) eq 'HASH') {
                     if (ref($ltitoolsref->{$toolid}) eq 'HASH') {                      if (ref($ltitoolsref->{$toolid}) eq 'HASH') {
Line 768  sub group_import { Line 770  sub group_import {
                         }                          }
                         my $changegradable;                          my $changegradable;
                         if (($residx) && ($folder =~ /^default/)) {                          if (($residx) && ($folder =~ /^default/)) {
                             if (exists($toolsettings{'gradable'})) {                              if ($toolsettings{'gradable'}) {
                                 if (!exists($toolhash{'gradable'})) {                                  unless (($toolhash{'gradable'}) || (defined($LONCAPA::map::zombies[$residx]))) {
                                     push(@deleted,'gradable');                                      push(@deleted,'gradable');
                                     $changegradable = 1;                                      $changegradable = 1;
                                 }                                  }
                             } elsif (exists($toolhash{'gradable'})) {                              } elsif ($toolhash{'gradable'}) {
                                   $changegradable = 1;
                               }
                               if (($caller eq 'londocs') && (defined($LONCAPA::map::zombies[$residx]))) {
                                 $changegradable = 1;                                  $changegradable = 1;
                                   if ($toolsettings{'gradable'}) {
                                       $toolhash{'gradable'} = 1;
                                   }
                             }                              }
                         }                          }
                         my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum);                          my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum);
Line 1892  sub do_paste_from_buffer { Line 1900  sub do_paste_from_buffer {
         }          }
         if ($url=~ m{/(bulletinboard|smppg|ext\.tool)$}) {          if ($url=~ m{/(bulletinboard|smppg|ext\.tool)$}) {
             my $prefix = $1;              my $prefix = $1;
             my $fromothercrs;               my $fromothercrs;
             #need to copy the db contents to a new one, unless this is a move.              #need to copy the db contents to a new one, unless this is a move.
             my %info = (              my %info = (
                          src  => $url,                           src  => $url,
Line 2795  sub apply_fixups { Line 2803  sub apply_fixups {
                     }                      }
                 }                  }
             }              }
             for (my $i=0; $i<@LONCAPA::map::order; $i++) {              my $total = scalar(@LONCAPA::map::order) - 1;
               for (my $i=$total; $i>=0; $i--) {
                 my $idx = $LONCAPA::map::order[$i];                  my $idx = $LONCAPA::map::order[$i];
                 if (defined($LONCAPA::map::resources[$idx])) {                  if (defined($LONCAPA::map::resources[$idx])) {
                     my $changed;                      my $changed;
Line 2805  sub apply_fixups { Line 2814  sub apply_fixups {
                         splice(@LONCAPA::map::order,$i,1);                          splice(@LONCAPA::map::order,$i,1);
                         if (ref($currparam{$idx}) eq 'ARRAY') {                          if (ref($currparam{$idx}) eq 'ARRAY') {
                             foreach my $name (@{$currparam{$idx}}) {                              foreach my $name (@{$currparam{$idx}}) {
                                 &LONCAPA::map::delparameter($idx,'parameter_'.$name);                                  &LONCAPA::map::delparameter($idx,$name);
                             }                              }
                         }                          }
                         next;                          next;
Line 2847  sub apply_fixups { Line 2856  sub apply_fixups {
             foreach my $idx (keys(%remparam)) {              foreach my $idx (keys(%remparam)) {
                 if (ref($remparam{$idx}) eq 'ARRAY') {                  if (ref($remparam{$idx}) eq 'ARRAY') {
                     foreach my $name (@{$remparam{$idx}}) {                         foreach my $name (@{$remparam{$idx}}) {   
                         &LONCAPA::map::delparameter($idx,'parameter_'.$name);                          &LONCAPA::map::delparameter($idx,$name);
                     }                      }
                 }                  }
             }              }

Removed from v.1.645  
changed lines
  Added in v.1.648


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