'.
&mt("Unable to write to [_1]",
@@ -861,12 +802,18 @@ sub analyze {
$request->print('');
}
} else {
- $request->print(''.&mt('Response').' '.$part.' '.
- &mt('is not analyzable at this time').'
');
+ $request->print(''
+ .&mt('Response [_1] is not analyzable at this time.',$part)
+ .'
'
+ );
}
}
if (scalar(keys(%allparts)) == 0 ) {
- $request->print(''.&mt('Found no analyzable responses in this problem, currently only Numerical, Formula and String response styles are supported.').'
');
+ $request->print(''
+ .&mt('Found no analyzable responses in this problem.'
+ .' Currently only Numerical, Formula and String response styles are supported.')
+ .'
'
+ );
}
&Apache::lonhtmlcommon::Close_PrgWin($request,\%prog_state);
&analyze_footer($request);
@@ -914,8 +861,12 @@ sub editxmlmode {
my $result;
my $problem=&Apache::lonnet::getfile($file);
if ($problem eq -1) {
- &Apache::lonxml::error(" ".&mt('Unable to find').
- " $file");
+ &Apache::lonxml::error(
+ ' '
+ .&mt('Unable to find [_1]',
+ ''.$file.'')
+ .'');
+
$problem='';
}
if (defined($env{'form.editxmltext'}) || defined($env{'form.Undo'})) {
@@ -930,20 +881,17 @@ sub editxmlmode {
&renderpage($request,$file);
} else {
my ($rows,$cols) = &Apache::edit::textarea_sizes(\$problem);
- my $xml_help = ''.
- &Apache::loncommon::helpLatexCheatsheet("Problem_Editor_XML_Index",
- "Problem Editing Help").
- ' | '.
- &Apache::loncommon::help_open_menu(undef,undef,5,'Authoring').
- ' |
';
if ($cols > 80) { $cols = 80; }
if ($cols < 70) { $cols = 70; }
if ($rows < 20) { $rows = 20; }
my $js =
&Apache::edit::js_change_detection().
&Apache::loncommon::resize_textarea_js().
- &Apache::structuretags::setmode_javascript();
+ &Apache::structuretags::setmode_javascript().
+ &Apache::lonhtmlcommon::dragmath_js("EditMathPopup");
my $only_body = ($env{'environment.remote'} eq 'off')? 0 : 1;
+ my $dragmath_button =
+ &Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1);
my $start_page =
&Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js,
{'no_auto_mt_title' => 1,
@@ -961,15 +909,17 @@ sub editxmlmode {
+
+ '.$dragmath_button.'
@@ -1023,7 +973,7 @@ sub renderpage {
my $filename=(split('/',$file))[-1];
my $error =
" ".&mt('Unable to find [_1]',
- ' '.$filename.'')
+ ''.$filename.'')
."";
$result.=
&Apache::loncommon::simple_error_page($request,'Not available',
@@ -1086,8 +1036,10 @@ sub get_template_list {
}
my @files = glob($Apache::lonnet::perlvar{'lonIncludes'}.
'/templates/*.'.$glob_extension);
- @files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title'))]} (@files);
- @files = sort {$a->[1] cmp $b->[1]} (@files);
+ @files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title')),
+ (&Apache::lonnet::metadata($_, 'category')?&mt(&Apache::lonnet::metadata($_, 'category')):&mt('Miscellaneous')),
+ &mt(&Apache::lonnet::metadata($_, 'help'))]} (@files);
+ @files = sort {$a->[2].$a->[1] cmp $b->[2].$b->[1]} (@files);
my ($midpoint,$seconddiv,$numfiles);
$numfiles = 0;
foreach my $file (@files) {
@@ -1102,16 +1054,28 @@ sub get_template_list {
}
}
my $count = 0;
+ my $currentcategory='';
foreach my $file (@files) {
next if ($file->[1] !~ /\S/);
+ if ($file->[2] ne $currentcategory) {
+ $currentcategory=$file->[2];
+ if ((!$seconddiv) && ($count >= $midpoint)) {
+ $result .= '
'."\n".''."\n";
+ $seconddiv = 1;
+ }
+ $result.='
'.$currentcategory.'
';
+ $count++;
+ }
$result .=
'
'."\n";
- $count ++;
- if ((!$seconddiv) && ($count >= $midpoint)) {
- $result .= ''."\n".''."\n";
- $seconddiv = 1;
+ $file->[1].'';
+ if ($file->[3]) {
+ $result.=&Apache::loncommon::help_open_topic($file->[3]);
}
+ my $filename=$file->[0];
+ $filename=~s/^\/home\/httpd\/html//;
+ $result.='
'.&mt('Example').''."\n";
+ $count ++;
}
if ($numfiles > 0) {
$result .= '
'."\n".''."\n";
@@ -1155,7 +1119,7 @@ $start_page
".&mt("Creating a new $extension resource.")."
$errormsg
".&mt("The requested file [_1] currently does not exist.",
- "$shownurl")."
+ ''.$shownurl.'')."
".&mt("To create a new $extension, select a template from the".
@@ -1180,11 +1144,11 @@ sub update_construct_style {
&& !defined($env{'form.newrandomization'})) {
if ((!$env{'form.style_file'} && $env{'construct.style'})
||$env{'form.clear_style_file'}) {
- &Apache::lonnet::delenv('construct\\.style');
+ &Apache::lonnet::delenv('construct.style');
} elsif ($env{'form.style_file'}
&& $env{'construct.style'} ne $env{'form.style_file'}) {
- &Apache::lonnet::appenv('construct.style' =>
- $env{'form.style_file'});
+ &Apache::lonnet::appenv({'construct.style' =>
+ $env{'form.style_file'}});
}
}
}