[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 14 Dec 2006 20:04:12 -0000
albertel Thu Dec 14 15:04:12 2006 EDT
Modified files:
/loncom/interface lonparmset.pm
Log:
- BUG#5106 Paremeter in effect can report wrong settings
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.351 loncom/interface/lonparmset.pm:1.352
--- loncom/interface/lonparmset.pm:1.351 Mon Dec 11 18:57:17 2006
+++ loncom/interface/lonparmset.pm Thu Dec 14 15:04:11 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.351 2006/12/11 23:57:17 banghart Exp $
+# $Id: lonparmset.pm,v 1.352 2006/12/14 20:04:11 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -122,7 +122,10 @@
# load caches
&cacheparmhash();
- my $useropt=&Apache::lonnet::get_userresdata($uname,$udom);
+ my $useropt;
+ if ($uname ne '' && $udom ne '') {
+ $useropt = &Apache::lonnet::get_userresdata($uname,$udom);
+ }
my $result='';
my @outpar=();
@@ -173,7 +176,7 @@
}
# ------------------------------------------------------ fourth, back to course
- if (defined($csec)) {
+ if ($csec ne '') {
if (defined($$courseopt{$seclevel})) {
$outpar[9]=$$courseopt{$seclevel};
$result=9;
@@ -189,7 +192,7 @@
}
}
# ------------------------------------------------------ fifth, check course group
- if (defined($cgroup)) {
+ if ($cgroup ne '') {
if (defined($$courseopt{$grplevel})) {
$outpar[6]=$$courseopt{$grplevel};
$result=6;
@@ -206,7 +209,7 @@
# ---------------------------------------------------------- fifth, check user
- if (defined($uname)) {
+ if ($uname ne '') {
if (defined($$useropt{$courselevel})) {
$outpar[3]=$$useropt{$courselevel};
$result=3;