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

raeburn raeburn at source.lon-capa.org
Sun Jan 17 13:23:09 EST 2021


raeburn		Sun Jan 17 18:23:09 2021 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - Management of availablestudent parameter by a CC is via Settings > Slots.
    Setting of availablestudent parameter is by student via Reservations or
    using Select/Drop/Change Reservation buttons for a resource itself.  
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.598 loncom/interface/lonparmset.pm:1.599
--- loncom/interface/lonparmset.pm:1.598	Thu Dec 24 00:37:30 2020
+++ loncom/interface/lonparmset.pm	Sun Jan 17 18:23:09 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.598 2020/12/24 00:37:30 raeburn Exp $
+# $Id: lonparmset.pm,v 1.599 2021/01/17 18:23:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1912,9 +1912,7 @@
                 $nolink = 1;
             }
         } elsif ($mprefix =~ /availablestudent\&$/) {
-            if ($which > 4) {
-                $nolink = 1;
-            }
+            $nolink = 1;
         } elsif ($mprefix =~ /examcode\&$/) {
             unless ($which == 2) {
                 $nolink = 1;
@@ -4680,6 +4678,7 @@
                 ($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s\-]+)\.(\w+)$/);
             my $section=&mt('All Students');
             $readonly = $readonlyall;
+            my $userscope;
             my $showval = $$resourcedata{$thiskey}; 
             if ($middle=~/^\[(.*)\]/) {
                 my $issection=$1;
@@ -4693,6 +4692,7 @@
                         }
                     }
                     $section=&mt('User').": ".&Apache::loncommon::plainname($stuname,$studom);
+                    $userscope = 1;
                 } else {
                     if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
                         if (exists($grouphash{$issection})) {
@@ -4790,8 +4790,13 @@
                 '<td><b>'.&mt($parmitem).
                 '</b></td>');
             unless ($readonly) {
+                my $disabled;
+                if (($name eq 'availablestudent') &&
+                    (($showval eq '') || ($userscope))) {
+                    $disabled = ' disabled="disabled"';
+                }
                 $r->print('<td><input type="checkbox" name="del_'.
-                        $thiskey.'" /></td>');
+                        $thiskey.'"'.$disabled.' /></td>');
             }
             $r->print('<td>');
             $foundkeys++;
@@ -4819,6 +4824,9 @@
                 $r->print(&date_interval_selector($thiskey,$name,
                           $showval,$readonly));
             } elsif ($thistype =~ m/^string/) {
+                if ($name eq 'availablestudent') {
+                    $readonly = 1;
+                }
                 $r->print(&string_selector($thistype,$thiskey,
                           $showval,$name,$readonly));
             } else {




More information about the LON-CAPA-cvs mailing list