[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 02 Sep 2005 22:35:50 -0000
albertel Fri Sep 2 18:35:50 2005 EDT
Modified files:
/loncom/interface lonparmset.pm
Log:
- okay now respects standarkeyorder (checked for 'newoverview')
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.247 loncom/interface/lonparmset.pm:1.248
--- loncom/interface/lonparmset.pm:1.247 Fri Sep 2 18:14:35 2005
+++ loncom/interface/lonparmset.pm Fri Sep 2 18:35:48 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.247 2005/09/02 22:14:35 albertel Exp $
+# $Id: lonparmset.pm,v 1.248 2005/09/02 22:35:48 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2189,7 +2189,9 @@
my $pointer=0;
$tableopen=0;
my $foundkeys=0;
+ my %keyorder=&standardkeyorder();
foreach my $thiskey (sort {
+ my $return;
if ($sortorder eq 'realmstudent') {
my ($astudent,$arealm)=($a=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)\.[^\.]+$/);
my ($bstudent,$brealm)=($b=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)\.[^\.]+$/);
@@ -2199,7 +2201,25 @@
if (!defined($bstudent)) {
($brealm)=($b=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
}
- ($arealm cmp $brealm) || ($astudent cmp $bstudent);
+ $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);
+ }
} else {
$a cmp $b;
}