'."\n".
&Apache::loncommon::end_page());
return;
@@ -1488,25 +1503,8 @@ sub print_request_form {
''.&mt('Make another request').'
');
}
if (&Apache::loncoursequeueadmin::author_prompt()) {
- $r->print('
'.&mt('Access to authoring space').'
'.
- '
'.
- &mt('Although assessment items can be created directly inside a course, such items only use part of the assessment capabilities of LON-CAPA.').
- ' '.
- &mt('By contrast, items created in authoring space, then imported into a course, can use all of the features of the assessment engine.').'
'.
+ &mt('Although assessment items can be created directly inside a course, such items only use part of the assessment capabilities of LON-CAPA.').
+ ' '.
+ &mt('By contrast, items created in authoring space, then imported into a course, can use all of the features of the assessment engine.').'
'.
+ ''.
+ ''.
+ ''.
+ ''.
+ ''.
+ ''.
+ ''.
+ ' ');
+}
+
sub get_usertype {
my ($persondom,$personname,$curr_rules,$got_rules) = @_;
my ($rules,$ruleorder) =
@@ -3244,7 +3265,8 @@ sub display_navbuttons {
sub print_request_outcome {
my ($dom,$codetitles,$code_order,$instcredits) = @_;
my ($output,$cnum,$now,$req_notifylist,$crstype,$enrollstart,$enrollend,
- %sections,%crosslistings,%personnel,@baduname,@missingdom,%domconfig);
+ %sections,%crosslistings,%personnel,@baduname,@missingdom,%domconfig,
+ $uniquecode);
my $sectotal = $env{'form.sectotal'};
my $crosslisttotal = 0;
$cnum = $env{'form.cnum'};
@@ -3258,6 +3280,7 @@ sub print_request_outcome {
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') {
$req_notifylist = $domconfig{'requestcourses'}{'notify'}{'approval'};
}
+ $uniquecode = $domconfig{'requestcourses'}{'uniquecode'};
}
$now = time;
$crstype = $env{'form.crstype'};
@@ -3467,6 +3490,7 @@ sub print_request_outcome {
crstype => $env{'form.crstype'},
instcode => $instcode,
defaultcredits => $credits,
+ uniquecode => $uniquecode,
clonedom => $clonedom,
clonecrs => $clonecrs,
datemode => $env{'form.datemode'},
@@ -3483,11 +3507,18 @@ sub print_request_outcome {
accessend => $accessend,
personnel => \%personnel,
};
- my (@inststatuses,$storeresult,$creationresult);
+ my ($result,$output) = &process_request($dom,$cnum,$crstype,$now,$details,$instcode,
+ $req_notifylist,\@instsections,\%domconfig);
+ return ($result,$output);
+}
+
+sub process_request {
+ my ($dom,$cnum,$crstype,$now,$details,$instcode,$req_notifylist,$instsections,$domconfig) = @_;
+ my (@inststatuses,$storeresult,$creationresult,$output);
my $val =
&Apache::loncoursequeueadmin::get_processtype('course',$env{'user.name'},
$env{'user.domain'},$env{'user.adv'},
- $dom,$crstype,\@inststatuses,\%domconfig);
+ $dom,$crstype,\@inststatuses,$domconfig);
if ($val eq '') {
if ($crstype eq 'official') {
$output = &mt('You are not permitted to request creation of official courses.');
@@ -3522,8 +3553,10 @@ sub print_request_outcome {
$inststatuslist = join(',',@inststatuses);
}
my $instseclist;
- if (@instsections > 0) {
- $instseclist = join(',',@instsections);
+ if (ref($instsections) eq 'ARRAY') {
+ if (@{$instsections} > 0) {
+ $instseclist = join(',',@{$instsections});
+ }
}
$validationchk =
&Apache::lonnet::auto_courserequest_validation($dom,
@@ -3558,7 +3591,7 @@ sub print_request_outcome {
$storeresult = 'rejected';
} elsif ($disposition eq 'process') {
my %domdefs = &Apache::lonnet::get_domain_defaults($dom);
- my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,%longroles);
+ my ($logmsg,$newusermsg,$addresult,$enrollcount,$response,$keysmsg,%longroles,$code);
my $type = 'Course';
if ($crstype eq 'community') {
$type = 'Community';
@@ -3569,7 +3602,7 @@ sub print_request_outcome {
}
my $result = &Apache::loncoursequeueadmin::course_creation($dom,$cnum,
'autocreate',$details,\$logmsg,\$newusermsg,\$addresult,
- \$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles);
+ \$enrollcount,\$response,\$keysmsg,\%domdefs,\%longroles,\$code);
if ($result eq 'created') {
$disposition = 'created';
$reqstatus = 'created';
@@ -3580,6 +3613,10 @@ sub print_request_outcome {
} else {
$output = '
'.&mt('Your course request has been processed and the course has been created.');
}
+ if ($code) {
+ $output .= ¬ification_information($disposition,$env{'user.name'}.':'.$env{'user.domain'},
+ $cnum,$now,$code);
+ }
$output .= ' '.$role_result.'
';
$creationresult = 'created';
} else {
@@ -3803,7 +3840,7 @@ sub update_requestors_roles {
}
sub notification_information {
- my ($disposition,$req_notifylist,$cnum,$now) = @_;
+ my ($disposition,$req_notifylist,$cnum,$now,$code) = @_;
my %emails = &Apache::loncommon::getemails();
my $address;
if (($emails{'permanentemail'} ne '') || ($emails{'notification'} ne '')) {
@@ -3831,6 +3868,24 @@ sub notification_information {
&mt("Usually this means that your institution's information systems do not list you among the instructional personnel for this course.").' '.
&mt('The list of instructional personnel for the course will be automatically checked daily, and once you are listed the request will be processed.').
'';
+ } elsif (($disposition eq 'created') && ($code)) {
+ my $codemsg = [{
+ mt => 'Students can automatically select your course by entering this code: [_1]',
+ args => [$code],
+ }];
+ $output .= '
'.
+ &mt('Students can automatically select your course by entering this code: [_1].',''.$code.'').
+ ' '.
+ &mt('A message has been sent to your LON-CAPA account with this information.');
+ if ($address ne '') {
+ $output.= ' '.&mt('And an e-mail has also been sent to: [_1] with this code.',$address);
+ }
+ $output .= '