--- loncom/interface/loncreatecourse.pm 2013/07/22 18:06:51 1.150 +++ loncom/interface/loncreatecourse.pm 2014/01/29 19:01:27 1.155 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.150 2013/07/22 18:06:51 bisitz Exp $ +# $Id: loncreatecourse.pm,v 1.155 2014/01/29 19:01:27 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -160,6 +160,7 @@ function validate(formname) { '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", + 'crcd' => "Create six character course identifier to share with students", 'cred' => "the number of institutional credits students will earn by completing this course", 'crco' => "Course Content", 'cncr' => "Completely new course", @@ -317,8 +318,8 @@ END $r->print(&Apache::lonhtmlcommon::row_headline() .'

'.$lt{'iinf'}.'

' .$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'}) + .&mt('Default credits can also be specified, if different from the domain defaults (official courses: [_1]; unofficial courses: [_2]; textbook courses: [_3]).', + $domdefaults{'officialcredits'},$domdefaults{'unofficialcredits'},$domdefaults{'textbookcredits'}) .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title($lt{'ccod'}) @@ -336,13 +337,19 @@ END .'
('.$lt{'cscs'}.')' .&Apache::lonhtmlcommon::row_closure() ); - if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'}) { + if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbookcredits'}) { $r->print(&Apache::lonhtmlcommon::row_title($lt{'ccre'}) .'' .'
('.$lt{'cred'}.')' .&Apache::lonhtmlcommon::row_closure() ); } + $r->print(&Apache::lonhtmlcommon::row_title($lt{'crcd'}) + .'' + .''.&mt('Yes').(' 'x2) + .''.&mt('No') + .&Apache::lonhtmlcommon::row_closure() + ); } # Table: New Course / Clone Course $r->print(&Apache::lonhtmlcommon::row_headline() @@ -649,10 +656,14 @@ sub create_course { }; if (($crstype eq 'Course') && - ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'})) { + ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbookcredits'})) { $args->{'defaultcredits'} = $env{'form.defaultcredits'}; } + if ($env{'form.uniquecode'}) { + $args->{'uniquecode'} = 1; + } + # # Verify data # @@ -681,12 +692,12 @@ sub create_course { ,$env{'form.course_home'}.&Apache::loncommon::end_page())); return; } - my ($courseid,$crsudom,$crsunum); + my ($courseid,$crsudom,$crsunum,$code); my ($success,$output) = &Apache::loncommon::construct_course($args,\$logmsg,\$courseid, \$crsudom,\$crsunum, $env{'user.domain'}, - $env{'user.name'},'dc_create'); + $env{'user.name'},'dc_create',undef,undef,\$code); $r->print($output); if ($success) { # @@ -706,6 +717,11 @@ sub create_course { $r->print( '

'.&mt('Manage Access Keys').'

'); } + if ($code) { + $r->print( + '

'.&mt('Course identifier to share with students: [_1]',$code).'

' + ); + } # Flush the course logs so reverse user roles immediately updated $r->register_cleanup(\&Apache::lonnet::flushcourselogs); $r->print('

'.&mt('Roles will be active at next login').'.

'); @@ -1142,7 +1158,7 @@ sub creation_display_filter { $typename = $typenames->{$type}; } } - $output .= ''."\n"; + $output .= ''."\n"; } $output .= ''; } @@ -1361,7 +1377,7 @@ sub handler { '// ]]>'."\n". ''; my $start_page=&Apache::loncommon::start_page('Course/Community Creation Logs',$js); - my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('Created Courses/Communities','Creation_Log',undef,'Creation_Log'); + my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('Created Courses/Communities','Course_Creation_Log',undef,'Course_Creation_Log'); $r->print($start_page.$crumbs."\n".'
'); &print_creation_logs($r); $r->print('
'.&Apache::loncommon::end_page());