[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm lonhomework.pm structuretags.pm /interface lonmenu.pm slotrequest.pm /interface/statistics lonproblemstatistics.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Mon, 14 Jan 2008 14:32:52 -0000
raeburn Mon Jan 14 09:32:52 2008 EDT
Modified files:
/loncom/homework inputtags.pm structuretags.pm lonhomework.pm
/loncom/interface lonmenu.pm slotrequest.pm
/loncom/interface/statistics lonproblemstatistics.pm
Log:
When using calls to &Apache::lonnet::EXT(), request a scalar explicitly, to avoid similar problems to those eencountered in bug 5578, following the change in lonnet.pm rev 1.927 which enabled EXT() to return the level a parameter is set at, if an array was requested.
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.235 loncom/homework/inputtags.pm:1.236
--- loncom/homework/inputtags.pm:1.235 Fri Nov 16 21:03:46 2007
+++ loncom/homework/inputtags.pm Mon Jan 14 09:32:14 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.235 2007/11/17 02:03:46 albertel Exp $
+# $Id: inputtags.pm,v 1.236 2008/01/14 14:32:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -636,8 +636,8 @@
);
my $part = $Apache::inputtags::part;
- my $handgrade =
- ('yes' eq lc(&Apache::lonnet::EXT("resource.$part.handgrade")));
+ my $tohandgrade = &Apache::lonnet::EXT("resource.$part.handgrade");
+ my $handgrade = ('yes' eq lc($tohandgrade));
my $computer = ($handgrade)? ''
: " ".&mt("Computer's answer now shown above.");
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.414 loncom/homework/structuretags.pm:1.415
--- loncom/homework/structuretags.pm:1.414 Tue Nov 20 12:53:22 2007
+++ loncom/homework/structuretags.pm Mon Jan 14 09:32:14 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.414 2007/11/20 17:53:22 albertel Exp $
+# $Id: structuretags.pm,v 1.415 2008/01/14 14:32:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -754,7 +754,8 @@
}
if ($target ne 'analyze') {
- $Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type');
+ my $type = &Apache::lonnet::EXT('resource.0.type');
+ $Apache::lonhomework::type=$type;
if (($env{'request.state'} eq 'construct') &&
$env{'form.problemtype'} =~ /\S/) {
$Apache::lonhomework::type=$env{'form.problemtype'};
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.287 loncom/homework/lonhomework.pm:1.288
--- loncom/homework/lonhomework.pm:1.287 Mon Dec 24 01:35:18 2007
+++ loncom/homework/lonhomework.pm Mon Jan 14 09:32:14 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.287 2007/12/24 06:35:18 raeburn Exp $
+# $Id: lonhomework.pm,v 1.288 2008/01/14 14:32:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -292,9 +292,9 @@
}
}
- my @slots=
- (split(':',&Apache::lonnet::EXT("resource.0.availablestudent")),
- split(':',&Apache::lonnet::EXT("resource.0.available")));
+ my $availablestudent = &Apache::lonnet::EXT("resource.0.availablestudent");
+ my $available = &Apache::lonnet::EXT("resource.0.available");
+ my @slots= (split(':',$availablestudent),split(':',$available));
# if (!@slots) {
# return ($status,$datemsg);
@@ -421,7 +421,8 @@
&Apache::lonxml::debug("symb:".$symb);
#if ($env{'request.state'} ne "construct" && $symb ne '') {
if ($env{'request.state'} ne "construct") {
- my $allowed=&check_ip_acc(&Apache::lonnet::EXT("resource.$id.acc"));
+ my $idacc = &Apache::lonnet::EXT("resource.$id.acc");
+ my $allowed=&check_ip_acc($idacc);
if (!$allowed && ($Apache::lonhomework::browse ne 'F')) {
$status='INVALID_ACCESS';
$date=&mt("can not be accessed from your location.");
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.231 loncom/interface/lonmenu.pm:1.232
--- loncom/interface/lonmenu.pm:1.231 Fri Nov 9 15:57:29 2007
+++ loncom/interface/lonmenu.pm Mon Jan 14 09:32:30 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.231 2007/11/09 20:57:29 albertel Exp $
+# $Id: lonmenu.pm,v 1.232 2008/01/14 14:32:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1398,7 +1398,8 @@
if ($env{'request.role.adv'}) {
return;
}
- return &Apache::lonnet::EXT('resource.0.buttonshide');
+ my $buttonshide = &Apache::lonnet::EXT('resource.0.buttonshide');
+ return $buttonshide;
}
# ================================================================ Main Program
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.80 loncom/interface/slotrequest.pm:1.81
--- loncom/interface/slotrequest.pm:1.80 Fri Sep 21 18:37:23 2007
+++ loncom/interface/slotrequest.pm Mon Jan 14 09:32:30 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for requesting to have slots added to a students record
#
-# $Id: slotrequest.pm,v 1.80 2007/09/21 22:37:23 albertel Exp $
+# $Id: slotrequest.pm,v 1.81 2008/01/14 14:32:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -473,8 +473,9 @@
}
# get parameter string, check for existance, rebuild string with the slot
- my @slots = split(/:/,&Apache::lonnet::EXT("resource.0.availablestudent",
- $symb,$udom,$uname));
+ my $student = &Apache::lonnet::EXT("resource.0.availablestudent",
+ $symb,$udom,$uname);
+ my @slots = split(/:/,$student);
my @new_slots;
foreach my $exist_slot (@slots) {
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.111 loncom/interface/statistics/lonproblemstatistics.pm:1.112
--- loncom/interface/statistics/lonproblemstatistics.pm:1.111 Wed Dec 6 17:22:38 2006
+++ loncom/interface/statistics/lonproblemstatistics.pm Mon Jan 14 09:32:49 2008
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemstatistics.pm,v 1.111 2006/12/06 22:22:38 albertel Exp $
+# $Id: lonproblemstatistics.pm,v 1.112 2008/01/14 14:32:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1593,16 +1593,16 @@
($data->{'num_solved'}+0.1);
#
# Get the due date for research purposes (commented out most of the time)
-# $data->{'duedate'} =
-# &Apache::lonnet::EXT('resource.'.$part.'.duedate',$symb);
-# $data->{'opendate'} =
-# &Apache::lonnet::EXT('resource.'.$part.'.opendate',$symb);
-# $data->{'maxtries'} =
-# &Apache::lonnet::EXT('resource.'.$part.'.maxtries',$symb);
-# $data->{'hinttries'} =
-# &Apache::lonnet::EXT('resource.'.$part.'.hinttries',$symb);
- $data->{'weight'} =
- &Apache::lonnet::EXT('resource.'.$part.'.weight',$symb);
+# my $duedate = &Apache::lonnet::EXT('resource.'.$part.'.duedate',$symb);;
+# my $opendate = &Apache::lonnet::EXT('resource.'.$part.'.opendate',$symb);
+# my $maxtries = &Apache::lonnet::EXT('resource.'.$part.'.maxtries',$symb);
+# my $hinttries = &Apache::lonnet::EXT('resource.'.$part.'.hinttries',$symb);
+ my $weight = &Apache::lonnet::EXT('resource.'.$part.'.weight',$symb);
+ $data->{'weight'} = $weight;
+# $data->{'duedate'} = $duedate;
+# $data->{'opendate'} = $opendate;
+# $data->{'maxtries'} = $maxtries;
+# $data->{'hinttries'} = $hinttries;
# $data->{'resptypes'} = join(',',@{$resource->{'partdata'}->{$part}->{'ResponseTypes'}});
return $data;
}