--- loncom/homework/structuretags.pm 2014/11/28 18:23:04 1.525
+++ loncom/homework/structuretags.pm 2015/01/19 15:35:53 1.527
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.525 2014/11/28 18:23:04 raeburn Exp $
+# $Id: structuretags.pm,v 1.527 2015/01/19 15:35:53 goltermann Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -225,6 +225,7 @@ sub end_tex {
sub homework_js {
return &Apache::loncommon::resize_textarea_js().
+ &Apache::loncommon::colorfuleditor_js().
&setmode_javascript().
<<'JS';
';
+
+ $return .= '
+
+
';
+ return $return;
}
sub problem_edit_footer {
+ my $resource = $env{'request.ambiguous'};
return ' |
'.
"\n\n".&Apache::loncommon::end_page();
@@ -884,7 +1116,7 @@ sub initialize_storage {
}
%Apache::lonhomework::history=
&Apache::lonnet::tmprestore($namespace,'',$domain,$name);
- my ($temp)=keys %Apache::lonhomework::history ;
+ my ($temp)=keys(%Apache::lonhomework::history) ;
&Apache::lonxml::debug("Return message of $temp");
} else {
%Apache::lonhomework::history=
@@ -892,7 +1124,7 @@ sub initialize_storage {
}
#ignore error conditions
- my ($temp)=keys %Apache::lonhomework::history ;
+ my ($temp)=keys(%Apache::lonhomework::history);
if ($temp =~ m/^error:.*/) { %Apache::lonhomework::history=(); }
}
@@ -1166,7 +1398,7 @@ sub store_aggregates {
}
}
}
- if (keys (%aggregate) > 0) {
+ if (keys(%aggregate) > 0) {
&Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate,
$cdomain,$cname);
}
@@ -1617,7 +1849,7 @@ sub end_problem {
my $id = $Apache::inputtags::part;
my $weight = &Apache::lonnet::EXT("resource.$id.weight");
my $packages=&Apache::lonnet::metadata($env{'request.uri'},'packages');
- my @packages = split /,/,$packages;
+ my @packages = split(/,/,$packages);
my $allow_print_points = 0;
foreach my $partial_key (@packages) {
if ($partial_key=~m/^part_0$/) {
@@ -2351,8 +2583,8 @@ sub start_randomlist {
}
}
}
- for(0 .. $show) {
- $bodytext .= "$randomlist[ $idx_arr[$_] ]";
+ for my $i (0 .. $show) {
+ $bodytext .= "$randomlist[ $idx_arr[$i] ]";
}
&Apache::lonxml::newparser($parser,\$bodytext);
}
@@ -2516,7 +2748,7 @@ sub start_part {
}
my $weight = &Apache::lonnet::EXT("resource.$id.weight");
my $allkeys=&Apache::lonnet::metadata($env{'request.uri'},'packages');
- my @allkeys = split /,/,$allkeys;
+ my @allkeys = split(/,/,$allkeys);
my $allow_print_points = 0;
foreach my $partial_key (@allkeys) {
if ($partial_key=~m/^part_(.*)$/) {
@@ -2764,7 +2996,8 @@ sub end_startouttext {
if ($target eq 'edit') {
my $areaid = 'homework_edit_'.$Apache::lonxml::curdepth;
$text=&Apache::lonxml::get_all_text("endouttext",$parser,$style);
- $result.=&Apache::edit::start_table($token)."".&mt('Text Block')." | "
+ $result.=&Apache::edit::start_table($token)."
".&Apache::loncommon::insert_folding_button()
+ ." ".&mt('Text Block')." | "
.''.&mt('Delete?').' '
.&Apache::edit::deletelist($target,$token)
.' | '