--- loncom/xml/scripttag.pm 2010/05/23 12:29:25 1.153 +++ loncom/xml/scripttag.pm 2011/12/10 18:11:05 1.159 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # ".&mt('Script Vars')."
"; - &Apache::lonxml::add_script_result($script_var); + &Apache::lonxml::add_script_result( + &Apache::loncommon::modal_adhoc_window($function_name,500,500, + '
'.&Apache::run::dump($target,$safeeval).'
', + &mt('Script Vars'))."
"); } } elsif ($target eq "edit" ) { #&Apache::run::run($bodytext,$safeeval); @@ -385,9 +369,17 @@ sub start_import { return ""; } my $importmode=&Apache::lonxml::get_param('importmode',$parstack,$safeeval); - if ($importmode eq 'problem') { - $file=~s/^\s*//s; - $file=~s/<\/problem>\s*$/<\/library>/s; + if (($importmode eq 'problem') || ($importmode eq 'part')) { +# We are using import to import published problems + if (($importmode eq 'problem') || ($file=~//s)) { +# We explicitly don't want this to be a separate part or the problem already has parts + $file=~s/^\s*//s; + $file=~s/<\/problem>\s*$/<\/library>/s; + } else { +# We want this to be a separate part, but it currently is not + $file=~s/^\s*//s; + $file=~s/<\/problem>\s*$/<\/part><\/library>/s; + } } my $dir=$location; $dir=~s:/[^/]*$::; @@ -406,14 +398,17 @@ sub start_import { $location=~s/\s*$//s; $result.=&Apache::edit::editline($location,$bodytext,'',40); $result.=&Apache::edit::browse(undef,'textnode'); - $result.= '