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

raeburn raeburn at source.lon-capa.org
Mon Jan 18 18:11:15 EST 2021


raeburn		Mon Jan 18 23:11:15 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonparmset.pm 
  Log:
  - For 2.11
    Backport 1.599
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.522.2.27 loncom/interface/lonparmset.pm:1.522.2.28
--- loncom/interface/lonparmset.pm:1.522.2.27	Wed Feb 12 19:54:47 2020
+++ loncom/interface/lonparmset.pm	Mon Jan 18 23:11:15 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.522.2.27 2020/02/12 19:54:47 raeburn Exp $
+# $Id: lonparmset.pm,v 1.522.2.28 2021/01/18 23:11:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1099,9 +1099,7 @@
                 $nolink = 1;
             }
         } elsif ($mprefix =~ /availablestudent\&$/) {
-            if ($which > 3) {
-                $nolink = 1;
-            }
+            $nolink = 1;
         } elsif ($mprefix =~ /examcode\&$/) {
             unless ($which == 2) {
                 $nolink = 1;
@@ -3252,6 +3250,8 @@
         ($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;
             if ($issection=~/^useropt\:($match_username)\:($match_domain)/) {
@@ -3264,6 +3264,7 @@
                     }
                 }
                 $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);
+                $userscope = 1;
             } else {
                 if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
                     if (exists($grouphash{$issection})) {
@@ -3328,8 +3329,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++;
@@ -3357,6 +3363,9 @@
             $r->print(&date_interval_selector($thiskey,
                       $$resourcedata{$thiskey},$readonly));
         } elsif ($thistype =~ m/^string/) {
+            if ($name eq 'availablestudent') {
+                $readonly = 1;
+            }
             $r->print(&string_selector($thistype,$thiskey,
                       $$resourcedata{$thiskey},$name,$readonly));
         } else {




More information about the LON-CAPA-cvs mailing list