version 1.124, 2004/09/13 12:19:14
|
version 1.125, 2004/09/13 12:49:42
|
Line 332 sub list_discussion {
|
Line 332 sub list_discussion {
|
# open manifest file |
# open manifest file |
my $manifest = '/imsmanifest.xml'; |
my $manifest = '/imsmanifest.xml'; |
my $manifestfilename = $tempexport.$manifest; |
my $manifestfilename = $tempexport.$manifest; |
print STDERR "manifestfilename is $manifestfilename\n"; |
|
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) { |
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) { |
$manifestok=1; |
$manifestok=1; |
print $manifestfile qq| |
print $manifestfile qq| |
Line 482 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 481 imscp_v1p1.xsd http://www.imsglobal.org/
|
my $postfilename = $alldiscussion{$_}.'-'.$imsitems{$alldiscussion{$_}}{'timestamp'}.'.html'; |
my $postfilename = $alldiscussion{$_}.'-'.$imsitems{$alldiscussion{$_}}{'timestamp'}.'.html'; |
if ($manifestok) { |
if ($manifestok) { |
if (($depth[$alldiscussion{$_}] <= $currdepth) && ($alldiscussion{$_} != $firstidx)) { |
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"; |
print $manifestfile ' </item>'."\n"; |
} |
} |
$currdepth = $depth[$alldiscussion{$_}]; |
$currdepth = $depth[$alldiscussion{$_}]; |
Line 608 END
|
Line 606 END
|
undef(%oldENV); |
undef(%oldENV); |
$discussion .= 'Download the zip file from <a href="'.$imszipfile.'">Discussion Posting Archive</a><br />'; |
$discussion .= 'Download the zip file from <a href="'.$imszipfile.'">Discussion Posting Archive</a><br />'; |
if ($copyresult) { |
if ($copyresult) { |
$discussion .= 'The following errors occurred during export - '.$copyresult; |
$discussion .= 'The following errors occurred during export - <br />'.$copyresult; |
} |
} |
} else { |
} 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 />'; |
$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 />'; |
Line 1159 sub replicate_attachments {
|
Line 1157 sub replicate_attachments {
|
$i ++; |
$i ++; |
} |
} |
my ($content,$rtncode); |
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); |
my $uploadreply = &Apache::lonnet::getuploaded('GET',$$attachrefs{$id}{'filename'},$1,$2,$content,$rtncode); |
if ($uploadreply eq 'ok') { |
if ($uploadreply eq 'ok') { |
my $attachcopy; |
my $attachcopy; |
if ($attachcopy = Apache::File->new('>'.$destination)) { |
if ($attachcopy = Apache::File->new('>'.$destination)) { |
print $attachcopy $content; |
print $attachcopy $content; |
close($attachcopy); |
close($attachcopy); |
} else { |
} else { |
$response .= 'Error copying a file attachment to IMS package: '.$!.'<br />'."\n"; |
$response .= 'Error copying file attachment - '.$5.' to IMS package: '.$!.'<br />'."\n"; |
} |
} |
} else { |
} 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 { |
sub mail_screen { |