[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm
raeburn
raeburn at source.lon-capa.org
Wed Apr 3 09:48:36 EDT 2013
raeburn Wed Apr 3 13:48:36 2013 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface loncommon.pm
Log:
- For 2.11
- Backport 1.1118, 1.1119.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.32 loncom/interface/loncommon.pm:1.1075.2.33
--- loncom/interface/loncommon.pm:1.1075.2.32 Tue Mar 19 00:49:27 2013
+++ loncom/interface/loncommon.pm Wed Apr 3 13:48:35 2013
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1075.2.32 2013/03/19 00:49:27 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.33 2013/04/03 13:48:35 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6701,7 +6701,7 @@
vertical-align: top;
border-left: 1px solid black;
border-right: 1px solid black;
- background-color: $data_table_light
+ background-color: $data_table_light;
list-style:none;
float: none;
}
@@ -8204,7 +8204,19 @@
my %sectioncount;
my $now = time;
- if (!defined($possible_roles) || (grep(/^st$/,@$possible_roles))) {
+ my $check_students = 1;
+ my $only_students = 0;
+ if (ref($possible_roles) eq 'ARRAY') {
+ if (grep(/^st$/,@{$possible_roles})) {
+ if (@{$possible_roles} == 1) {
+ $only_students = 1;
+ }
+ } else {
+ $check_students = 0;
+ }
+ }
+
+ if ($check_students) {
my ($classlist) = &Apache::loncoursedata::get_classlist($cdom,$cnum);
my $sec_index = &Apache::loncoursedata::CL_SECTION();
my $status_index = &Apache::loncoursedata::CL_STATUS();
@@ -8231,6 +8243,9 @@
}
}
}
+ if ($only_students) {
+ return %sectioncount;
+ }
my %courseroles = &Apache::lonnet::dump('nohist_userroles',$cdom,$cnum);
foreach my $user (sort(keys(%courseroles))) {
if ($user !~ /^(\w{2})/) { next; }
More information about the LON-CAPA-cvs
mailing list