--- loncom/interface/loncreatecourse.pm 2013/07/15 14:32:45 1.148 +++ loncom/interface/loncreatecourse.pm 2014/01/29 18:37:41 1.154 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.148 2013/07/15 14:32:45 bisitz Exp $ +# $Id: loncreatecourse.pm,v 1.154 2014/01/29 18:37:41 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -155,12 +155,12 @@ function validate(formname) { 'iinf' => "Institutional Information", 'stat' => "The following entries will be used to identify the course according to the naming scheme adopted by your institution. Your choices will be used to map an internal LON-CAPA course ID to the corresponding course section ID(s) used by the office responsible for providing official class lists for courses at your institution. This mapping is required if you choose to employ automatic population of class lists.", 'ccod' => "Course Code", - 'toin' => "to interface with institutional data, e.g., fs03glg231 for Fall 2003 Geology 231", 'snid' => "Section Numbers and corresponding LON-CAPA section IDs", '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", + '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", @@ -206,8 +206,6 @@ function validate(formname) { 'psam' => "Authentication mechanism", 'pcda' => "Default authentication method for new users added to this domain by the automated enrollment process", 'nech' => "Notification of enrollment changes", - 'nccl' => "Notification to course coordinator via LON-CAPA message when enrollment changes occur during the automated update?", - 'ndcl' => "Notification to domain coordinator via LON-CAPA message when enrollment changes occur during the automated update?", 'irsp' => "Include retrieval of student photographs?", 'rshm' => 'Resource Space Home', 'cgrs' => "Course Group Settings", @@ -216,6 +214,9 @@ function validate(formname) { 'opcm' => 'Open Community', ); $lt{'kaut'} = &mt('Key authority ([_1]id:domain[_2]) if other than course','',''); + $lt{'toin'} = &mt('to interface with institutional data, e.g., [_1]fs13glg231[_2] for [_3]Fall 2013 Geology 231[_4]','','','',''); + $lt{'nccl'} = &mt('Notification to [_1]course coordinator[_2] via LON-CAPA message when enrollment changes occur during the automated update?','',''); + $lt{'ndcl'} = &mt('Notification to [_1]domain coordinator[_2] via LON-CAPA message when enrollment changes occur during the automated update?','',''); if ($crstype eq 'Community') { $lt{'cinf'} = &mt('Community Information'); @@ -280,7 +281,7 @@ END 'Create_Courses'); $r->print($start_page.$crumbs); - $r->print('
' + $r->print('
' .&Apache::lonhtmlcommon::start_pick_box() .&Apache::lonhtmlcommon::row_headline() @@ -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').'.

'); @@ -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());