[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Mon, 13 Sep 2004 12:49:42 -0000


raeburn		Mon Sep 13 08:49:42 2004 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  Eliminate debugging messages. Indentation changes. Save messages from replication of attachments for IMS.
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.124 loncom/interface/lonfeedback.pm:1.125
--- loncom/interface/lonfeedback.pm:1.124	Mon Sep 13 08:19:14 2004
+++ loncom/interface/lonfeedback.pm	Mon Sep 13 08:49:42 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.124 2004/09/13 12:19:14 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.125 2004/09/13 12:49:42 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -332,7 +332,6 @@
 # open manifest file
             my $manifest = '/imsmanifest.xml';
             my $manifestfilename = $tempexport.$manifest;
-            print STDERR "manifestfilename is $manifestfilename\n";
             if ($manifestfile = Apache::File->new('>'.$manifestfilename)) {
                 $manifestok=1;
                 print $manifestfile qq|
@@ -482,7 +481,6 @@
                     my $postfilename = $alldiscussion{$_}.'-'.$imsitems{$alldiscussion{$_}}{'timestamp'}.'.html';
                     if ($manifestok) {
                         if (($depth[$alldiscussion{$_}] <= $currdepth) && ($alldiscussion{$_} != $firstidx)) {
-                            print STDERR "depth is $depth[$alldiscussion{$_}], currdepth is $currdepth, idx is $alldiscussion{$_}, firstidx is $firstidx\n";
                             print $manifestfile '  </item>'."\n";
                         }
                         $currdepth = $depth[$alldiscussion{$_}];
@@ -608,7 +606,7 @@
                 undef(%oldENV);
                 $discussion .= 'Download the zip file from <a href="'.$imszipfile.'">Discussion Posting Archive</a><br />';
                 if ($copyresult) {
-                    $discussion .= 'The following errors occurred during export - '.$copyresult;
+                    $discussion .= 'The following errors occurred during export - <br />'.$copyresult;
                 }
             } else {
                 $discussion .= '<br />Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.<br />';
@@ -1159,22 +1157,23 @@
                     $i ++;
                 }
                 my ($content,$rtncode);
-                print STDERR "File to replicate is $$attachrefs{$id}{'filename'} in $1,$2\n";
                 my $uploadreply = &Apache::lonnet::getuploaded('GET',$$attachrefs{$id}{'filename'},$1,$2,$content,$rtncode);
                 if ($uploadreply eq 'ok') {
-                     my $attachcopy;
-                     if ($attachcopy = Apache::File->new('>'.$destination)) {
-                         print $attachcopy $content;
-                         close($attachcopy);
-                     } else {
-                         $response .= 'Error copying a file attachment to IMS package: '.$!.'<br />'."\n";
-                     }
+                    my $attachcopy;
+                    if ($attachcopy = Apache::File->new('>'.$destination)) {
+                        print $attachcopy $content;
+                        close($attachcopy);
+                    } else {
+                        $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$!.'<br />'."\n";
+                    }
                 } else {
-                    print STDERR "return code from lonnet was $rtncode\n";
+                    &Apache::lonnet::logthis("Replication of attachment failed when building IMS export of discussion posts - domain: $1, course: $2, file: $$attachrefs{$id}{'filename'} -error: $rtncode");
+                    $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$rtncode.'<br />'."\n";
                 }
             }
         }
     }
+    return $response;
 }
 
 sub mail_screen {