[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm imsimportdocs.pm imsprocessor.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Fri, 24 Mar 2006 17:36:28 -0000
This is a MIME encoded message
--raeburn1143221788
Content-Type: text/plain
raeburn Fri Mar 24 12:36:28 2006 EDT
Modified files:
/loncom/imspackages imsimport.pm imsimportdocs.pm imsprocessor.pm
Log:
Existing webct4 code identified as appropriate for WebCT 4 Campus Edition. Vista to follow.
--raeburn1143221788
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20060324123628.txt"
Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.15 loncom/imspackages/imsimport.pm:1.16
--- loncom/imspackages/imsimport.pm:1.15 Thu Mar 23 18:17:46 2006
+++ loncom/imspackages/imsimport.pm Fri Mar 24 12:36:27 2006
@@ -304,7 +304,7 @@
<option value='bb5'>Blackboard 5</option>
<option value='bb6'>Blackboard 6</option>
<option value='angel'>ANGEL</option>
- <option value='webct4'>WebCT 4</option>
+ <option value='webctce4'>WebCT 4 Campus Edition</option>
</select>
</font>
</td>
@@ -411,7 +411,7 @@
$manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo,'choose',\%includedres,\%includeditems);
if ($manifest_result eq 'ok') {
foreach my $res (sort keys %resources) {
- if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webct4') {
+ if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4') {
foreach my $area (keys %{$$cmsmap{$cms}}) {
if ($resources{$res}{type} eq $$cmsmap{$cms}{$area}) {
$count{$area} ++;
Index: loncom/imspackages/imsimportdocs.pm
diff -u loncom/imspackages/imsimportdocs.pm:1.16 loncom/imspackages/imsimportdocs.pm:1.17
--- loncom/imspackages/imsimportdocs.pm:1.16 Thu Mar 23 18:17:46 2006
+++ loncom/imspackages/imsimportdocs.pm Fri Mar 24 12:36:27 2006
@@ -230,7 +230,7 @@
<option value='bb5'>Blackboard 5</option>
<option value='bb6'>Blackboard 6</option>
<option value='angel'>ANGEL</option>
- <option value='webct4'>WebCT 4</option>
+ <option value='webctce4'>WebCT 4 Campus Edition</option>
</select>
</font>
</td>
@@ -332,7 +332,7 @@
$manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo,'choose',\%includedres,\%includeditems);
if ($manifest_result eq 'ok') {
foreach my $res (sort keys %resources) {
- if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webct4') {
+ if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4') {
foreach my $area (keys %{$cmsmap{$cms}}) {
if ($resources{$res}{type} eq $cmsmap{$cms}{$area}) {
$count{$area} ++;
Index: loncom/imspackages/imsprocessor.pm
diff -u loncom/imspackages/imsprocessor.pm:1.33 loncom/imspackages/imsprocessor.pm:1.34
--- loncom/imspackages/imsprocessor.pm:1.33 Fri Mar 24 12:16:07 2006
+++ loncom/imspackages/imsprocessor.pm Fri Mar 24 12:36:27 2006
@@ -64,7 +64,7 @@
survey => 'FORM',
);
@{$$cmsmap{angel}{doc}} = ('FILE','PAGE');
- %{$$cmsmap{webct4}} = (
+ %{$$cmsmap{webctce4}} = (
quiz => 'webctquiz',
survey => 'webctsurvey',
doc => 'webcontent'
@@ -158,7 +158,7 @@
bb6 => 'organization',
bb5 => 'tableofcontents',
angel => 'organization',
- webct4 => 'organization',
+ webctce4 => 'organization',
);
my %contents = ();
my @state = ();
@@ -202,7 +202,7 @@
%{$$items{$itm}} = ();
$$items{$itm}{contentscount} = 0;
@{$$items{$itm}{contents}} = ();
- if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webct4') {
+ if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4') {
$$items{$itm}{resnum} = $attr->{identifierref};
if ($cms eq 'bb5') {
$$items{$itm}{title} = $attr->{title};
@@ -256,7 +256,7 @@
$lastitem = $itm;
}
}
- if ($cms eq 'webct4') {
+ if ($cms eq 'webctce4') {
if (($state[-1] eq "webct:properties") && (@state > 4)) {
$$items{$itm}{properties} = $attr->{identifierref};
}
@@ -267,7 +267,7 @@
if ($cms eq 'bb5' || $cms eq 'bb6') {
$$resources{$identifier}{file} = $attr->{file};
$$resources{$identifier}{type} = $attr->{type};
- } elsif ($cms eq 'webct4') {
+ } elsif ($cms eq 'webctce4') {
$$resources{$identifier}{type} = $attr->{type};
$$resources{$identifier}{file} = $attr->{href};
} elsif ($cms eq 'angel') {
@@ -280,7 +280,7 @@
}
} elsif ("@state" eq "manifest resources resource file") {
if ($$includedres{$identifier} || $phase ne 'build') {
- if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webct4') {
+ if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4') {
push @{$$hrefs{$identifier}},$attr->{href};
} elsif ($cms eq 'angel') {
if ($attr->{href} =~ m/^_assoc\\$identifier\\(.+)$/) {
@@ -303,7 +303,7 @@
if ($cms eq 'angel' || $cms eq 'bb6') {
$$items{$itm}{title} = $text;
}
- if ($cms eq 'webct4') {
+ if ($cms eq 'webctce4') {
$$items{$itm}{title} = $text;
$$items{$itm}{title} =~ s/(<[^>]*>)//g;
}
@@ -372,7 +372,7 @@
%{$$url{$key}} = ();
foreach my $file (@{$$hrefs{$key}}) {
my $source = $tempdir.'/'.$key.'/'.$file;
- if ($cms eq 'webct4') {
+ if ($cms eq 'webctce4') {
$source = $tempdir.'/'.$file;
}
my $filename = '';
@@ -384,12 +384,12 @@
}
$file =~ s-\\-/-g;
my $copyfile = $file;
- if ($cms eq 'webct4') {
+ if ($cms eq 'webctce4') {
if ($file =~ m-/my_files/(.+)$-) {
$copyfile = $1;
}
}
- unless (($cms eq 'webct4') && ($copyfile =~ m/questionDB\.xml$/ || $copyfile =~ m/quiz_QIZ_\d+\.xml$/ || $copyfile =~ m/properties_QIZ_\d+\.xml$/)) {
+ unless (($cms eq 'webctce4') && ($copyfile =~ m/questionDB\.xml$/ || $copyfile =~ m/quiz_QIZ_\d+\.xml$/ || $copyfile =~ m/properties_QIZ_\d+\.xml$/)) {
$copyfile = $fpath.$copyfile;
my $fileresult;
if (-e $source) {
@@ -427,7 +427,7 @@
} elsif ($cms eq 'bb5' || $cms eq 'bb6') {
rename("$tempdir/$key/$file","$destdir/resfiles/$key/$file");
}
- } elsif ($cms eq 'webct4') {
+ } elsif ($cms eq 'webctce4') {
if ($file =~ m-/my_files/(.+)$-) {
my $copyfile = $1;
if ($copyfile =~ m-^[^/]+/[^/]+-) {
@@ -569,7 +569,7 @@
if (@{$pools}) {
$$items{'Top'}{'contentscount'} ++;
}
- } elsif ($cms eq 'webct4') {
+ } elsif ($cms eq 'webctce4') {
foreach my $key (sort keys %{$resources}) {
if (grep/^$key$/,@{$targets}) {
if ($$resources{$key}{type} eq "webcontent") {
@@ -649,7 +649,7 @@
my $resnum = $$items{$key}{resnum};
my $type = $$resources{$resnum}{type};
my $contentscount = $$items{$key}{'contentscount'};
- if (($cms eq 'angel' && $type eq "FOLDER") || (($cms eq 'bb5' || $cms eq 'bb6') && $$resinfo{$resnum}{'isfolder'} eq "true") && (($type eq "resource/x-bb-document") || ($type eq "resource/x-bb-staffinfo") || ($type eq "resource/x-bb-externallink")) || ($cms eq 'webct4' && $contentscount > 0)) {
+ if (($cms eq 'angel' && $type eq "FOLDER") || (($cms eq 'bb5' || $cms eq 'bb6') && $$resinfo{$resnum}{'isfolder'} eq "true") && (($type eq "resource/x-bb-document") || ($type eq "resource/x-bb-staffinfo") || ($type eq "resource/x-bb-externallink")) || ($cms eq 'webctce4' && $contentscount > 0)) {
unless (($cms eq 'bb5') && $key eq 'Top') {
$seqtext{$key} = "<map>\n";
}
@@ -887,12 +887,12 @@
sub make_structure {
my ($cms,$key,$srcstem,$flag,$count,$timestamp,$boardnum,$hrefs,$pagecontents,$res,$type,$file,$resinfo,$contitem,$uname,$cdom,$contcount,$packageflag,$contitemcount,$randompick) = @_;
my $src ='';
- if (($cms eq 'angel' && $type eq 'FOLDER') || (($cms eq 'bb5' || $cms eq 'bb6') && (($$resinfo{$res}{'isfolder'} eq 'true') || $key eq 'Top')) || ($cms eq 'webct4' && $contitemcount > 0)) {
+ if (($cms eq 'angel' && $type eq 'FOLDER') || (($cms eq 'bb5' || $cms eq 'bb6') && (($$resinfo{$res}{'isfolder'} eq 'true') || $key eq 'Top')) || ($cms eq 'webctce4' && $contitemcount > 0)) {
$src = $srcstem.'/sequences/'.$contitem.'.sequence';
$$flag{$key}{page} = 0;
$$flag{$key}{seq} = 1;
$$count{$key}{seq} ++;
- } elsif ($cms eq 'webct4' && $randompick) {
+ } elsif ($cms eq 'webctce4' && $randompick) {
$src = $srcstem.'/sequences/'.$res.'.sequence';
$$flag{$key}{page} = 0;
$$flag{$key}{seq} = 1;
@@ -940,7 +940,7 @@
}
$$flag{$key}{seq} = 0;
}
- } elsif ($cms eq 'webct4') {
+ } elsif ($cms eq 'webctce4') {
if ($type eq 'webctquiz') {
$src = $srcstem.'/pages/'.$res.'.page';
$$count{$key}{page} ++;
@@ -2540,7 +2540,7 @@
&parse_bb5_assessment($res,$docroot,$container,$settings,\%allanswers,\%allchoices,\@allids);
} elsif ($cms eq 'bb6') {
&parse_bb6_assessment($res,$docroot,$container,$settings,\@allids);
- } elsif ($cms eq 'webct4') {
+ } elsif ($cms eq 'webctce4') {
unless($$dbparse) {
&parse_webct4_questionDB($docroot,$$resources{$res}{file},$catinfo,$qzdbsettings,\%alldbanswers,\%alldbchoices,\@alldbquestids);
if (!-e "$destdir/sequences") {
@@ -2603,7 +2603,7 @@
}
}
my $dirtitle;
- unless ($cms eq 'webct4') {
+ unless ($cms eq 'webctce4') {
$dirtitle = $$settings{'title'};
$dirtitle =~ s/\W//g;
$dirtitle .= '_'.$res;
@@ -2616,7 +2616,7 @@
$newdir = "$destdir/problems/$dirtitle";
}
- if ($cms eq 'webct4') {
+ if ($cms eq 'webctce4') {
&build_problem_container($cms,$dirtitle,$destdir,$container,$res,$total,$sequencesfiles,$pagesfiles,$randompickflag,$context,\@allids,$udom,$uname,$dirname,\$containerdir,$cid,$cdom,$cnum,$catinfo,$qzdbsettings);
} else {
&build_problem_container($cms,$dirtitle,$destdir,$container,$res,$total,$sequencesfiles,$pagesfiles,$randompickflag,$context,\@allids,$udom,$uname,$dirname,\$containerdir,$cid,$cdom,$cnum,$catinfo,$settings);
@@ -2658,7 +2658,7 @@
my $probsrc = "/res/lib/templates/simpleproblem.problem";
if ($context eq 'CSTR') {
foreach my $id (@{$allids}) {
- if ($cms eq 'webct4') {
+ if ($cms eq 'webctce4') {
$probtitle{$id} = $$settings{$id}{title};
} else {
$probtitle{$id} = $$settings{title};
@@ -2667,7 +2667,7 @@
$probtitle{$id} =~ s/\W//g;
$probtitle{$id} .= '_'.$id;
}
- if ($cms eq 'webct4' && $container ne 'database') {
+ if ($cms eq 'webctce4' && $container ne 'database') {
my $catid = $$settings{$$allids[0]}{category};
my $probdir = $$catinfo{$catid}{title}.'_'.$catid;
$probdir =~ s/\s/_/g;
@@ -2691,7 +2691,7 @@
$curr_id = $j;
$next_id = $curr_id + 1;
if ($context eq 'CSTR') {
- if ($cms eq 'webct4' && $container ne 'database') {
+ if ($cms eq 'webctce4' && $container ne 'database') {
my $catid = $$settings{$$allids[$j]}{category};
my $probdir = $$catinfo{$catid}{title}.'_'.$catid;
$probdir =~ s/\s/_/g;
--raeburn1143221788--