Diff for /loncom/imspackages/imsprocessor.pm between versions 1.53 and 1.58

version 1.53, 2013/08/02 12:56:26 version 1.58, 2018/05/02 19:34:58
Line 29 Line 29
 package Apache::imsprocessor;  package Apache::imsprocessor;
   
 use Apache::lonnet;  use Apache::lonnet;
   use Apache::loncommon;
 use Apache::loncleanup;  use Apache::loncleanup;
 use Apache::lonlocal;  use Apache::lonlocal;
 use LWP::UserAgent;  
 use HTTP::Request::Common;  use HTTP::Request::Common;
 use LONCAPA::Configuration;  use LONCAPA::Configuration;
   use LONCAPA::LWPReq;
 use strict;  use strict;
   
 sub ims_config {  sub ims_config {
Line 99  sub create_tempdir { Line 100  sub create_tempdir {
     my ($context,$pathinfo,$timenow) = @_;         my ($context,$pathinfo,$timenow) = @_;   
     my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');      my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');
     my $tempdir;      my $tempdir;
       $pathinfo = &Apache::loncommon::clean_path($pathinfo);
   # Collapse dots
       $pathinfo =~ s/\.+/./g;
     if ($context eq 'DOCS') {      if ($context eq 'DOCS') {
         $tempdir =  $$configvars{'lonDaemons'}.'/tmp/'.$pathinfo;          $tempdir =  $$configvars{'lonDaemons'}.'/tmp/'.$pathinfo;
         if (!-e "$tempdir") {          if (!-e "$tempdir") {
Line 130  sub uploadzip { Line 134  sub uploadzip {
         $fname=~s/\s+/\_/g;          $fname=~s/\s+/\_/g;
 # Replace all other weird characters by nothing  # Replace all other weird characters by nothing
         $fname=~s/[^\w\.\-]//g;          $fname=~s/[^\w\.\-]//g;
   # Collapse dots
           $fname=~s/\.+/./g;
 # See if there is anything left  # See if there is anything left
         unless ($fname) { return 'error: no uploaded file'; }          unless ($fname) { return 'error: no uploaded file'; }
 # Save the file  # Save the file
         chomp($env{'form.uploadname'});          chomp($env{'form.uploadname'});
         open(my $fh,'>'.$tempdir.'/'.$fname);          open(my $fh,'>',"$tempdir/$fname");
         print $fh $env{'form.uploadname'};          print $fh $env{'form.uploadname'};
         close($fh);          close($fh);
     } elsif ($context eq 'CSTR') {      } elsif ($context eq 'CSTR') {
Line 387  sub parse_manifest { Line 393  sub parse_manifest {
     );      );
     $p->parse_file($xmlfile);      $p->parse_file($xmlfile);
     $p->eof;      $p->eof;
     foreach my $itm (keys %contents) {      foreach my $itm (keys(%contents)) {
         @{$$items{$itm}{contents}} = @{$contents{$itm}};          @{$$items{$itm}{contents}} = @{$contents{$itm}};
     }      }
 }  }
Line 438  sub target_resources { Line 444  sub target_resources {
 sub copy_resources {  sub copy_resources {
     my ($context,$cms,$hrefs,$resources,$tempdir,$targets,$url,$crs,$cdom,$destdir,$timenow,$assessmentfiles,$total) = @_;      my ($context,$cms,$hrefs,$resources,$tempdir,$targets,$url,$crs,$cdom,$destdir,$timenow,$assessmentfiles,$total) = @_;
     if ($context eq 'DOCS') {      if ($context eq 'DOCS') {
         foreach my $key (sort keys %{$hrefs}) {          foreach my $key (sort(keys(%{$hrefs}))) {
             if (grep/^$key$/,@{$targets}) {              if (grep/^$key$/,@{$targets}) {
                 %{$$url{$key}} = ();                  %{$$url{$key}} = ();
                 foreach my $file (@{$$hrefs{$key}}) {                  foreach my $file (@{$$hrefs{$key}}) {
Line 617  sub process_resinfo { Line 623  sub process_resinfo {
     }      }
     if ($cms eq 'angel5') {      if ($cms eq 'angel5') {
         my $currboard = '';          my $currboard = '';
         foreach my $key (sort keys %{$resources}) {          foreach my $key (sort(keys(%{$resources}))) {
           if (grep/^$key$/,@{$targets}) {            if (grep/^$key$/,@{$targets}) {
             if ($$resources{$key}{type} eq "BOARD") {              if ($$resources{$key}{type} eq "BOARD") {
                 push @{$boards}, $key;                  push @{$boards}, $key;
Line 646  sub process_resinfo { Line 652  sub process_resinfo {
           }            }
         }          }
     } elsif ($cms eq 'bb5' || $cms eq 'bb6') {      } elsif ($cms eq 'bb5' || $cms eq 'bb6') {
         foreach my $key (sort keys %{$resources}) {          foreach my $key (sort(keys(%{$resources}))) {
           if (grep/^$key$/,@{$targets}) {            if (grep/^$key$/,@{$targets}) {
             if ($$resources{$key}{type} eq "resource/x-bb-document") {              if ($$resources{$key}{type} eq "resource/x-bb-document") {
                 unless ($$items{$$resources{$key}{revitm}}{filepath} eq 'Top') {                  unless ($$items{$$resources{$key}{revitm}}{filepath} eq 'Top') {
Line 714  sub process_resinfo { Line 720  sub process_resinfo {
             $$items{'Top'}{'contentscount'} ++;              $$items{'Top'}{'contentscount'} ++;
         }          }
     } elsif ($cms eq 'webctce4') {      } elsif ($cms eq 'webctce4') {
         foreach my $key (sort keys %{$resources}) {          foreach my $key (sort(keys(%{$resources}))) {
             if (grep/^$key$/,@{$targets}) {              if (grep/^$key$/,@{$targets}) {
                 if ($$resources{$key}{type} eq "webcontent") {                  if ($$resources{$key}{type} eq "webcontent") {
                     %{$$resinfo{$key}} = ();                      %{$$resinfo{$key}} = ();
Line 729  sub process_resinfo { Line 735  sub process_resinfo {
             }              }
         }          }
     } elsif ($cms eq 'webctvista4') {      } elsif ($cms eq 'webctvista4') {
         foreach my $key (sort keys %{$resources}) {          foreach my $key (sort(keys(%{$resources}))) {
             if (grep/^$key$/,@{$targets}) {              if (grep/^$key$/,@{$targets}) {
                 %{$$resinfo{$key}} = ();                  %{$$resinfo{$key}} = ();
                 if ($$resources{$key}{type} eq 'webct.question') {                  if ($$resources{$key}{type} eq 'webct.question') {
Line 816  sub build_structure { Line 822  sub build_structure {
         $srcstem = "/res/$udom/$uname/$newdir";          $srcstem = "/res/$udom/$uname/$newdir";
     }      }
   
     foreach my $key (sort keys %{$items}) {      foreach my $key (sort(keys(%{$items}))) {
       if ($$includeditems{$key}) {        if ($$includeditems{$key}) {
         %{$flag{$key}} = (          %{$flag{$key}} = (
                           page => 0,                            page => 0,
Line 988  sub build_structure { Line 994  sub build_structure {
                 $seqtext{$key} .= "</map>\n";                  $seqtext{$key} .= "</map>\n";
                 if ($cms eq 'webctce4' && $key ne 'Top') {                  if ($cms eq 'webctce4' && $key ne 'Top') {
                     push @{$seqfiles}, "$seqtitle.sequence";                      push @{$seqfiles}, "$seqtitle.sequence";
                     open(LOCFILE,">$destdir/sequences/$seqtitle.sequence");                      open(LOCFILE,'>',"$destdir/sequences/$seqtitle.sequence");
                 } else {                  } else {
                     push @{$seqfiles}, "$key.sequence";                      push @{$seqfiles}, "$key.sequence";
                     open(LOCFILE,">$destdir/sequences/$key.sequence");                      open(LOCFILE,'>',"$destdir/sequences/$key.sequence");
                 }                  }
                 print LOCFILE $seqtext{$key};                  print LOCFILE $seqtext{$key};
                 close(LOCFILE);                  close(LOCFILE);
Line 1021  sub build_structure { Line 1027  sub build_structure {
             &process_specials($context,'pools',$pools,\$topnum,$$items{'Top'}{contentscount},$destdir,$udom,$uname,$cdom,$crs,$timenow,$newdir,$timestamp,$resinfo,\$seqtext{'Top'},$pagesfiles,$seqfiles,$topurls,$topnames);              &process_specials($context,'pools',$pools,\$topnum,$$items{'Top'}{contentscount},$destdir,$udom,$uname,$cdom,$crs,$timenow,$newdir,$timestamp,$resinfo,\$seqtext{'Top'},$pagesfiles,$seqfiles,$topurls,$topnames);
         }          }
         $seqtext{'Top'} .= "</map>\n";          $seqtext{'Top'} .= "</map>\n";
         open(TOPFILE,">$destdir/sequences/Top.sequence");          open(TOPFILE,'>',"$destdir/sequences/Top.sequence");
         print TOPFILE $seqtext{'Top'};          print TOPFILE $seqtext{'Top'};
         close(TOPFILE);          close(TOPFILE);
         push @{$seqfiles}, 'Top.sequence';          push @{$seqfiles}, 'Top.sequence';
Line 1034  sub build_structure { Line 1040  sub build_structure {
         $filestem = "/res/$udom/$uname/$newdir";          $filestem = "/res/$udom/$uname/$newdir";
     }      }
   
     foreach my $key (sort keys %pagecontents) {      foreach my $key (sort(keys(%pagecontents))) {
         for (my $i=0; $i<@{$pagecontents{$key}}; $i++) {          for (my $i=0; $i<@{$pagecontents{$key}}; $i++) {
             my $filename = $destdir.'/pages/'.$key.'_'.$i.'.page';              my $filename = $destdir.'/pages/'.$key.'_'.$i.'.page';
             my $resource = "$filestem/resfiles/$$items{$pagecontents{$key}[$i][0]}{resnum}.html";              my $resource = "$filestem/resfiles/$$items{$pagecontents{$key}[$i][0]}{resnum}.html";
Line 1043  sub build_structure { Line 1049  sub build_structure {
             if (grep/^$res$/,@{$packages}) {              if (grep/^$res$/,@{$packages}) {
                 $resource =  $filestem.'/resfiles/'.$res.'./index.html'; # should be entry_point                  $resource =  $filestem.'/resfiles/'.$res.'./index.html'; # should be entry_point
             }              }
             open(PAGEFILE,">$filename");              open(PAGEFILE,'>',$filename);
             print PAGEFILE qq|<map>              print PAGEFILE qq|<map>
 <resource src="$resource" id="1" type="start" title="$$items{$pagecontents{$key}[$i][0]}{title}"></resource>  <resource src="$resource" id="1" type="start" title="$$items{$pagecontents{$key}[$i][0]}{title}"></resource>
 <link to="2" index="1" from="1">\n|;  <link to="2" index="1" from="1">\n|;
Line 1232  sub process_specials { Line 1238  sub process_specials {
   
     if ($type eq "announcements") {      if ($type eq "announcements") {
         push @{$pagesfiles}, "$seqnames{$type}.page";          push @{$pagesfiles}, "$seqnames{$type}.page";
         open(ITEM,">$destdir/pages/$seqnames{$type}.page");          open(ITEM,'>',"$destdir/pages/$seqnames{$type}.page");
     } else {      } else {
         push @{$seqfiles}, "$seqnames{$type}.sequence";          push @{$seqfiles}, "$seqnames{$type}.sequence";
         open(ITEM,">$destdir/sequences/$seqnames{$type}.sequence");          open(ITEM,'>',"$destdir/sequences/$seqnames{$type}.sequence");
     }      }
   
     if ($type eq 'boards') {      if ($type eq 'boards') {
Line 1350  sub process_user { Line 1356  sub process_user {
   my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');    my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');
   my $xmlstem =  $$configvars{'lonDaemons'}."/tmp/".$user_cdom."_".$user_crs."_";    my $xmlstem =  $$configvars{'lonDaemons'}."/tmp/".$user_cdom."_".$user_crs."_";
   
   foreach my $user_id (keys %{$settings}) {    foreach my $user_id (keys(%{$settings})) {
       if ($$settings{$user_id}{user_role} eq "s") {        if ($$settings{$user_id}{user_role} eq "s") {
                         
       } elsif ($user_handling eq 'enrollall') {        } elsif ($user_handling eq 'enrollall') {
Line 1578  sub process_staff { Line 1584  sub process_staff {
   </tr>    </tr>
 </table>  </table>
     |;      |;
     open(FILE,">$destdir/resfiles/$res.html");      open(FILE,'>',"$destdir/resfiles/$res.html");
     push @{$resrcfiles}, "$res.html";      push @{$resrcfiles}, "$res.html";
     print FILE qq|<html>      print FILE qq|<html>
 <head>  <head>
Line 1657  sub process_link { Line 1663  sub process_link {
         $linktag .= qq|>$$settings{title}</a>|;          $linktag .= qq|>$$settings{title}</a>|;
     }      }
   
     open(FILE,">$destdir/resfiles/$res.html");      open(FILE,'>',"$destdir/resfiles/$res.html");
     push @{$resrcfiles}, "$res.html";      push @{$resrcfiles}, "$res.html";
     print FILE qq|<html>      print FILE qq|<html>
 <head>  <head>
Line 1870  sub addposting { Line 1876  sub addposting {
          &Apache::lonnet::put('discussiontimes',\%storenewentry,$cdom,$crs);           &Apache::lonnet::put('discussiontimes',\%storenewentry,$cdom,$crs);
     }      }
     my %record=&Apache::lonnet::restore('_discussion');      my %record=&Apache::lonnet::restore('_discussion');
     my ($temp)=keys %record;      my ($temp)=keys(%record);
     unless ($temp=~/^error\:/) {      unless ($temp=~/^error\:/) {
         my %newrecord=();          my %newrecord=();
         $newrecord{'resource'}=$symb;          $newrecord{'resource'}=$symb;
Line 3263  sub parse_webct4_questionDB { Line 3269  sub parse_webct4_questionDB {
     $p->parse_file($xmlfile);      $p->parse_file($xmlfile);
     $p->eof;      $p->eof;
     my $boxcount;      my $boxcount;
     foreach my $id (keys %{$settings}) {      foreach my $id (keys(%{$settings})) {
         if ($$settings{$id}{class} eq 'string') {          if ($$settings{$id}{class} eq 'string') {
             $boxcount = 0;              $boxcount = 0;
             if (@{$$settings{$id}{boxes}} > 1) {              if (@{$$settings{$id}{boxes}} > 1) {
Line 3340  sub process_assessment { Line 3346  sub process_assessment {
         }          }
     } elsif ($cms eq 'webctvista4') {      } elsif ($cms eq 'webctvista4') {
         unless($$dbparse) {          unless($$dbparse) {
             foreach my $res (sort keys %{$allquestions}) {              foreach my $res (sort(keys(%{$allquestions}))) {
                 my $parent = $$allquestions{$res};                  my $parent = $$allquestions{$res};
                 &parse_webctvista4_question($res,$docroot,$resources,$hrefs,$qzdbsettings,\@allquestids,\%allanswers,\%allchoices,$parent,$catinfo);                  &parse_webctvista4_question($res,$docroot,$resources,$hrefs,$qzdbsettings,\@allquestids,\%allanswers,\%allchoices,$parent,$catinfo);
             }              }
Line 3389  sub build_category_sequences { Line 3395  sub build_category_sequences {
     if (!-e "$destdir/sequences") {      if (!-e "$destdir/sequences") {
         mkdir("$destdir/sequences",0755);          mkdir("$destdir/sequences",0755);
     }      }
     my $numcats = scalar(keys %{$catinfo});      my $numcats = scalar(keys(%{$catinfo}));
     my $curr_id = 0;      my $curr_id = 0;
     my $next_id = 1;      my $next_id = 1;
     my $fh;      my $fh;
     open($fh,">$destdir/sequences/question_database.sequence");      open($fh,'>',"$destdir/sequences/question_database.sequence");
     push @{$sequencesfiles},'question_database.sequence';      push @{$sequencesfiles},'question_database.sequence';
     foreach my $category (sort keys %{$catinfo}) {      foreach my $category (sort(keys(%{$catinfo}))) {
         my $seqname;          my $seqname;
         if ($cms eq 'webctce4') {           if ($cms eq 'webctce4') { 
             $seqname = $$catinfo{$category}{title}.'_'.$category;              $seqname = $$catinfo{$category}{title}.'_'.$category;
Line 3459  sub build_problem_container { Line 3465  sub build_problem_container {
         if (!-e "$seqdir") {          if (!-e "$seqdir") {
             mkdir("$seqdir",0770);              mkdir("$seqdir",0770);
         }          }
         open($fh,">$$containerdir");          open($fh,'>',$$containerdir);
         $$total{seq} ++;          $$total{seq} ++;
         push @{$sequencesfiles},$mapname.'.sequence';          push @{$sequencesfiles},$mapname.'.sequence';
     } else {      } else {
Line 3467  sub build_problem_container { Line 3473  sub build_problem_container {
         if (!-e "$pagedir") {          if (!-e "$pagedir") {
             mkdir("$pagedir",0770);              mkdir("$pagedir",0770);
         }          }
         open($fh,">$$containerdir");          open($fh,'>',$$containerdir);
         $$total{page} ++;          $$total{page} ++;
         push @{$pagesfiles},$mapname.'.page';          push @{$pagesfiles},$mapname.'.page';
     }      }
Line 3925  sub write_bb5_questions { Line 3931  sub write_bb5_questions {
             $title =~ s/\s/_/g;              $title =~ s/\s/_/g;
             $title =~ s/\W//g;              $title =~ s/\W//g;
             $title .= '_'.$id;              $title .= '_'.$id;
             open(PROB,">$newdir/$title.problem");              open(PROB,'>',"$newdir/$title.problem");
             print PROB $output;              print PROB $output;
             close PROB;              close PROB;
         } else {          } else {
Line 3962  sub write_webct4_questions { Line 3968  sub write_webct4_questions {
         }           } 
         if ($$settings{$id}{class} eq 'numerical') {          if ($$settings{$id}{class} eq 'numerical') {
             foreach my $numid (@{$$settings{$id}{numids}}) {              foreach my $numid (@{$$settings{$id}{numids}}) {
                 foreach my $var (keys %{$$settings{$id}{$numid}{vars}}) {                  foreach my $var (keys(%{$$settings{$id}{$numid}{vars}})) {
                     if ($cms eq 'webctce4') {                      if ($cms eq 'webctce4') {
                         $$settings{$id}{text} =~ s/{($var)}/\$$1 /g;                          $$settings{$id}{text} =~ s/{($var)}/\$$1 /g;
                     } elsif ($cms eq 'webctvista4') {                      } elsif ($cms eq 'webctvista4') {
Line 4449  $$settings{$id}{$list}{jumbledtext}[$k] Line 4455  $$settings{$id}{$list}{jumbledtext}[$k]
 |;  |;
                 foreach my $numid (@{$$settings{$id}{numids}}) {                  foreach my $numid (@{$$settings{$id}{numids}}) {
                     my $formula = $$settings{$id}{$numid}{formula};                      my $formula = $$settings{$id}{$numid}{formula};
                     my $pattern = join('|',(sort (keys (%mathfns))));                      my $pattern = join('|',(sort(keys(%mathfns))));
                     $formula =~ s/($pattern)/\&$mathfns{$1}/g;                      $formula =~ s/($pattern)/\&$mathfns{$1}/g;
                     foreach my $var (keys %{$$settings{$id}{$numid}{vars}}) {                      foreach my $var (keys(%{$$settings{$id}{$numid}{vars}})) {
                         my $decnum = $$settings{$id}{$numid}{vars}{$var}{dec};                          my $decnum = $$settings{$id}{$numid}{vars}{$var}{dec};
                         my $increment = '0.';                          my $increment = '0.';
                         if ($decnum == 0) {                          if ($decnum == 0) {
Line 4543  $$settings{$id}{$list}{jumbledtext}[$k] Line 4549  $$settings{$id}{$list}{jumbledtext}[$k]
             $title =~ s/\s/_/g;              $title =~ s/\s/_/g;
             $title =~ s/:/_/g;              $title =~ s/:/_/g;
             $title =~ s/\//_/g;              $title =~ s/\//_/g;
             open(PROB,">$destdir/problems/$probdir/$title.problem");              open(PROB,'>',"$destdir/problems/$probdir/$title.problem");
             print PROB $output;              print PROB $output;
             close PROB;              close PROB;
         } else {          } else {
Line 4942  sub write_bb6_questions { Line 4948  sub write_bb6_questions {
             $title =~ s/\s/_/g;              $title =~ s/\s/_/g;
             $title =~ s/\W//g;              $title =~ s/\W//g;
             $title .= '_'.$id;              $title .= '_'.$id;
             open(PROB,">$newdir/$title.problem");              open(PROB,'>',"$newdir/$title.problem");
             print PROB $output;              print PROB $output;
             close PROB;              close PROB;
         } else {          } else {
Line 4957  sub retrieve_image { Line 4963  sub retrieve_image {
     my ($context,$res,$dirname,$cdom,$cname,$docroot,$destdir,$urlpath,$filename) = @_;      my ($context,$res,$dirname,$cdom,$cname,$docroot,$destdir,$urlpath,$filename) = @_;
     my $contents;      my $contents;
     my $url = $urlpath.$filename;      my $url = $urlpath.$filename;
     my $ua=new LWP::UserAgent;      my $lonhost = $Apache::lonnet::perlvar{'lonHostID'};
     my $request=new HTTP::Request('GET',$url);      my $request=new HTTP::Request('GET',$url);
     my $response=$ua->request($request);      my $response=&LONCAPA::LWPReq::makerequest($lonhost,$request);
     if ($response->is_success) {       if ($response->is_success) { 
         $contents = $response->content;          $contents = $response->content;
         if (!-e "$docroot/$res") {          if (!-e "$docroot/$res") {
Line 4968  sub retrieve_image { Line 4974  sub retrieve_image {
         if (!-e "$docroot/$res/webimages") {          if (!-e "$docroot/$res/webimages") {
             mkdir("$docroot/$res/webimages",0755);              mkdir("$docroot/$res/webimages",0755);
         }          }
         open(my $fh,">$docroot/$res/webimages/$filename");          open(my $fh,'>',"$docroot/$res/webimages/$filename");
         print $fh $contents;          print $fh $contents;
         close($fh);          close($fh);
         if ($context eq 'DOCS') {          if ($context eq 'DOCS') {
Line 5061  sub process_announce { Line 5067  sub process_announce {
         }          }
     }      }
   
     open(FILE,">$destdir/resfiles/$res.html");      open(FILE,'>',"$destdir/resfiles/$res.html");
     push @{$resrcfiles}, "$res.html";      push @{$resrcfiles}, "$res.html";
     print FILE qq|<html>      print FILE qq|<html>
 <head>  <head>
Line 5221  sub process_content { Line 5227  sub process_content {
                     if ($$settings{newwindow} eq "true") {                      if ($$settings{newwindow} eq "true") {
                         $linktag .= qq| target="$res$filecount"|;                          $linktag .= qq| target="$res$filecount"|;
                     }                      }
                     foreach my $entry (keys %{$$settings{files}[$filecount]{registry}}) {                      foreach my $entry (keys(%{$$settings{files}[$filecount]{registry}})) {
                         $linktag .= qq| $entry="$$settings{files}[$filecount]{registry}{$entry}"|;                          $linktag .= qq| $entry="$$settings{files}[$filecount]{registry}{$entry}"|;
                     }                      }
                       $linktag .= qq|>$$settings{files}[$filecount]{linkname}</a><br/>\n|;                        $linktag .= qq|>$$settings{files}[$filecount]{linkname}</a><br/>\n|;
Line 5267  sub process_content { Line 5273  sub process_content {
         }          }
     }      }
   
     if (!open(FILE,">$destdir/resfiles/$res.html")) {      if (!open(FILE,'>',"$destdir/resfiles/$res.html")) {
         &Apache::lonnet::logthis("IMS import error: Cannot open file - $destdir/resfiles/$res.html - $!");          &Apache::lonnet::logthis("IMS import error: Cannot open file - $destdir/resfiles/$res.html - $!");
     } else {      } else {
         push @{$resrcfiles}, "$res.html";          push @{$resrcfiles}, "$res.html";
Line 5460  sub angel_content { Line 5466  sub angel_content {
     $p->parse_file($xmlfile);      $p->parse_file($xmlfile);
     $p->eof;      $p->eof;
     if ($type eq "PAGE") {      if ($type eq "PAGE") {
         open(FILE,"<$xmlfile");          open(FILE,'<',$xmlfile);
         @buffer = <FILE>;          @buffer = <FILE>;
         close(FILE);          close(FILE);
         chomp(@buffer);          chomp(@buffer);
Line 5477  sub angel_content { Line 5483  sub angel_content {
             }              }
         }          }
     }      }
     open(FILE,">$destdir/resfiles/$res.html");      open(FILE,'>',"$destdir/resfiles/$res.html");
     push @{$resrcfiles}, "$res.html";      push @{$resrcfiles}, "$res.html";
     print FILE qq|<html>      print FILE qq|<html>
 <head>  <head>
Line 5513  sub angel_content { Line 5519  sub angel_content {
 sub webct4_content {  sub webct4_content {
     my ($res,$docroot,$destdir,$settings,$dom,$user,$type,$title,$resrcfiles) = @_;      my ($res,$docroot,$destdir,$settings,$dom,$user,$type,$title,$resrcfiles) = @_;
     if (defined($$settings{url})) {      if (defined($$settings{url})) {
         if (!open(FILE,">$destdir/resfiles/$res.html")) {          if (!open(FILE,'>',"$destdir/resfiles/$res.html")) {
             &Apache::lonnet::logthis("IMS import error: Cannot open file - $destdir/resfiles/$res.html - $!");              &Apache::lonnet::logthis("IMS import error: Cannot open file - $destdir/resfiles/$res.html - $!");
         } else {          } else {
             push(@{$resrcfiles}, "$res.html");              push(@{$resrcfiles}, "$res.html");

Removed from v.1.53  
changed lines
  Added in v.1.58


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