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

raeburn raeburn at source.lon-capa.org
Sat Oct 15 10:02:44 EDT 2016


raeburn		Sat Oct 15 14:02:44 2016 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - Fix typo.
  - Make "Done" button fields readonly when editing is disallowed. 
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.566 loncom/interface/lonparmset.pm:1.567
--- loncom/interface/lonparmset.pm:1.566	Wed Aug 10 21:05:42 2016
+++ loncom/interface/lonparmset.pm	Sat Oct 15 14:02:43 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.566 2016/08/10 21:05:42 damieng Exp $
+# $Id: lonparmset.pm,v 1.567 2016/10/15 14:02:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4140,7 +4140,7 @@
         @{$access{'deny'}} = ('');
     }
     my ($disabled,$addmore);
-    if ($disabled) {
+    if ($readonly) {
         $disabled=' disabled="disabled"';
     } else {
         $addmore = "\n".'<button class="LC_add_ipacc_button">'.&mt('Add more').'</button>';
@@ -4561,17 +4561,21 @@
                 $currprocdisplay = 'text';
             }
             my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"';
+            my $disabled;
+            if ($readonly) {
+                $disabled = ' disabled="disabled"';
+            }
             $result .= '<br /><span class="LC_nobreak">'.&mt('Include "done" button').
-                       '<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.' />'.
+                       '<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.$disabled.' />'.
                        &mt('No').'</label>'.(' 'x2).
-                       '<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.' />'.
+                       '<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.$disabled.' />'.
                        &mt('Yes').'</label>'.(' 'x2).
-                       '<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.' />'.
+                       '<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.$disabled.' />'.
                        &mt('Yes, with proctor key').'</label>'.
                        '<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '.
-                       'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'" /></span><br />'.
+                       'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'"'.$disabled.' /></span><br />'.
                        '<span class="LC_nobreak">'.&mt('Button text').': '.
-                       '<input type="text" name="done_'.$thiskey.'_buttontext" value="'.&HTML::Entities::encode($currdonetext,'"<>&').'" /></span>';
+                       '<input type="text" name="done_'.$thiskey.'_buttontext" value="'.&HTML::Entities::encode($currdonetext,'"<>&').'"'.$disabled.' /></span>';
         }
     }
     unless ($readonly) {




More information about the LON-CAPA-cvs mailing list