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

raeburn raeburn at source.lon-capa.org
Fri Jul 14 22:49:10 EDT 2017


raeburn		Sat Jul 15 02:49:10 2017 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - Subroutine: print_usergroups() name change to check_other_groups(), and
    removal of unused first arg ($r), as per #FIXME added in rev. 1.561.
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.579 loncom/interface/lonparmset.pm:1.580
--- loncom/interface/lonparmset.pm:1.579	Sat Jul 15 02:31:33 2017
+++ loncom/interface/lonparmset.pm	Sat Jul 15 02:49:10 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.579 2017/07/15 02:31:33 raeburn Exp $
+# $Id: lonparmset.pm,v 1.580 2017/07/15 02:49:10 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -138,7 +138,7 @@
 
 =item print_td()
 
-=item print_usergroups()
+=item check_other_groups()
 
 =item parm_control_group()
 
@@ -1500,7 +1500,7 @@
             if (@{$usersgroups} > 1) {
                 my ($coursereply,$grp_parm,$controlgrp);
                 ($coursereply,$othergrp,$grp_parm,$controlgrp) =
-                    &print_usergroups($r,$$part{$which}.'.'.$$name{$which},
+                    &check_other_groups($$part{$which}.'.'.$$name{$which},
                        $rid,$cgroup,$defbgone,$usersgroups,$result,$courseopt);
                 if ($coursereply && $result > 4) {
                     if (defined($controlgrp)) {
@@ -1639,11 +1639,9 @@
     $r->print('</td>'."\n");
 }
 
-# FIXME: Despite the name, this does not print anything, the $r parameter is unused.
 # Returns HTML and other info for the cell added when a user is selected
 # and that user is in several groups. This is the cell with the title "Control by other group".
 #
-# @param {Apache2::RequestRec} $r - the Apache request (unused)
 # @param {string} $what - parameter part.'.'.parameter name
 # @param {string} $rid - resource id
 # @param {string} $cgroup - group name
@@ -1652,8 +1650,8 @@
 # @param {integer} $result - level
 # @param {hash reference} $courseopt - course parameters hash (result of lonnet::get_courseresdata, dump of course's resourcedata.db)
 # @returns {Array} - array (parameter value for the other group, HTML for the cell, HTML with the value, name of the other group)
-sub print_usergroups {
-    my ($r,$what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_;
+sub check_other_groups {
+    my ($what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_;
     my $courseid = $env{'request.course.id'};
     my $output;
     my $symb = &symbcache($rid);
@@ -1669,7 +1667,6 @@
     if (($coursereply) && ($cgroup ne $resultgroup)) {
         if ($result > 3) {
             $bgcolor = '#AAFFAA';
-            $grp_parm = &valout($coursereply,$resulttype,$what);
         }
         $grp_parm = &valout($coursereply,$resulttype,$what);
         $output = '<td style="background-color:'.$bgcolor.';" align="center">';
@@ -1686,7 +1683,7 @@
 }
 
 # Looks for a group with a defined parameter for given user and parameter.
-# Used by print_usergroups.
+# Used by check_other_groups.
 #
 # @param {string} $courseid - the course id
 # @param {array reference} $usersgroups - list of groups the user belongs to, if any




More information about the LON-CAPA-cvs mailing list