',
+ &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.= '