[LON-CAPA-cvs] cvs: loncom /homework grades.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 11 Mar 2006 00:08:50 -0000


albertel		Fri Mar 10 19:08:50 2006 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - BUG#4352 if no code validation list has been selected don't show the 'select a CODE form the list of CODEs' text
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.331 loncom/homework/grades.pm:1.332
--- loncom/homework/grades.pm:1.331	Fri Mar 10 19:02:18 2006
+++ loncom/homework/grades.pm	Fri Mar 10 19:08:48 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.331 2006/03/11 00:02:18 albertel Exp $
+# $Id: grades.pm,v 1.332 2006/03/11 00:08:48 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5084,8 +5084,10 @@
 	   "&scantron_CODElist=".&Apache::lonnet::escape($env{'form.scantron_CODElist'}).
 	   "&curCODE=".&Apache::lonnet::escape($$scan_record{'scantron.CODE'}).
 	   "&scantron_selectfile=".&Apache::lonnet::escape($env{'form.scantron_selectfile'});
-	$r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_found' /> <a target='_blank' href='$href'>Select</a> a CODE from the list of all CODEs and use it.</label> Selected CODE is <input readonly='true' type='text' size='8' name='scantron_CODE_selectedvalue' onfocus=\"javascript:change_radio('use_found')\" onchange=\"javascript:change_radio('use_found')\" />");
-	$r->print("\n<br />");
+	if ($env{'form.scantron_CODElist'} =~ /\S/) { 
+	    $r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_found' /> <a target='_blank' href='$href'>Select</a> a CODE from the list of all CODEs and use it.</label> Selected CODE is <input readonly='true' type='text' size='8' name='scantron_CODE_selectedvalue' onfocus=\"javascript:change_radio('use_found')\" onchange=\"javascript:change_radio('use_found')\" />");
+	    $r->print("\n<br />");
+	}
 	$r->print("<label><input type='radio' name='scantron_CODE_resolution' value='use_typed' /> Use </label><input type='text' size='8' name='scantron_CODE_newvalue' onfocus=\"javascript:change_radio('use_typed')\" onkeypress=\"javascript:change_radio('use_typed')\" /> as the CODE.");
 	$r->print("\n<br /><br />");
     } elsif ($error eq 'doublebubble') {