Diff for /loncom/xml/scripttag.pm between versions 1.154 and 1.155

version 1.154, 2010/05/26 02:04:20 version 1.155, 2010/05/26 12:22:54
Line 387  sub start_import { Line 387  sub start_import {
     my $importmode=&Apache::lonxml::get_param('importmode',$parstack,$safeeval);      my $importmode=&Apache::lonxml::get_param('importmode',$parstack,$safeeval);
     if (($importmode eq 'problem') || ($importmode eq 'part')) {      if (($importmode eq 'problem') || ($importmode eq 'part')) {
 # We are using import to import published problems  # We are using import to import published problems
 # This will require some on-the-fly rewriting  
        my $importid=&Apache::lonxml::get_param('id',$parstack,$safeeval);  
        if ($importid) {  
 # Rewrite all internal IDs of the problem to avoid duplicates  
           $file=~s/id\s*=\s*([\"\'])(\w+)([\"\'])/id=$1$2DynPart$importid$3/gs;  
        }  
        if (($importmode eq 'problem') || ($file=~/<part[^<]*>/s)) {         if (($importmode eq 'problem') || ($file=~/<part[^<]*>/s)) {
 # We explicitly don't want this to be a separate part or the problem already has parts  # We explicitly don't want this to be a separate part or the problem already has parts
           $file=~s/^\s*<problem>/<library>/s;            $file=~s/^\s*<problem>/<library>/s;
   $file=~s/<\/problem>\s*$/<\/library>/s;    $file=~s/<\/problem>\s*$/<\/library>/s;
        } else {         } else {
 # We want this to be a separate part, but it currently is not  # We want this to be a separate part, but it currently is not
           if ($importid) {            $file=~s/^\s*<problem>/<library><part>/s;
              $file=~s/^\s*<problem>/<library><part id="DynPart$importid">/s;  
           } else {  
              $file=~s/^\s*<problem>/<library><part>/s;  
           }  
   $file=~s/<\/problem>\s*$/<\/part><\/library>/s;    $file=~s/<\/problem>\s*$/<\/part><\/library>/s;
        }         }
     }      }

Removed from v.1.154  
changed lines
  Added in v.1.155


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