[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 04 Apr 2006 08:18:33 -0000


raeburn		Tue Apr  4 04:18:33 2006 EDT

  Modified files:              
    /loncom/imspackages	imsimport.pm 
  Log:
  Support for import of WebCT Vista 4 IMS packages
  
  
Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.18 loncom/imspackages/imsimport.pm:1.19
--- loncom/imspackages/imsimport.pm:1.18	Mon Mar 27 14:05:15 2006
+++ loncom/imspackages/imsimport.pm	Tue Apr  4 04:18:33 2006
@@ -305,6 +305,7 @@
          <option value='bb6'>Blackboard 6</option>
          <option value='angel'>ANGEL</option>
          <option value='webctce4'>WebCT 4 Campus Edition</option>
+         <option value='webctvista4'>WebCT Vista 4</option>
         </select>
         </font>
        </td>
@@ -408,10 +409,13 @@
     my $conditions;
 
     if ($unzip_result eq 'ok') {
-        $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo,'choose',\%includedres,\%includeditems);
+        $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 'webctce4') {
+                if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4' 
+                    || $cms eq 'webctvista4') {
                     foreach my $area (keys %{$$cmsmap{$cms}}) {
                         if ($resources{$res}{type} eq $$cmsmap{$cms}{$area}) {
                             $count{$area} ++;
@@ -650,6 +654,7 @@
     my @pages = ();
     my @sequences = ();
     my @resrcfiles = ();
+    my @assessmentfiles = ();
 
     my $tempdir = $env{'form.tempdir'};
 
@@ -670,11 +675,18 @@
         }
     }
 
-    my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo,'prepare',\%includedres);
+    my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,
+                          \%resources,\%items,\%hrefs,\%resinfo,'prepare',
+                          \%includedres);
     if ($manifest_result eq 'ok') {
         foreach my $res (sort keys %resources) {
             if ($importareas{$resources{$res}{type}}) {
                 $includedres{$res} = 1;
+                if ($resources{$res}{type} eq 'webct.manifest' || 
+                     $resources{$res}{type} eq 'webct.assessment' ||
+                     $resources{$res}{type} eq 'webct.question') {
+                    push(@assessmentfiles,$res);
+                }   
             }
         }
         foreach my $itm (sort keys %items) {
@@ -686,7 +698,9 @@
         &Apache::imsprocessor::get_parents(\%includeditems,\%items,$itm);
     }
 
-    $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo,'build',\%includedres,\%includeditems);
+    $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,
+                       \%resources,\%items,\%hrefs,\%resinfo,'build',
+                       \%includedres,\%includeditems);
     if ($manifest_result eq 'ok') {
         &Apache::imsprocessor::target_resources(\%resources,\%importareas,\@targets);
 
@@ -705,7 +719,7 @@
 
         &Apache::imsprocessor::process_resinfo($cms,'CSTR',$tempdir,$destdir,\%items,\%resources,\@targets,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$seqstem,$seqstem,\@resrcfiles,\@packages,\%hrefs,\@pages,\@sequences,\%randompicks);
 
-        my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\%importareas);
+        my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\%importareas,\@assessmentfiles);
    
         &Apache::imsprocessor::build_structure($cms,'CSTR',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,$newdir,$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems,\%randompicks);