'.
+ &Apache::loncommon::end_scrollbox().
+ $end_page;
+ $scriptblocklog=~s/\'/\\'/gs;
+ &Apache::lonxml::add_script_result(
+ &Apache::loncommon::modal_adhoc_script($function_name,500,500,$scriptblocklog).
+ "".&mt('Script Vars')." "
+ );
}
} elsif ($target eq "edit" ) {
#&Apache::run::run($bodytext,$safeeval);
@@ -385,9 +384,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 +413,17 @@ sub start_import {
$location=~s/\s*$//s;
$result.=&Apache::edit::editline($location,$bodytext,'',40);
$result.=&Apache::edit::browse(undef,'textnode');
- $result.= '