[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Mon, 01 May 2006 14:59:39 -0000


raeburn		Mon May  1 10:59:39 2006 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  lonnet rev 1.733 -- lonnet::get_users_groups() returns an array instead of a scalar, and includes sorting of groups. 
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.296 loncom/interface/lonparmset.pm:1.297
--- loncom/interface/lonparmset.pm:1.296	Wed Apr 26 10:52:22 2006
+++ loncom/interface/lonparmset.pm	Mon May  1 10:59:38 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.296 2006/04/26 14:52:22 albertel Exp $
+# $Id: lonparmset.pm,v 1.297 2006/05/01 14:59:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -117,7 +117,6 @@
 sub parmval_by_symb {
     my ($what,$symb,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_;
 # load caches
-
     &cacheparmhash();
 
     my $useropt=&Apache::lonnet::get_userresdata($uname,$udom);
@@ -1416,7 +1415,6 @@
     my $uhome;
     my $csec;
     my $cgroup;
-    my $grouplist;
     my @usersgroups = ();
  
     my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'};
@@ -1522,16 +1520,12 @@
 			.$name{'lastname'}.' '.$name{'generation'}.
 			    "<br>\n".&mt('ID').": ".$name{'id'}.'<p>';
 	    }
-            $grouplist = &Apache::lonnet::get_users_groups(
+            @usersgroups = &Apache::lonnet::get_users_groups(
                                        $udom,$uname,$env{'request.course.id'});
-            if ($grouplist) {
-                @usersgroups = &Apache::lonnet::sort_course_groups($grouplist,
-                                                    $env{'request.course.id'});
+            if (@usersgroups > 0) {
                 unless (grep/^\Q$cgroup\E$/,@usersgroups) {
                     $cgroup = $usersgroups[0];
-                } 
-            } else {
-                $cgroup = '';
+                }
             }
         }
     }