[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Tue, 16 Dec 2003 16:47:16 -0000
raeburn Tue Dec 16 11:47:16 2003 EDT
Modified files:
/loncom/interface loncoursedata.pm
Log:
Added CL_TYPE subroutine to retrieve user type.
User type is either 'auto' (if added via automated enrollment or via the
'Update roster now' function in lonpopulate) or '' otherwise.
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.110 loncom/interface/loncoursedata.pm:1.111
--- loncom/interface/loncoursedata.pm:1.110 Thu Dec 11 17:18:04 2003
+++ loncom/interface/loncoursedata.pm Tue Dec 16 11:47:16 2003
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursedata.pm,v 1.110 2003/12/11 22:18:04 matthew Exp $
+# $Id: loncoursedata.pm,v 1.111 2003/12/16 16:47:16 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2219,7 +2219,7 @@
Returns a reference to a hash which contains:
keys '$sname:$sdom'
- values [$sdom,$sname,$end,$start,$id,$section,$fullname,$status]
+ values [$sdom,$sname,$end,$start,$id,$section,$fullname,$status,$type]
The constant values CL_SDOM, CL_SNAME, CL_END, etc. can be used
as indices into the returned list to future-proof clients against
@@ -2238,6 +2238,7 @@
sub CL_SECTION { return 5; }
sub CL_FULLNAME { return 6; }
sub CL_STATUS { return 7; }
+sub CL_TYPE { return 8; }
sub get_classlist {
my ($cid,$cdom,$cnum) = @_;
@@ -2254,9 +2255,9 @@
}
my ($sname,$sdom) = split(/:/,$student);
my @Values = split(/:/,$info);
- my ($end,$start,$id,$section,$fullname);
+ my ($end,$start,$id,$section,$fullname,$type);
if (@Values > 2) {
- ($end,$start,$id,$section,$fullname) = @Values;
+ ($end,$start,$id,$section,$fullname,$type) = @Values;
} else { # We have to get the data ourselves
($end,$start) = @Values;
$section = &Apache::lonnet::getsection($sdom,$sname,$cid);
@@ -2293,11 +2294,11 @@
$status='Active';
}
$classlist{$student} =
- [$sdom,$sname,$end,$start,$id,$section,$fullname,$status];
+ [$sdom,$sname,$end,$start,$id,$section,$fullname,$status,$type];
}
if (wantarray()) {
return (\%classlist,['domain','username','end','start','id',
- 'section','fullname','status']);
+ 'section','fullname','status','type']);
} else {
return \%classlist;
}