--- loncom/interface/loncreatecourse.pm 2010/09/23 21:25:43 1.145 +++ loncom/interface/loncreatecourse.pm 2013/07/22 18:06:51 1.150 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.145 2010/09/23 21:25:43 www Exp $ +# $Id: loncreatecourse.pm,v 1.150 2013/07/22 18:06:51 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -93,6 +93,7 @@ sub print_course_creation_page { $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 = '' + .'
('.$lt{'cred'}.')' + .&Apache::lonhtmlcommon::row_closure() + ); + } } - # Table: New Course / Clone Course $r->print(&Apache::lonhtmlcommon::row_headline() .'

'.$lt{'crco'}.'

' @@ -405,7 +416,7 @@ END .' ' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_headline() - .$lt{'asov'} + .''.$lt{'asov'}.'' .&Apache::lonhtmlcommon::row_closure(1) .&Apache::lonhtmlcommon::end_pick_box() .'' @@ -537,7 +548,7 @@ END

-' +' ); } elsif ($crstype eq 'Community') { $r->print(' @@ -560,6 +571,8 @@ sub create_course { 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 @@ sub create_course { firstres => $env{'form.firstres'} }; + if (($crstype eq 'Course') && + ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'})) { + $args->{'defaultcredits'} = $env{'form.defaultcredits'}; + } + # # Verify data #