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

raeburn raeburn at source.lon-capa.org
Thu May 29 21:50:05 EDT 2014


raeburn		Fri May 30 01:50:05 2014 EDT

  Modified files:              
    /loncom/interface	lonpickcourse.pm 
  Log:
  - Only include setDefaultCredits() in javascript functions called on page
    load for course/community selection form where appropriate. 
  
  
Index: loncom/interface/lonpickcourse.pm
diff -u loncom/interface/lonpickcourse.pm:1.114 loncom/interface/lonpickcourse.pm:1.115
--- loncom/interface/lonpickcourse.pm:1.114	Fri Apr 25 17:56:43 2014
+++ loncom/interface/lonpickcourse.pm	Fri May 30 01:50:05 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Pick a course
 #
-# $Id: lonpickcourse.pm,v 1.114 2014/04/25 17:56:43 bisitz Exp $
+# $Id: lonpickcourse.pm,v 1.115 2014/05/30 01:50:05 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -105,7 +105,17 @@
 
     if ((($env{'form.form'} eq 'cu') || ($env{'form.form'} eq 'studentform')) && 
         ($env{'form.pickedcourse'})) {
-        $loaditem{'onload'} .= 'setDefaultCredits();setRoles();setSections();';
+        if ($type ne 'Community') {
+            my %coursedescription =
+                &Apache::lonnet::coursedescription($env{'form.pickedcourse'},
+                                                   {'one_time' => '1'});
+            my $cdom = $coursedescription{'domain'};
+            my %domdefs = &Apache::lonnet::get_domain_defaults($cdom);
+            if (($domdefs{'officialcredits'} || $domdefs{'unofficialcredits'} || $domdefs{'textbookcredits'})) {
+                $loaditem{'onload'} .= 'setDefaultCredits();';
+            }
+        }
+        $loaditem{'onload'} .= 'setRoles();setSections();';
     }
     if ((($env{'form.gosearch'}) && ($env{'form.updater'} eq '')) && (!$onlyown)) {
         $loaditem{'onload'} .=  'hideSearching(); ';




More information about the LON-CAPA-cvs mailing list