version 1.11, 2004/12/13 20:01:09
|
version 1.14, 2005/02/14 22:46:12
|
Line 141 sub expand_zip {
|
Line 141 sub expand_zip {
|
} |
} |
|
|
sub process_manifest { |
sub process_manifest { |
my ($cms,$tempdir,$resources,$items,$hrefs,$resinfo) = @_; |
my ($cms,$tempdir,$resources,$items,$hrefs,$resinfo,$phase,$includedres,$includeditems) = @_; |
my %toc = ( |
my %toc = ( |
bb6 => 'organization', |
bb6 => 'organization', |
bb5 => 'tableofcontents', |
bb5 => 'tableofcontents', |
Line 165 sub process_manifest {
|
Line 165 sub process_manifest {
|
$$resources{'toplevel'}{type} = "FOLDER"; |
$$resources{'toplevel'}{type} = "FOLDER"; |
} elsif ($cms eq 'bb5' || $cms eq 'bb6') { |
} elsif ($cms eq 'bb5' || $cms eq 'bb6') { |
$$resources{'toplevel'}{type} = 'resource/x-bb-document'; |
$$resources{'toplevel'}{type} = 'resource/x-bb-document'; |
|
} else { |
|
$$resources{'toplevel'}{type} = 'webcontent'; |
} |
} |
|
|
unless (-e "$tempdir/imsmanifest.xml") { |
unless (-e "$tempdir/imsmanifest.xml") { |
Line 192 sub process_manifest {
|
Line 194 sub process_manifest {
|
$num --; |
$num --; |
} |
} |
if (("@state" eq $searchstr) && (@state > 3)) { |
if (("@state" eq $searchstr) && (@state > 3)) { |
$itm = $attr->{identifier}; |
$itm = $attr->{identifier}; |
%{$$items{$itm}} = (); |
if ($$includeditems{$itm} || $phase ne 'build') { |
$$items{$itm}{contentscount} = 0; |
%{$$items{$itm}} = (); |
if ($cms eq 'bb5' || $cms eq 'bb6') { |
$$items{$itm}{contentscount} = 0; |
$$items{$itm}{resnum} = $attr->{identifierref}; |
if ($cms eq 'bb5' || $cms eq 'bb6') { |
if ($cms eq 'bb5') { |
$$items{$itm}{resnum} = $attr->{identifierref}; |
$$items{$itm}{title} = $attr->{title}; |
if ($cms eq 'bb5') { |
} |
$$items{$itm}{title} = $attr->{title}; |
} elsif ($cms eq 'angel') { |
} |
if ($attr->{identifierref} =~ m/^res(.+)$/) { |
} elsif ($cms eq 'angel') { |
$$items{$itm}{resnum} = $1; |
if ($attr->{identifierref} =~ m/^res(.+)$/) { |
} |
$$items{$itm}{resnum} = $1; |
} |
|
unless (defined(%{$$resources{$$items{$itm}{resnum}}}) ) { |
|
%{$$resources{$$items{$itm}{resnum}}} = (); |
|
} |
|
$$resources{$$items{$itm}{resnum}}{revitm} = $itm; |
|
|
|
if ($start > @seq) { |
|
unless ($lastitem eq '') { |
|
push @seq, $lastitem; |
|
unless ( defined($contents{$seq[-1]}) ) { |
|
@{$contents{$seq[-1]}} = (); |
|
} |
} |
push @{$contents{$seq[-1]}},$itm; |
|
$$items{$itm}{parentseq} = $seq[-1]; |
|
} |
} |
} |
unless (defined(%{$$resources{$$items{$itm}{resnum}}}) ) { |
elsif ($start < @seq) { |
%{$$resources{$$items{$itm}{resnum}}} = (); |
my $diff = @seq - $start; |
|
while ($diff > 0) { |
|
pop @seq; |
|
$diff --; |
|
} |
} |
if (@seq) { |
$$resources{$$items{$itm}{resnum}}{revitm} = $itm; |
|
if ($start > @seq) { |
|
unless ($lastitem eq '') { |
|
push @seq, $lastitem; |
|
unless ( defined($contents{$seq[-1]}) ) { |
|
@{$contents{$seq[-1]}} = (); |
|
} |
|
push @{$contents{$seq[-1]}},$itm; |
|
$$items{$itm}{parentseq} = $seq[-1]; |
|
} |
|
} elsif ($start < @seq) { |
|
my $diff = @seq - $start; |
|
while ($diff > 0) { |
|
pop @seq; |
|
$diff --; |
|
} |
|
if (@seq) { |
|
push @{$contents{$seq[-1]}}, $itm; |
|
} |
|
} else { |
push @{$contents{$seq[-1]}}, $itm; |
push @{$contents{$seq[-1]}}, $itm; |
} |
} |
} else { |
my $path; |
push @{$contents{$seq[-1]}}, $itm; |
if (@seq > 1) { |
} |
$path = join(',',@seq); |
my $path; |
} elsif (@seq > 0) { |
if (@seq > 1) { |
$path = $seq[0]; |
$path = join(',',@seq); |
} |
} elsif (@seq > 0) { |
$$items{$itm}{filepath} = $path; |
$path = $seq[0]; |
if ($cms eq 'bb5' || $cms eq 'bb6') { |
} |
if ($$items{$itm}{filepath} eq 'Top') { |
$$items{$itm}{filepath} = $path; |
$$items{$itm}{resnum} = $itm; |
if ($cms eq 'bb5' || $cms eq 'bb6') { |
$$resources{$$items{$itm}{resnum}}{type} = 'resource/x-bb-document'; |
if ($$items{$itm}{filepath} eq 'Top') { |
$$resources{$$items{$itm}{resnum}}{revitm} = $itm; |
$$items{$itm}{resnum} = $itm; |
$$resinfo{$$items{$itm}{resnum}}{'isfolder'} = 'true'; |
$$resources{$$items{$itm}{resnum}}{type} = 'resource/x-bb-document'; |
} |
$$resources{$$items{$itm}{resnum}}{revitm} = $itm; |
|
$$resinfo{$$items{$itm}{resnum}}{'isfolder'} = 'true'; |
|
} |
} |
|
$$items{$seq[-1]}{contentscount} ++; |
|
$lastitem = $itm; |
} |
} |
$$items{$seq[-1]}{contentscount} ++; |
|
$lastitem = $itm; |
|
} |
} |
} elsif ("@state" eq "manifest resources resource" ) { |
} elsif ("@state" eq "manifest resources resource" ) { |
$identifier = $attr->{identifier}; |
$identifier = $attr->{identifier}; |
if ($cms eq 'bb5' || $cms eq 'bb6') { |
if ($$includedres{$identifier} || $phase ne 'build') { |
$$resources{$identifier}{file} = $attr->{file}; |
if ($cms eq 'bb5' || $cms eq 'bb6') { |
$$resources{$identifier}{type} = $attr->{type}; |
$$resources{$identifier}{file} = $attr->{file}; |
} elsif ($cms eq 'angel') { |
$$resources{$identifier}{type} = $attr->{type}; |
$identifier = substr($identifier,3); |
} elsif ($cms eq 'angel') { |
if ($attr->{href} =~ m-^_assoc/$identifier/(.+)$-) { |
$identifier = substr($identifier,3); |
$$resources{$identifier}{file} = $1; |
if ($attr->{href} =~ m-^_assoc/$identifier/(.+)$-) { |
|
$$resources{$identifier}{file} = $1; |
|
} |
} |
} |
|
@{$$hrefs{$identifier}} = (); |
} |
} |
@{$$hrefs{$identifier}} = (); |
|
} elsif ("@state" eq "manifest resources resource file") { |
} elsif ("@state" eq "manifest resources resource file") { |
if ($cms eq 'bb5' || $cms eq 'bb6') { |
if ($$includedres{$identifier} || $phase ne 'build') { |
push @{$$hrefs{$identifier}},$attr->{href}; |
if ($cms eq 'bb5' || $cms eq 'bb6') { |
} elsif ($cms eq 'angel') { |
push @{$$hrefs{$identifier}},$attr->{href}; |
if ($attr->{href} =~ m/^_assoc\\$identifier\\(.+)$/) { |
} elsif ($cms eq 'angel') { |
push @{$$hrefs{$identifier}},$1; |
if ($attr->{href} =~ m/^_assoc\\$identifier\\(.+)$/) { |
} elsif ($attr->{href} =~ m/^Icons\\icon(\w+)\.gif/) { |
push @{$$hrefs{$identifier}},$1; |
$$resources{$identifier}{type} = $1; |
} elsif ($attr->{href} =~ m/^Icons\\icon(\w+)\.gif/) { |
|
$$resources{$identifier}{type} = $1; |
|
} |
} |
} |
} |
} |
} |
} |
Line 278 sub process_manifest {
|
Line 284 sub process_manifest {
|
[sub { |
[sub { |
my ($text) = @_; |
my ($text) = @_; |
if ($state[0] eq "manifest" && $state[1] eq "organizations" && $state[2] eq $toc{$cms} && $state[-1] eq "title") { |
if ($state[0] eq "manifest" && $state[1] eq "organizations" && $state[2] eq $toc{$cms} && $state[-1] eq "title") { |
if ($cms eq 'angel' || $cms eq 'bb6') { |
if ($$includeditems{$itm} || $phase ne 'build') { |
$$items{$itm}{title} = $text; |
if ($cms eq 'angel' || $cms eq 'bb6') { |
|
$$items{$itm}{title} = $text; |
|
} |
} |
} |
} |
} |
}, "dtext"], |
}, "dtext"], |
Line 298 sub process_manifest {
|
Line 306 sub process_manifest {
|
return 'ok' ; |
return 'ok' ; |
} |
} |
|
|
|
sub get_imports { |
|
my ($includeditems,$items,$resources,$importareas,$itm) = @_; |
|
if (exists($$items{$itm}{resnum})) { |
|
if ($$importareas{$$resources{$$items{$itm}{resnum}}{type}}) { |
|
unless (exists($$includeditems{$itm})) { |
|
$$includeditems{$itm} = 1; |
|
} |
|
} |
|
} |
|
if ($$items{$itm}{contentscount} > 0) { |
|
foreach my $child (@{$$items{$itm}{contents}}) { |
|
&get_imports($includeditems,$items,$resources,$importareas,$child); |
|
} |
|
} |
|
} |
|
|
|
sub get_parents { |
|
my ($includeditems,$items,$itm) = @_; |
|
my @pathitems = (); |
|
if ($$items{$itm}{filepath} =~ m/,/) { |
|
@pathitems = split/,/,$$items{$itm}{filepath}; |
|
} else { |
|
$pathitems[0] = $$items{$itm}{filepath}; |
|
} |
|
foreach (@pathitems) { |
|
$$includeditems{$_} = 1; |
|
} |
|
} |
|
|
sub target_resources { |
sub target_resources { |
my ($resources,$oktypes,$targets) = @_; |
my ($resources,$oktypes,$targets) = @_; |
foreach my $key (keys %{$resources}) { |
foreach my $key (keys %{$resources}) { |
Line 334 sub copy_resources {
|
Line 371 sub copy_resources {
|
mkdir("$destdir/resfiles",0770); |
mkdir("$destdir/resfiles",0770); |
} |
} |
foreach my $key (sort keys %{$hrefs}) { |
foreach my $key (sort keys %{$hrefs}) { |
foreach my $file (@{$$hrefs{$key}}) { |
if (grep/^$key$/,@{$targets}) { |
$file =~ s-\\-/-g; |
foreach my $file (@{$$hrefs{$key}}) { |
if ( ($cms eq 'angel' && $file ne 'pg'.$key.'.htm') || ($cms eq 'bb5') || ($cms eq 'bb6') ) { |
$file =~ s-\\-/-g; |
if (!-e "$destdir/resfiles/$key") { |
if ( ($cms eq 'angel' && $file ne 'pg'.$key.'.htm') || ($cms eq 'bb5') || ($cms eq 'bb6') ) { |
mkdir("$destdir/resfiles/$key",0770); |
if (!-e "$destdir/resfiles/$key") { |
} |
mkdir("$destdir/resfiles/$key",0770); |
|
} |
my $filepath = $file; |
|
my $front = ''; |
my $filepath = $file; |
while ($filepath =~ m-(\w+)/(.+)-) { |
my $front = ''; |
$front .= $1.'/'; |
while ($filepath =~ m-(\w+)/(.+)-) { |
$filepath = $2; |
$front .= $1.'/'; |
my $fulldir = "$destdir/resfiles/$key/$front"; |
$filepath = $2; |
chop($fulldir); |
my $fulldir = "$destdir/resfiles/$key/$front"; |
if (!-e "$fulldir") { |
chop($fulldir); |
mkdir("$fulldir",0770); |
if (!-e "$fulldir") { |
|
mkdir("$fulldir",0770); |
|
} |
|
} |
|
if ($cms eq 'angel') { |
|
rename("$tempdir/_assoc/$key/$file","$destdir/resfiles/$key/$file"); |
|
} elsif ($cms eq 'bb5' || $cms eq 'bb6') { |
|
rename("$tempdir/$key/$file","$destdir/resfiles/$key/$file"); |
} |
} |
} |
|
if ($cms eq 'angel') { |
|
rename("$tempdir/_assoc/$key/$file","$destdir/resfiles/$key/$file"); |
|
} elsif ($cms eq 'bb5' || $cms eq 'bb6') { |
|
rename("$tempdir/$key/$file","$destdir/resfiles/$key/$file"); |
|
} |
} |
} |
} |
} |
} |
Line 363 sub copy_resources {
|
Line 402 sub copy_resources {
|
} |
} |
} |
} |
|
|
sub process_coursefile { |
|
my ($crs,$cdom,$chome,$file,$source)=@_; |
|
my $fetchresult = ''; |
|
my $fpath = ''; |
|
my $fname = $file; |
|
($fpath,$fname) = ($file =~ m/^(.*)\/([^\/])$/); |
|
$fpath=$cdom.'/'.$crs.'/'.$fpath; |
|
my $filepath=$Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles'; |
|
unless ($fpath eq '') { |
|
my @parts=split(/\//,$fpath); |
|
foreach my $part (@parts) { |
|
$filepath.= '/'.$part; |
|
if ((-e $filepath)!=1) { |
|
mkdir($filepath,0777); |
|
} |
|
} |
|
} |
|
if ($source eq '') { |
|
$fetchresult eq 'no source file provided'; |
|
} else { |
|
my $destination = $filepath.'/'.$fname; |
|
rename($source,$destination); |
|
$fetchresult= &Apache::lonnet::reply('fetchuserfile:'.$cdom.'/'.$crs.'/'.$file,$chome); |
|
unless ($fetchresult eq 'ok') { |
|
&Apache::lonnet::logthis('Failed to transfer '.$cdom.'/'.$crs.'/'.$fname.' to host '.$chome.': '.$fetchresult); |
|
} |
|
} |
|
return $fetchresult; |
|
} |
|
|
|
sub process_resinfo { |
sub process_resinfo { |
my ($cms,$context,$docroot,$destdir,$items,$resources,$boards,$announcements,$quizzes,$surveys,$groups,$messages,$timestamp,$boardnum,$resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,$total,$dirname,$seqstem,$resrcfiles,$packages,$hrefs,$pagesfiles,$sequencesfiles) = @_; |
my ($cms,$context,$docroot,$destdir,$items,$resources,$targets,$boards,$announcements,$quizzes,$surveys,$pools,$groups,$messages,$timestamp,$boardnum,$resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,$total,$dirname,$seqstem,$resrcfiles,$packages,$hrefs,$pagesfiles,$sequencesfiles) = @_; |
my $board_id = time; |
my $board_id = time; |
my $board_count = 0; |
my $board_count = 0; |
my $announce_handling = 'include'; |
my $announce_handling = 'include'; |
Line 402 sub process_resinfo {
|
Line 411 sub process_resinfo {
|
if ($crs =~ m/^(\d)(\d)(\d)/) { |
if ($crs =~ m/^(\d)(\d)(\d)/) { |
$longcrs = $1.'/'.$2.'/'.$3.'/'.$crs; |
$longcrs = $1.'/'.$2.'/'.$3.'/'.$crs; |
} |
} |
|
if ($context eq 'CSTR') { |
|
if (!-e "$destdir/resfiles") { |
|
mkdir("$destdir/resfiles",0770); |
|
} |
|
} |
if ($cms eq 'angel') { |
if ($cms eq 'angel') { |
my $currboard = ''; |
my $currboard = ''; |
foreach my $key (sort keys %{$resources}) { |
foreach my $key (sort keys %{$resources}) { |
|
if (grep/^$key$/,@{$targets}) { |
if ($$resources{$key}{type} eq "BOARD") { |
if ($$resources{$key}{type} eq "BOARD") { |
push @{$boards}, $key; |
push @{$boards}, $key; |
$$boardnum{$$resources{$key}{revitm}} = $board_count; |
$$boardnum{$$resources{$key}{revitm}} = $board_count; |
Line 429 sub process_resinfo {
|
Line 444 sub process_resinfo {
|
} elsif ($$resources{$key}{type} eq "DROPBOX") { |
} elsif ($$resources{$key}{type} eq "DROPBOX") { |
%{$$resinfo{$key}} = (); |
%{$$resinfo{$key}} = (); |
} |
} |
|
} |
} |
} |
} 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 ($$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') { |
%{$$resinfo{$key}} = (); |
%{$$resinfo{$key}} = (); |
Line 455 sub process_resinfo {
|
Line 472 sub process_resinfo {
|
} elsif ($$resources{$key}{type} eq "assessment/x-bb-pool") { |
} elsif ($$resources{$key}{type} eq "assessment/x-bb-pool") { |
%{$$resinfo{$key}} = (); |
%{$$resinfo{$key}} = (); |
&process_assessment($context,$key,$docroot,'pool',$dirname,$destdir,\%{$$resinfo{$key}},$total,$udom,$uname,$pagesfiles,$sequencesfiles); |
&process_assessment($context,$key,$docroot,'pool',$dirname,$destdir,\%{$$resinfo{$key}},$total,$udom,$uname,$pagesfiles,$sequencesfiles); |
|
push @{$pools}, $key; |
} elsif ($$resources{$key}{type} eq "assessment/x-bb-quiz") { |
} elsif ($$resources{$key}{type} eq "assessment/x-bb-quiz") { |
%{$$resinfo{$key}} = (); |
%{$$resinfo{$key}} = (); |
&process_assessment($context,$key,$docroot,'quiz',$dirname,$destdir,\%{$$resinfo{$key}},$total,$udom,$uname,$pagesfiles,$sequencesfiles); |
&process_assessment($context,$key,$docroot,'quiz',$dirname,$destdir,\%{$$resinfo{$key}},$total,$udom,$uname,$pagesfiles,$sequencesfiles); |
Line 479 sub process_resinfo {
|
Line 497 sub process_resinfo {
|
&process_announce($key,$docroot,$destdir,\%{$$resinfo{$key}},$resinfo,$seqstem,$resrcfiles); |
&process_announce($key,$docroot,$destdir,\%{$$resinfo{$key}},$resinfo,$seqstem,$resrcfiles); |
} |
} |
} |
} |
|
} |
} |
} |
if (@{$announcements}) { |
if (@{$announcements}) { |
$$items{'Top'}{'contentscount'} ++; |
$$items{'Top'}{'contentscount'} ++; |
Line 491 sub process_resinfo {
|
Line 510 sub process_resinfo {
|
} |
} |
if (@{$surveys}) { |
if (@{$surveys}) { |
$$items{'Top'}{'contentscount'} ++; |
$$items{'Top'}{'contentscount'} ++; |
|
} |
|
if (@{$pools}) { |
|
$$items{'Top'}{'contentscount'} ++; |
} |
} |
} |
} |
|
|
$$total{'board'} = $board_count; |
$$total{'board'} = $board_count; |
$$total{'quiz'} = @{$quizzes}; |
$$total{'quiz'} = @{$quizzes}; |
$$total{'surv'} = @{$surveys}; |
$$total{'surv'} = @{$surveys}; |
|
$$total{'pool'} = @{$pools}; |
} |
} |
|
|
sub build_structure { |
sub build_structure { |
my ($cms,$context,$destdir,$items,$resinfo,$resources,$hrefs,$udom,$uname,$newdir,$timenow,$cdom,$crs,$timestamp,$total,$boards,$announcements,$quizzes,$surveys,$boardnum,$pagesfiles,$seqfiles,$topurls,$topnames,$packages) = @_; |
my ($cms,$context,$destdir,$items,$resinfo,$resources,$targets,$hrefs,$udom,$uname,$newdir,$timenow,$cdom,$crs,$timestamp,$total,$boards,$announcements,$quizzes,$surveys,$pools,$boardnum,$pagesfiles,$seqfiles,$topurls,$topnames,$packages,$includeditems) = @_; |
my %flag = (); |
my %flag = (); |
my %count = (); |
my %count = (); |
my %pagecontents = (); |
my %pagecontents = (); |
my %seqtext = (); |
my %seqtext = (); |
my $topnum = 0; |
my $topnum = 0; |
|
my $topspecials = @$announcements + @$boards + @$quizzes + @$surveys + @$pools; |
|
|
if (!-e "$destdir") { |
if (!-e "$destdir") { |
mkdir("$destdir",0755); |
mkdir("$destdir",0755); |
Line 538 sub build_structure {
|
Line 561 sub build_structure {
|
} |
} |
|
|
foreach my $key (sort keys %{$items}) { |
foreach my $key (sort keys %{$items}) { |
|
if ($$includeditems{$key}) { |
%{$flag{$key}} = ( |
%{$flag{$key}} = ( |
page => 0, |
page => 0, |
seq => 0, |
seq => 0, |
Line 563 sub build_structure {
|
Line 587 sub build_structure {
|
$seqtext{$key} = "<map>\n"; |
$seqtext{$key} = "<map>\n"; |
} |
} |
if ($$items{$key}{contentscount} == 0) { |
if ($$items{$key}{contentscount} == 0) { |
$seqtext{$key} .= qq|<resource id="$curr_id" src="" type="start"></resource> |
if ($key eq 'Top') { |
|
unless ($topspecials) { |
|
$seqtext{$key} .= qq|<resource id="$curr_id" src="" type="start"></resource> |
<link from="$curr_id" to="$next_id" index="$curr_id"></link> |
<link from="$curr_id" to="$next_id" index="$curr_id"></link> |
<resource id="$next_id" src="" type="finish"></resource>\n|; |
<resource id="$next_id" src="" type="finish"></resource>\n|; |
|
} |
|
} else { |
|
$seqtext{$key} .= qq|<resource id="$curr_id" src="" type="start"></resource> |
|
<link from="$curr_id" to="$next_id" index="$curr_id"></link> |
|
<resource id="$next_id" src="" type="finish"></resource>\n|; |
|
} |
} else { |
} else { |
my $contcount = @{$$items{$key}{contents}}; |
my $contcount = @{$$items{$key}{contents}}; |
my $contitem = $$items{$key}{contents}[0]; |
my $contitem = $$items{$key}{contents}[0]; |
Line 589 sub build_structure {
|
Line 621 sub build_structure {
|
} |
} |
if ($contcount == 1) { |
if ($contcount == 1) { |
$seqtext{$key} .= qq|></resource> |
$seqtext{$key} .= qq|></resource> |
<link from="$curr_id" to="$next_id" index="$curr_id"></link> |
<link from="$curr_id" to="$next_id" index="$curr_id"></link>|; |
|
if ($key eq 'Top') { |
|
unless ($topspecials) { |
|
$seqtext{$key} .= qq| |
|
<resource id="$next_id" src="" type="finish"></resource>\n|; |
|
} |
|
} else { |
|
$seqtext{$key} .= qq| |
<resource id="$next_id" src="" type="finish"></resource>\n|; |
<resource id="$next_id" src="" type="finish"></resource>\n|; |
|
} |
} else { |
} else { |
if ($contcount > 2 ) { |
if ($contcount > 2 ) { |
for (my $i=1; $i<$contcount-1; $i++) { |
for (my $i=1; $i<$contcount-1; $i++) { |
Line 664 sub build_structure {
|
Line 704 sub build_structure {
|
$$total{page} += $count{$key}{page}; |
$$total{page} += $count{$key}{page}; |
} |
} |
$$total{seq} += $count{$key}{seq}; |
$$total{seq} += $count{$key}{seq}; |
|
} |
} |
} |
$topnum += ($count{'Top'}{page} + $count{'Top'}{seq}); |
$topnum += ($count{'Top'}{page} + $count{'Top'}{seq}); |
|
|
Line 680 sub build_structure {
|
Line 721 sub build_structure {
|
if (@{$surveys} > 0) { |
if (@{$surveys} > 0) { |
&process_specials($context,'surveys',$surveys,\$topnum,$$items{'Top'}{contentscount},$destdir,$udom,$uname,$cdom,$crs,$timenow,$newdir,$timestamp,$resinfo,\$seqtext{'Top'},$pagesfiles,$seqfiles,$topurls,$topnames); |
&process_specials($context,'surveys',$surveys,\$topnum,$$items{'Top'}{contentscount},$destdir,$udom,$uname,$cdom,$crs,$timenow,$newdir,$timestamp,$resinfo,\$seqtext{'Top'},$pagesfiles,$seqfiles,$topurls,$topnames); |
} |
} |
|
if (@{$pools} > 0) { |
|
&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'}; |
Line 817 sub process_specials {
|
Line 860 sub process_specials {
|
quizzes => 'quizzes', |
quizzes => 'quizzes', |
surveys => 'surveys', |
surveys => 'surveys', |
announcements => 'announcements', |
announcements => 'announcements', |
|
pools => 'pools' |
); |
); |
my %seqtitles = ( |
my %seqtitles = ( |
boards => 'Course Bulletin Boards', |
boards => 'Course Bulletin Boards', |
quizzes => 'Course Quizzes', |
quizzes => 'Course Quizzes', |
surveys => 'Course Surveys', |
surveys => 'Course Surveys', |
announcements => 'Course Announcements', |
announcements => 'Course Announcements', |
|
pools => 'Course Question Pools' |
); |
); |
$$topnum ++; |
$$topnum ++; |
|
|
Line 864 sub process_specials {
|
Line 909 sub process_specials {
|
$specialsrc = "/adm/$udom/$uname/$$timestamp[0]/bulletinboard"; |
$specialsrc = "/adm/$udom/$uname/$$timestamp[0]/bulletinboard"; |
} elsif ($type eq 'announcements') { |
} elsif ($type eq 'announcements') { |
$specialsrc = "$seqstem/resfiles/$$specials[0].html"; |
$specialsrc = "$seqstem/resfiles/$$specials[0].html"; |
|
} elsif ($type eq 'pools') { |
|
$specialsrc = "$seqstem/sequences/$$specials[0].sequence"; |
} else { |
} else { |
$specialsrc = "$seqstem/pages/$$specials[0].page"; |
$specialsrc = "$seqstem/pages/$$specials[0].page"; |
} |
} |
Line 1511 sub process_assessment {
|
Line 1558 sub process_assessment {
|
my @allids = (); |
my @allids = (); |
my %allanswers = (); |
my %allanswers = (); |
my %allchoices = (); |
my %allchoices = (); |
my $resdir = ''; |
|
if ($docroot =~ m|public_html/(.+)$|) { |
|
$resdir = $1; |
|
} |
|
my $id; # the current question ID |
my $id; # the current question ID |
my $answer_id; # the current answer ID |
my $answer_id; # the current answer ID |
my %toptag = ( pool => 'POOL', |
my %toptag = ( pool => 'POOL', |
Line 1692 sub process_assessment {
|
Line 1735 sub process_assessment {
|
} |
} |
print $fh qq|<map> |
print $fh qq|<map> |
|; |
|; |
my $probsrc="/res/$udom/$uname/$resdir/problems/$dirtitle/$allids[0].problem"; |
my $probsrc = "/res/lib/templates/simpleproblem.problem"; |
|
my ($cid,$cdom,$cnum); |
|
if ($context eq 'DOCS') { |
|
$cid = $ENV{'request.course.id'}; |
|
($cdom,$cnum) = split/_/,$cid; |
|
} |
|
if ($context eq 'CSTR') { |
|
$probsrc="/res/$udom/$uname/$dirname/problems/$dirtitle/$allids[0].problem"; |
|
} |
print $fh qq|<resource id="1" src="$probsrc" type="start" title="question_0001"></resource>|; |
print $fh qq|<resource id="1" src="$probsrc" type="start" title="question_0001"></resource>|; |
if (@allids == 1) { |
if (@allids == 1) { |
print $fh qq| |
print $fh qq| |
Line 1707 sub process_assessment {
|
Line 1758 sub process_assessment {
|
$curr_id = $j; |
$curr_id = $j; |
$next_id = $curr_id + 1; |
$next_id = $curr_id + 1; |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
$probsrc = "/res/$udom/$uname/$resdir/problems/$dirtitle/$allids[$j].problem"; |
$probsrc = "/res/$udom/$uname/$dirname/problems/$dirtitle/$allids[$j].problem"; |
} |
} |
print $fh qq| |
print $fh qq| |
<link from="$curr_id" to="$next_id" index="$curr_id"></link> |
<link from="$curr_id" to="$next_id" index="$curr_id"></link> |
Line 1721 sub process_assessment {
|
Line 1772 sub process_assessment {
|
} |
} |
print $fh qq|</map>|; |
print $fh qq|</map>|; |
close($fh); |
close($fh); |
|
my $qnum = 0; |
foreach my $id (@allids) { |
foreach my $id (@allids) { |
|
$qnum ++; |
my $output; |
my $output; |
|
my $permcontainer = $containerdir; |
|
$permcontainer =~ s#/home/httpd/html/userfiles#uploaded#; |
|
my $symb = $cid.'.'.$permcontainer.'___'.$qnum.'___lib/templates/simpleproblem.problem.0.'; |
|
my %resourcedata = (); |
|
for (my $i=0; $i<10; $i++) { |
|
my $iter = $i+1; |
|
$resourcedata{$symb.'text'.$iter} = ""; |
|
$resourcedata{$symb.'value'.$iter} = "unused"; |
|
$resourcedata{$symb.'position'.$iter} = "random"; |
|
} |
|
$resourcedata{$symb.'randomize'} = 'yes'; |
|
$resourcedata{$symb.'maxfoils'} = 10; |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
$output = qq|<problem> |
$output = qq|<problem> |
|; |
|; |
Line 1738 sub process_assessment {
|
Line 1803 sub process_assessment {
|
$$settings{$id}{feedbackcorr} |
$$settings{$id}{feedbackcorr} |
</postanswerdate> |
</postanswerdate> |
|; |
|; |
|
} else { |
|
$resourcedata{$symb.'questiontext'} = $$settings{$id}{text}; |
|
$resourcedata{$symb.'hiddenparts'} = '!essay'; |
|
$resourcedata{$symb.'questiontype'} = 'essay'; |
} |
} |
} else { |
} else { |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
$output .= qq|<startouttext />$$settings{$id}{text}\n|; |
$output .= qq|<startouttext />$$settings{$id}{text}\n|; |
|
} else { |
|
$resourcedata{$symb.'questiontext'} = $$settings{$id}{text}; |
} |
} |
my ($image,$imglink,$url); |
my ($image,$imglink,$url); |
if ( defined($$settings{$id}{image}) ) { |
if ( defined($$settings{$id}{image}) ) { |
Line 1757 sub process_assessment {
|
Line 1828 sub process_assessment {
|
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
$output .= $image.$imglink.$url.' |
$output .= $image.$imglink.$url.' |
<endouttext />'; |
<endouttext />'; |
|
} else { |
|
$resourcedata{$symb.'questiontext'} .= $image.$imglink.$url; |
} |
} |
if ($$settings{$id}{class} eq 'QUESTION_MULTIPLECHOICE') { |
if ($$settings{$id}{class} eq 'QUESTION_MULTIPLECHOICE') { |
my $numfoils = @{$allanswers{$id}}; |
my $numfoils = @{$allanswers{$id}}; |
Line 1765 sub process_assessment {
|
Line 1838 sub process_assessment {
|
<radiobuttonresponse max="$numfoils" randomize="yes"> |
<radiobuttonresponse max="$numfoils" randomize="yes"> |
<foilgroup> |
<foilgroup> |
|; |
|; |
|
} else { |
|
$resourcedata{$symb.'hiddenparts'} = '!radio'; |
|
$resourcedata{$symb.'questiontype'} = 'radio'; |
|
$resourcedata{$symb.'maxfoils'} = $numfoils; |
} |
} |
for (my $k=0; $k<@{$allanswers{$id}}; $k++) { |
for (my $k=0; $k<@{$allanswers{$id}}; $k++) { |
|
my $iter = $k+1; |
$output .= " <foil name=\"foil".$k."\" value=\""; |
$output .= " <foil name=\"foil".$k."\" value=\""; |
if (grep/^$allanswers{$id}[$k]$/,@{$$settings{$id}{correctanswer}}) { |
if (grep/^$allanswers{$id}[$k]$/,@{$$settings{$id}{correctanswer}}) { |
$output .= "true\" location=\""; |
$output .= "true\" location=\""; |
|
$resourcedata{$symb.'value'.$iter} = "true"; |
} else { |
} else { |
$output .= "false\" location=\""; |
$output .= "false\" location=\""; |
|
$resourcedata{$symb.'value'.$iter} = "false"; |
} |
} |
if (lc ($allanswers{$id}[$k]) =~ m/^\s?([Aa]ll)|([Nn]one)\sof\sthe\sabove\.?/) { |
if (lc ($allanswers{$id}[$k]) =~ m/^\s?([Aa]ll)|([Nn]one)\sof\sthe\sabove\.?/) { |
$output .= "bottom\""; |
$output .= "bottom\""; |
|
$resourcedata{$symb.'position'.$iter} = "bottom"; |
} else { |
} else { |
$output .= "random\""; |
$output .= "random\""; |
} |
} |
$output .= "\><startouttext />".$$settings{$id}{$allanswers{$id}[$k]}{text}; |
$output .= "\><startouttext />".$$settings{$id}{$allanswers{$id}[$k]}{text}; |
|
$resourcedata{$symb.'text'.$iter} = $$settings{$id}{$allanswers{$id}[$k]}{text}; |
my ($ans_image,$ans_link); |
my ($ans_image,$ans_link); |
if ( defined($$settings{$id}{$allanswers{$id}[$k]}{image}) ) { |
if ( defined($$settings{$id}{$allanswers{$id}[$k]}{image}) ) { |
if ( $$settings{$id}{$allanswers{$id}[$k]}{style} eq 'embed' ) { |
if ( $$settings{$id}{$allanswers{$id}[$k]}{style} eq 'embed' ) { |
Line 1788 sub process_assessment {
|
Line 1870 sub process_assessment {
|
} |
} |
} |
} |
$output .= $ans_image.$ans_link.'<endouttext /></foil>'."\n"; |
$output .= $ans_image.$ans_link.'<endouttext /></foil>'."\n"; |
|
$resourcedata{$symb.'text'.$iter} .= $ans_image.$ans_link; |
} |
} |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
chomp($output); |
chomp($output); |
Line 1803 sub process_assessment {
|
Line 1886 sub process_assessment {
|
<radiobuttonresponse max="$numfoils" randomize="yes"> |
<radiobuttonresponse max="$numfoils" randomize="yes"> |
<foilgroup> |
<foilgroup> |
|; |
|; |
|
} else { |
|
$resourcedata{$symb.'maxfoils'} = $numfoils; |
|
$resourcedata{$symb.'hiddenparts'} = '!radio'; |
|
$resourcedata{$symb.'questiontype'} = 'radio'; |
} |
} |
for (my $k=0; $k<@{$allanswers{$id}}; $k++) { |
for (my $k=0; $k<@{$allanswers{$id}}; $k++) { |
|
my $iter = $k+1; |
$output .= " <foil name=\"foil".$k."\" value=\""; |
$output .= " <foil name=\"foil".$k."\" value=\""; |
if (grep/^$allanswers{$id}[$k]$/,@{$$settings{$id}{correctanswer}}) { |
if (grep/^$allanswers{$id}[$k]$/,@{$$settings{$id}{correctanswer}}) { |
$output .= "true\" location=\"random\""; |
$output .= "true\" location=\"random\""; |
|
$resourcedata{$symb.'value'.$iter} = "true"; |
} else { |
} else { |
$output .= "false\" location=\"random\""; |
$output .= "false\" location=\"random\""; |
|
$resourcedata{$symb.'value'.$iter} = "false"; |
} |
} |
$output .= "\><startouttext />".$$settings{$id}{$allanswers{$id}[$k]}{text}."<endouttext /></foil>\n"; |
$output .= "\><startouttext />".$$settings{$id}{$allanswers{$id}[$k]}{text}."<endouttext /></foil>\n"; |
|
$resourcedata{$symb.'text'.$iter} = $$settings{$id}{$allanswers{$id}[$k]}{text}; |
} |
} |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
chomp($output); |
chomp($output); |
Line 1827 sub process_assessment {
|
Line 1918 sub process_assessment {
|
<optionresponse max="$numfoils" randomize="yes"> |
<optionresponse max="$numfoils" randomize="yes"> |
<foilgroup options="('True','False')"> |
<foilgroup options="('True','False')"> |
|; |
|; |
|
} else { |
|
$resourcedata{$symb.'newopt'} = ''; |
|
$resourcedata{$symb.'delopt'} = ''; |
|
$resourcedata{$symb.'options'} = "('True','False')"; |
|
$resourcedata{$symb.'hiddenparts'} = '!option'; |
|
$resourcedata{$symb.'questiontype'} = 'option'; |
|
$resourcedata{$symb.'maxfoils'} = $numfoils; |
} |
} |
for (my $k=0; $k<@{$allanswers{$id}}; $k++) { |
for (my $k=0; $k<@{$allanswers{$id}}; $k++) { |
|
my $iter = $k+1; |
$output .= " <foil name=\"foil".$k."\" value=\""; |
$output .= " <foil name=\"foil".$k."\" value=\""; |
if (grep/^$allanswers{$id}[$k]$/,@{$$settings{$id}{correctanswer}}) { |
if (grep/^$allanswers{$id}[$k]$/,@{$$settings{$id}{correctanswer}}) { |
$output .= "True\""; |
$output .= "True\""; |
|
$resourcedata{$symb.'value'.$iter} = "True"; |
} else { |
} else { |
$output .= "False\""; |
$output .= "False\""; |
|
$resourcedata{$symb.'value'.$iter} = "False"; |
} |
} |
$output .= "\><startouttext />".$$settings{$id}{$allanswers{$id}[$k]}{text}."<endouttext /></foil>\n"; |
$output .= "\><startouttext />".$$settings{$id}{$allanswers{$id}[$k]}{text}."<endouttext /></foil>\n"; |
|
$resourcedata{$symb.'text'.$iter} = $$settings{$id}{$allanswers{$id}[$k]}{text}; |
} |
} |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
chomp($output); |
chomp($output); |
Line 1846 sub process_assessment {
|
Line 1948 sub process_assessment {
|
} |
} |
} elsif ($$settings{$id}{class} eq 'QUESTION_ORDER') { |
} elsif ($$settings{$id}{class} eq 'QUESTION_ORDER') { |
my $numfoils = @{$allanswers{$id}}; |
my $numfoils = @{$allanswers{$id}}; |
|
my @allorder = (); |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
$output .= qq| |
$output .= qq| |
<rankresponse max="$numfoils" randomize="yes"> |
<rankresponse max="$numfoils" randomize="yes"> |
<foilgroup> |
<foilgroup> |
|; |
|; |
|
} else { |
|
$resourcedata{$symb.'newopt'} = ''; |
|
$resourcedata{$symb.'delopt'} = ''; |
|
$resourcedata{$symb.'hiddenparts'} = '!option'; |
|
$resourcedata{$symb.'questiontype'} = 'option'; |
|
$resourcedata{$symb.'maxfoils'} = $numfoils; |
} |
} |
for (my $k=0; $k<@{$allanswers{$id}}; $k++) { |
for (my $k=0; $k<@{$allanswers{$id}}; $k++) { |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
$output .= " <foil location=\"random\" name=\"foil".$k."\" value=\"".$$settings{$id}{$allanswers{$id}[$k]}{order}."\"><startouttext />".$$settings{$id}{$allanswers{$id}[$k]}{text}."<endouttext /></foil>\n"; |
$output .= " <foil location=\"random\" name=\"foil".$k."\" value=\"".$$settings{$id}{$allanswers{$id}[$k]}{order}."\"><startouttext />".$$settings{$id}{$allanswers{$id}[$k]}{text}."<endouttext /></foil>\n"; |
|
} else { |
|
my $iter = $k+1; |
|
$resourcedata{$symb.'text'.$iter} = $$settings{$id}{$allanswers{$id}[$k]}{text}; |
|
if (!grep/^$$settings{$id}{$allanswers{$id}[$k]}{order}$/,@allorder) { |
|
push @allorder, $$settings{$id}{$allanswers{$id}[$k]}{order}; |
|
} |
} |
} |
} |
} |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
Line 1863 sub process_assessment {
|
Line 1978 sub process_assessment {
|
</foilgroup> |
</foilgroup> |
</rankresponse> |
</rankresponse> |
|; |
|; |
|
} else { |
|
@allorder = sort {$a <=> $b} @allorder; |
|
$resourcedata{$symb.'options'} = "('".join("','",@allorder)."')"; |
} |
} |
} elsif ($$settings{$id}{class} eq 'QUESTION_FILLINBLANK') { |
} elsif ($$settings{$id}{class} eq 'QUESTION_FILLINBLANK') { |
my $numerical = 1; |
my $numerical = 1; |
Line 1906 sub process_assessment {
|
Line 2024 sub process_assessment {
|
|; |
|; |
} |
} |
} else { |
} else { |
if ($context eq 'CSTR') { |
if ($context eq 'DOCS') { |
|
$resourcedata{$symb.'hiddenparts'} = '!string'; |
|
$resourcedata{$symb.'questiontype'} = 'string'; |
|
$resourcedata{$symb.'maxfoils'} = @{$allanswers{$id}}; |
|
$resourcedata{$symb.'hiddenparts'} = '!string'; |
|
$resourcedata{$symb.'stringtype'} = 'ci'; |
|
$resourcedata{$symb.'stringanswer'} = $$settings{$id}{$allanswers{$id}[0]}{text}; |
|
} else { |
if (@{$allanswers{$id}} == 1) { |
if (@{$allanswers{$id}} == 1) { |
$output .= qq| |
$output .= qq| |
<stringresponse answer="$$settings{$id}{$allanswers{$id}[0]}{text}" type="ci"> |
<stringresponse answer="$$settings{$id}{$allanswers{$id}[0]}{text}" type="ci"> |
Line 1932 sub process_assessment {
|
Line 2057 sub process_assessment {
|
} |
} |
} |
} |
} elsif ($$settings{$id}{class} eq "QUESTION_MATCH") { |
} elsif ($$settings{$id}{class} eq "QUESTION_MATCH") { |
|
my @allmatchers = (); |
|
my %matchtext = (); |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
$output .= qq| |
$output .= qq| |
<matchresponse max="10" randomize="yes"> |
<matchresponse max="10" randomize="yes"> |
<foilgroup> |
<foilgroup> |
<itemgroup> |
<itemgroup> |
|; |
|; |
|
} else { |
|
$resourcedata{$symb.'newopt'} = ''; |
|
$resourcedata{$symb.'delopt'} = ''; |
|
$resourcedata{$symb.'hiddenparts'} = '!option'; |
|
$resourcedata{$symb.'questiontype'} = 'option'; |
|
$resourcedata{$symb.'maxfoils'} = @{$allanswers{$id}}; |
} |
} |
for (my $k=0; $k<@{$allchoices{$id}}; $k++) { |
for (my $k=0; $k<@{$allchoices{$id}}; $k++) { |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
Line 1946 sub process_assessment {
|
Line 2079 sub process_assessment {
|
<startouttext />$$settings{$id}{$allchoices{$id}[$k]}{text}<endouttext /> |
<startouttext />$$settings{$id}{$allchoices{$id}[$k]}{text}<endouttext /> |
</item> |
</item> |
|; |
|; |
|
} else { |
|
if (!grep/^$$settings{$id}{$allchoices{$id}[$k]}{text}$/,@allmatchers) { |
|
push @allmatchers, $$settings{$id}{$allchoices{$id}[$k]}{text}; |
|
$matchtext{$allchoices{$id}[$k]} = $$settings{$id}{$allchoices{$id}[$k]}{text}; |
|
} |
} |
} |
} |
} |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
Line 1960 sub process_assessment {
|
Line 2098 sub process_assessment {
|
<startouttext />$$settings{$id}{$allanswers{$id}[$k]}{text}<endouttext /> |
<startouttext />$$settings{$id}{$allanswers{$id}[$k]}{text}<endouttext /> |
</foil> |
</foil> |
|; |
|; |
|
} else { |
|
my $iter = $k+1; |
|
$resourcedata{$symb.'value'.$iter} = $matchtext{$$settings{$id}{$allanswers{$id}[$k]}{choice_id}}; |
|
$resourcedata{$symb.'text'.$iter} = $$settings{$id}{$allanswers{$id}[$k]}{text}; |
} |
} |
} |
} |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
Line 1967 sub process_assessment {
|
Line 2109 sub process_assessment {
|
</foilgroup> |
</foilgroup> |
</matchresponse> |
</matchresponse> |
|; |
|; |
|
} else { |
|
$resourcedata{$symb.'options'} = "('".join("','",@allmatchers)."')"; |
} |
} |
} |
} |
} |
} |
Line 1976 sub process_assessment {
|
Line 2120 sub process_assessment {
|
open(PROB,">$newdir/$id.problem"); |
open(PROB,">$newdir/$id.problem"); |
print PROB $output; |
print PROB $output; |
close PROB; |
close PROB; |
|
} else { |
|
# put %resourcedata; |
|
my $reply=&Apache::lonnet::cput |
|
('resourcedata',\%resourcedata,$cdom,$cnum); |
} |
} |
} |
} |
} |
} |
Line 2074 sub process_content {
|
Line 2222 sub process_content {
|
my $xmlfile = $docroot.'/'.$res.".dat"; |
my $xmlfile = $docroot.'/'.$res.".dat"; |
my $destresdir = $destdir; |
my $destresdir = $destdir; |
if ($context eq 'CSTR') { |
if ($context eq 'CSTR') { |
$destresdir =~ s|/home/$user/public_html/|/res/$dom/$user/|; |
# $destresdir =~ s|/home/$user/public_html/|/res/$dom/$user/|; |
|
$destresdir =~ s|/home/$user/public_html/|/priv/$user/|; |
} elsif ($context eq 'DOCS') { |
} elsif ($context eq 'DOCS') { |
$destresdir =~ s|^/home/httpd/html/userfiles|/uploaded|; |
$destresdir =~ s|^/home/httpd/html/userfiles|/uploaded|; |
} |
} |
Line 2252 sub process_content {
|
Line 2401 sub process_content {
|
} |
} |
} |
} |
|
|
open(FILE,">$destdir/resfiles/$res.html"); |
if (!open(FILE,">$destdir/resfiles/$res.html")) { |
push @{$resrcfiles}, "$res.html"; |
&Apache::lonnet::logthis("IMS import error: Cannot open file - $destdir/resfiles/$res.html - $!"); |
my $htmldoc = 0; |
} else { |
# if ($$settings{maindata}{text} =~ m-<(html|HTML)>.+<\\(html|HTML)-) { |
push @{$resrcfiles}, "$res.html"; |
if ($$settings{maindata}{text} =~ m-<(html|HTML)>-) { |
my $htmldoc = 0; |
$htmldoc = 1; |
# if ($$settings{maindata}{text} =~ m-<(html|HTML)>.+<\\(html|HTML)-) { |
} |
if ($$settings{maindata}{text} =~ m-<(html|HTML)>-) { |
unless ($htmldoc) { |
$htmldoc = 1; |
print FILE qq|<html> |
} |
|
unless ($htmldoc) { |
|
print FILE qq|<html> |
<head> |
<head> |
<title>$$settings{title}</title> |
<title>$$settings{title}</title> |
</head> |
</head> |
<body bgcolor='#ffffff'> |
<body bgcolor='#ffffff'> |
$fontcol |
$fontcol |
|; |
|; |
} |
} |
unless ($$settings{title} eq '') { |
unless ($$settings{title} eq '') { |
print FILE qq|$$settings{title}<br/><br/>\n|; |
print FILE qq|$$settings{title}<br/><br/>\n|; |
} |
|
print FILE qq| |
|
$$settings{maindata}{text} |
|
$linktag|; |
|
unless ($htmldoc) { |
|
if (defined($$settings{maindata}{textcolor})) { |
|
print FILE qq|</font>|; |
|
} |
} |
print FILE qq| |
print FILE qq| |
|
$$settings{maindata}{text} |
|
$linktag|; |
|
unless ($htmldoc) { |
|
if (defined($$settings{maindata}{textcolor})) { |
|
print FILE qq|</font>|; |
|
} |
|
print FILE qq| |
</body> |
</body> |
</html>|; |
</html>|; |
|
} |
|
close(FILE); |
} |
} |
close(FILE); |
|
} |
} |
|
|
|
|