[LON-CAPA-cvs] cvs: loncom(version_2_0_X) /interface lonparmset.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 02 Sep 2005 22:40:11 -0000
albertel Fri Sep 2 18:40:11 2005 EDT
Modified files: (Branch: version_2_0_X)
/loncom/interface lonparmset.pm
Log:
- backport rev 1.247,1.248,1.249
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.239 loncom/interface/lonparmset.pm:1.239.2.1
--- loncom/interface/lonparmset.pm:1.239 Tue Jul 19 12:42:02 2005
+++ loncom/interface/lonparmset.pm Fri Sep 2 18:40:07 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.239 2005/07/19 16:42:02 raeburn Exp $
+# $Id: lonparmset.pm,v 1.239.2.1 2005/09/02 22:40:07 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2189,20 +2189,41 @@
my $pointer=0;
$tableopen=0;
my $foundkeys=0;
+ my %keyorder=&standardkeyorder();
foreach my $thiskey (sort {
if ($sortorder eq 'realmstudent') {
- my ($astudent,$arealm)=($a=~/^$env{'request.course.id'}\.([^\.]+)\.(.+)\.[^\.]+$/);
- my ($bstudent,$brealm)=($b=~/^$env{'request.course.id'}\.([^\.]+)\.(.+)\.[^\.]+$/);
- if (!defined($astudent) && !defined($bstudent) &&
- !defined($arealm) && !defined($brealm)) {
- ($arealm)=($a=~/^$env{'request.course.id'}\.(.+)\.[^\.]+$/);
- ($brealm)=($b=~/^$env{'request.course.id'}\.(.+)\.[^\.]+$/);
+ my ($astudent,$arealm)=($a=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)\.[^\.]+$/);
+ my ($bstudent,$brealm)=($b=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)\.[^\.]+$/);
+ if (!defined($astudent)) {
+ ($arealm)=($a=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
+ }
+ if (!defined($bstudent)) {
+ ($brealm)=($b=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
+ }
+ $arealm=~s/\.type//;
+ my ($ares, $aparm) = ($arealm=~/^(.*)\.(.*)$/);
+ $aparm=$keyorder{'parameter_0_'.$aparm};
+ $brealm=~s/\.type//;
+ my ($bres, $bparm) = ($brealm=~/^(.*)\.(.*)$/);
+ $bparm=$keyorder{'parameter_0_'.$bparm};
+ if ($ares eq $bres) {
+ if (defined($aparm) && defined($bparm)) {
+ ($aparm <=> $bparm);
+ } elsif (defined($aparm)) {
+ -1;
+ } elsif (defined($bparm)) {
+ 1;
+ } else {
+ ($arealm cmp $brealm) || ($astudent cmp $bstudent);
+ }
+ } else {
+ ($arealm cmp $brealm) || ($astudent cmp $bstudent);
}
- ($arealm cmp $brealm) || ($astudent cmp $bstudent);
} else {
$a cmp $b;
}
} keys %{$listdata}) {
+
if ($$listdata{$thiskey.'.type'}) {
my $thistype=$$listdata{$thiskey.'.type'};
if ($$resourcedata{$thiskey.'.type'}) {