--- loncom/imspackages/imsimport.pm 2013/07/02 19:04:42 1.40 +++ loncom/imspackages/imsimport.pm 2013/07/27 22:04:49 1.43 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: imsimport.pm,v 1.40 2013/07/02 19:04:42 raeburn Exp $ +# $Id: imsimport.pm,v 1.43 2013/07/27 22:04:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -100,7 +100,7 @@ function createWin() { newWindow.document.write("") newWindow.document.write("") newWindow.document.write("$fullpath") - newWindow.document.write("") + newWindow.document.write("") newWindow.document.write("\\n") newWindow.document.write("") newWindow.document.write('$end_page') @@ -286,7 +286,7 @@ END_OF_TWO # ---------------------------------------------------------------- Display One sub display_one { my ($r,$fn,$fullpath,$formname) = @_; - $r->print('
'. + $r->print(''. &Apache::lonhtmlcommon::topic_bar(1,&mt('Specify the Course Management system used to create the package')). &mt('Choose the CMS used to create your IMS content package.').'  
'."\n". &Apache::lonhtmlcommon::topic_bar(2,&mt('Create a directory where you will unpack your IMS package'))."\n". - &mt('Create a destination LON-CAPA directory in which to store the contents of the IMS package file.').'  

+ &mt('Create a destination LON-CAPA directory in which to store the contents of the IMS package file.').'  

-      - +      +
'); } @@ -396,7 +396,7 @@ sub display_two { $conditions = 'none'; } - $r->print('
'. + $r->print(''. &Apache::lonhtmlcommon::topic_bar(3,$lt{'cont'}). &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). @@ -409,7 +409,7 @@ sub display_two { $r->print(&Apache::loncommon::start_data_table_row()."\n". 'print('onClick="javascript:setOptions('."'$area','$counter'".');" '); + $r->print('onclick="javascript:setOptions('."'$area','$counter'".');" '); } $r->print('/>'. '  '.$$areaname{$area}.'   - '. @@ -459,8 +459,8 @@ sub display_two { if ($count{users} == 0) { $r->print(''."\n"); } - $r->print('    -
'); + $r->print('    + '); } else { $r->print($lt{'unpa'}); } @@ -543,7 +543,9 @@ sub display_three { my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir, \%resources,\%items,\%hrefs,\%resinfo,'prepare', \%includedres); + if ($manifest_result eq 'ok') { + my %possibledep; foreach my $res (sort keys %resources) { if ($importareas{$resources{$res}{type}}) { $includedres{$res} = 1; @@ -552,6 +554,13 @@ sub display_three { $resources{$res}{type} eq 'webct.question') { push(@assessmentfiles,$res); } + } elsif ($resources{$res}{usedby}) { + $possibledep{$res} = 1; + } + } + foreach my $res (sort(keys(%possibledep))) { + if ($includedres{$resources{$res}{usedby}}) { + $includedres{$res} = 1; } } foreach my $itm (sort keys %items) { @@ -566,6 +575,7 @@ sub display_three { $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); @@ -584,7 +594,7 @@ sub display_three { &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,\@assessmentfiles,\%total); + my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,\%resources,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\@assessmentfiles,\%total); &Apache::imsprocessor::build_structure($cms,'CSTR',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,$dirpath,$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems,\%randompicks);