[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 02 Sep 2005 22:14:37 -0000
albertel Fri Sep 2 18:14:37 2005 EDT
Modified files:
/loncom/interface lonparmset.pm
Log:
- sorting improvments for the 'Set Resource Parameters - Overview Mode'
(doesn't yset sort by &standardkeyorder but it at least is no longer randoish)
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.246 loncom/interface/lonparmset.pm:1.247
--- loncom/interface/lonparmset.pm:1.246 Mon Aug 29 21:25:53 2005
+++ loncom/interface/lonparmset.pm Fri Sep 2 18:14:35 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.246 2005/08/30 01:25:53 banghart Exp $
+# $Id: lonparmset.pm,v 1.247 2005/09/02 22:14:35 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2191,18 +2191,20 @@
my $foundkeys=0;
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\.(.+)$/);
}
- ($arealm cmp $brealm) || ($astudent cmp $bstudent);
+ if (!defined($bstudent)) {
+ ($brealm)=($b=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
+ }
+ ($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'}) {