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

raeburn raeburn at source.lon-capa.org
Thu Feb 28 23:37:39 EST 2013


raeburn		Fri Mar  1 04:37:39 2013 EDT

  Modified files:              
    /loncom/interface	loncreatecourse.pm 
  Log:
  - Default credits in an official or unofficial course can be specified when
    creating a single course (otherwise domain defaults will apply). 
  
  
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.146 loncom/interface/loncreatecourse.pm:1.147
--- loncom/interface/loncreatecourse.pm:1.146	Thu Oct  4 13:41:10 2012
+++ loncom/interface/loncreatecourse.pm	Fri Mar  1 04:37:39 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Create a course
 #
-# $Id: loncreatecourse.pm,v 1.146 2012/10/04 13:41:10 bisitz Exp $
+# $Id: loncreatecourse.pm,v 1.147 2013/03/01 04:37:39 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -93,6 +93,7 @@
         $crstype = 'Course';
     }
     my $defdom=$env{'request.role.domain'};
+    my %domdefaults = &Apache::lonnet::get_domain_defaults($defdom);
     my %host_servers = &Apache::lonnet::get_servers($defdom,'library');
     my $course_home = '<select name="course_home" size="1">'."\n";
     foreach my $server (sort(keys(%host_servers))) {
@@ -159,6 +160,8 @@
                     'csli' => "a comma separated list of institutional section numbers, each separated by a colon from the (optional) corresponding section ID to be used in LON-CAPA e.g., 001:1,002:2",
                     'crcs' => "Crosslisted courses",
                     'cscs' => "a comma separated list of course sections crosslisted with the current course, with each entry including the institutional course section name followed by a colon and then the (optional) sectionID to be used in LON-CAPA, e.g., fs03ent231001:ent1,fs03bot231001:bot1,fs03zol231002:zol2",
+                    'ccre' => "Course credits",
+                    'cred' => "the number of institutional credits students will earn by completing this course",
                     'crco' => "Course Content",
                     'cncr' => "Completely new course",
                     'cecr' => "Clone an existing course", 
@@ -313,7 +316,9 @@
     if ($crstype eq 'Course') {
         $r->print(&Apache::lonhtmlcommon::row_headline()
                  .'<h3>'.$lt{'iinf'}.'</h3>'
-                 .$lt{'stat'}
+                 .$lt{'stat'}.' '
+                 .&mt('Default credits can also be specified, if different from the domain defaults (official courses: [_1]; unofficial courses: [_2]).',
+                      $domdefaults{'officialcredits'},$domdefaults{'unofficialcredits'})
                  .&Apache::lonhtmlcommon::row_closure()
 
                  .&Apache::lonhtmlcommon::row_title($lt{'ccod'})
@@ -331,8 +336,14 @@
                  .'<br />('.$lt{'cscs'}.')'
                  .&Apache::lonhtmlcommon::row_closure()
         );
+        if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'}) {
+            $r->print(&Apache::lonhtmlcommon::row_title($lt{'ccre'})
+                     .'<input type="text" size="3" name="defaultcredits" />'
+                     .'<br />('.$lt{'cred'}.')'
+                     .&Apache::lonhtmlcommon::row_closure()
+            );
+        }
     }
-
     # Table: New Course / Clone Course
     $r->print(&Apache::lonhtmlcommon::row_headline()
                  .'<h3>'.$lt{'crco'}.'</h3>'
@@ -560,6 +571,8 @@
     my $ccdomain=&LONCAPA::clean_domain($env{'form.ccdomain'});
     my $crstype = 'Community';
     my ($enrollstart,$enrollend,$startaccess,$endaccess);
+    my %domdefaults = 
+        &Apache::lonnet::get_domain_defaults($env{'request.role.domain'});
 
     if ($env{'form.phase'} eq 'coursetwo') {
         $crstype='Course';
@@ -635,6 +648,11 @@
                firstres => $env{'form.firstres'}
                };
 
+    if (($crstype eq 'Course') && 
+        ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'})) {
+        $args->{'defaultcredits'} = $env{'form.defaultcredits'};
+    }
+
     #
     # Verify data
     #




More information about the LON-CAPA-cvs mailing list