--- loncom/interface/loncreatecourse.pm 2013/12/24 19:15:10 1.152 +++ loncom/interface/loncreatecourse.pm 2013/12/25 09:52:42 1.153 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.152 2013/12/24 19:15:10 raeburn Exp $ +# $Id: loncreatecourse.pm,v 1.153 2013/12/25 09:52:42 raeburn 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 indentifier to share with students", 'cred' => "the number of institutional credits students will earn by completing this course", 'crco' => "Course Content", 'cncr' => "Completely new course", @@ -343,6 +344,12 @@ END .&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() @@ -653,6 +660,10 @@ sub create_course { $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 indentifier 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').'.

');