--- loncom/interface/lonparmset.pm 2009/05/08 22:47:01 1.445
+++ loncom/interface/lonparmset.pm 2009/05/12 10:54:11 1.446
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.445 2009/05/08 22:47:01 neumanie Exp $
+# $Id: lonparmset.pm,v 1.446 2009/05/12 10:54:11 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -366,7 +366,7 @@ sub parmval_by_symb {
my $result='';
my @outpar=();
# ----------------------------------------------------- Cascading lookup scheme
- my $map=(&Apache::lonnet::decode_symb($symb))[0];
+ my $map=(&Apache::lonnet::decode_symb($symb))[0];
$map = &Apache::lonnet::deversion($map);
my $symbparm=$symb.'.'.$what;
@@ -468,7 +468,7 @@ sub parmval_by_symb {
# --- Caches local to lonparmset
-
+
sub reset_caches {
&resetparmhash();
&resetsymbcache();
@@ -482,7 +482,7 @@ sub reset_caches {
undef($parmhashid);
undef(%parmhash);
}
-
+
sub cacheparmhash {
if ($parmhashid eq $env{'request.course.fn'}) { return; }
my %parmhashfile;
@@ -493,7 +493,7 @@ sub reset_caches {
$parmhashid=$env{'request.course.fn'};
}
}
-
+
sub parmhash {
my ($id) = @_;
&cacheparmhash();
@@ -501,14 +501,14 @@ sub reset_caches {
}
}
-{
+{
my $symbsid;
my %symbs;
sub resetsymbcache {
undef($symbsid);
undef(%symbs);
}
-
+
sub symbcache {
my $id=shift;
if ($symbsid ne $env{'request.course.id'}) {
@@ -529,14 +529,14 @@ sub reset_caches {
}
}
-{
+{
my $rulesid;
my %rules;
sub resetrulescache {
undef($rulesid);
undef(%rules);
}
-
+
sub rulescache {
my $id=shift;
if ($rulesid ne $env{'request.course.id'}
@@ -683,7 +683,7 @@ sub storeparm_by_symb_inner {
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_;
# ---------------------------------------------------------- Construct prefixes
$spnam=~s/\_([^\_]+)$/\.$1/;
- my $map=(&Apache::lonnet::decode_symb($symb))[0];
+ my $map=(&Apache::lonnet::decode_symb($symb))[0];
$map = &Apache::lonnet::deversion($map);
my $symbparm=$symb.'.'.$spnam;
@@ -696,11 +696,11 @@ sub storeparm_by_symb_inner {
my $seclevel=$env{'request.course.id'}.'.['.$csec.'].'.$spnam;
my $seclevelr=$env{'request.course.id'}.'.['.$csec.'].'.$symbparm;
my $seclevelm=$env{'request.course.id'}.'.['.$csec.'].'.$mapparm;
-
+
my $courselevel=$env{'request.course.id'}.'.'.$spnam;
my $courselevelr=$env{'request.course.id'}.'.'.$symbparm;
my $courselevelm=$env{'request.course.id'}.'.'.$mapparm;
-
+
my $storeunder='';
if (($snum==14) || ($snum==3)) { $storeunder=$courselevel; }
if (($snum==13) || ($snum==2)) { $storeunder=$courselevelm; }
@@ -712,7 +712,7 @@ sub storeparm_by_symb_inner {
if ($snum==5) { $storeunder=$grplevelm; }
if ($snum==4) { $storeunder=$grplevelr; }
-
+
my $delete;
if ($nval eq '') { $delete=1;}
my %storecontent = ($storeunder => $nval,
@@ -769,7 +769,7 @@ sub storeparm_by_symb_inner {
}
&Apache::lonnet::devalidateuserresdata($uname,$udom);
}
-
+
if ($reply=~/^error\:(.*)/) {
return "Write Error: $1";
}
@@ -926,11 +926,11 @@ sub startpage {
text=>"Table Mode",
help => 'Course_Setting_Parameters'});
}
- my $start_page =
+ my $start_page =
&Apache::loncommon::start_page('Set/Modify Course Parameters',
&page_js(),
{'add_entries' => \%loaditems,});
- my $breadcrumbs =
+ my $breadcrumbs =
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode');
$r->print(<0;$i--) {
- if ($typeoutpar[$i]) {
+ if ($typeoutpar[$i]) {
$cascadetype=$typeoutpar[$i];
} else {
$typeoutpar[$i]=$cascadetype;
@@ -981,7 +981,7 @@ sub print_row {
$parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'';
}
$r->print(''.$parm.' | ');
-
+
my $thismarker=$which;
$thismarker=~s/^parameter\_//;
my $mprefix=$rid.'&'.$thismarker.'&';
@@ -995,9 +995,9 @@ sub print_row {
} elsif ($cgroup) {
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
} elsif ($csec) {
- &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
} else {
- &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
}
} elsif ($parmlev eq 'map') {
@@ -1034,7 +1034,7 @@ sub print_row {
&print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
-
+
if ($csec) {
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
@@ -1046,7 +1046,7 @@ sub print_row {
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
&print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
}
-
+
if ($uname) {
if ($othergrp) {
$r->print($othergrp);
@@ -1107,7 +1107,7 @@ sub print_usergroups {
$courseopt);
my $bgcolor = $defbg;
my $grp_parm;
- if (($coursereply) && ($cgroup ne $resultgroup)) {
+ if (($coursereply) && ($cgroup ne $resultgroup)) {
if ($result > 3) {
$bgcolor = '#AAFFAA';
$grp_parm = &valout($coursereply,$resulttype);
@@ -1221,14 +1221,14 @@ sub extractResourceInformation {
}
#
# Put in order
-#
+#
unless ($$keyorder{$key}) {
$$keyorder{$key}=$keyordercnt;
$keyordercnt++;
}
}
-
+
if (!exists($$mapp{$mapid})) {
$$mapp{$id}=
&Apache::lonnet::declutter($resource->enclosing_map_src());
@@ -1238,7 +1238,7 @@ sub extractResourceInformation {
$$maptitles{$mapid}=&mt('Main Course Documents');
} else {
$$maptitles{$mapid}=
- &Apache::lonnet::gettitle($$mapp{$id});
+ &Apache::lonnet::gettitle($$mapp{$id});
}
$$maptitles{$$mapp{$id}}=$$maptitles{$mapid};
$$symbp{$mapid}=$$mapp{$id}.'___(all)';
@@ -1296,7 +1296,7 @@ sub parmmenu {
checkthis('contentopen','pscat');
checkthis('contentclose','pscat');
}
-
+
function checkvisi() {
checkthis('hiddenresource','pscat');
@@ -1321,7 +1321,7 @@ sub parmmenu {
ENDSCRIPT
- $r->print();
+ $r->print();
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));
$r->print("\n".'