'.
@@ -3294,6 +3325,9 @@ sub ltitools_names {
'width' => 'Width',
'passback' => 'Tool can return grades:',
'roster' => 'Tool can retrieve roster:',
+ 'crstarget' => 'Display target',
+ 'crslabel' => 'Course label',
+ 'crstitle' => 'Course title',
);
return %lt;
}
@@ -8435,6 +8469,10 @@ sub modify_ltitools {
}
}
}
+ my @courseconfig = &Apache::loncommon::get_env_multiple('form.ltitools_courseconfig');
+ foreach my $item (@courseconfig) {
+ $confhash{$newid}{'crsconf'}{$item} = 1;
+ }
if ($env{'form.ltitools_add_custom'}) {
my $name = $env{'form.ltitools_add_custom_name'};
my $value = $env{'form.ltitools_add_custom_value'};
@@ -8522,6 +8560,19 @@ sub modify_ltitools {
$changes{$itemid} = 1;
}
}
+ my @courseconfig = &Apache::loncommon::get_env_multiple('form.ltitools_courseconfig_'.$i);
+ foreach my $item ('label','title','target') {
+ if (grep(/^\Q$item\E$/,@courseconfig)) {
+ $confhash{$itemid}{'crsconf'}{$item} = 1;
+ if (ref($domconfig{$action}{$itemid}{'crsconf'}) eq 'HASH') {
+ if ($domconfig{$action}{$itemid}{'crsconf'}{$item} ne $confhash{$itemid}{'crsconf'}{$item}) {
+ $changes{$itemid} = 1;
+ }
+ } else {
+ $changes{$itemid} = 1;
+ }
+ }
+ }
my @fields = &Apache::loncommon::get_env_multiple('form.ltitools_fields_'.$i);
foreach my $field (@fields) {
if ($possfield{$field}) {
@@ -8685,6 +8736,21 @@ sub modify_ltitools {
my $num = length($confhash{$itemid}{'secret'});
$resulttext .= ('*'x$num).'';
}
+ $resulttext .= ''.&mt('Configurable in course:');
+ my @possconfig = ('label','title','target');
+ my $numconfig = 0;
+ if (ref($confhash{$itemid}{'crsconf'}) eq 'HASH') {
+ foreach my $item (@possconfig) {
+ if ($confhash{$itemid}{'crsconf'}{$item}) {
+ $numconfig ++;
+ $resulttext .= ' '.$lt{'crs'.$item};
+ }
+ }
+ }
+ if (!$numconfig) {
+ $resulttext .= &mt('None');
+ }
+ $resulttext .= '';
foreach my $item ('passback','roster') {
$resulttext .= ''.$lt{$item}.' ';
if ($confhash{$itemid}{$item}) {
@@ -8852,7 +8918,8 @@ sub modify_autoenroll {
my $autorun = &Apache::lonnet::auto_run(undef,$dom),
my %title = ( run => 'Auto-enrollment active',
sender => 'Sender for notification messages',
- coowners => 'Automatic assignment of co-ownership to instructors of record (institutional data)');
+ coowners => 'Automatic assignment of co-ownership to instructors of record (institutional data)',
+ failsafe => 'Failsafe for no drops if institutional data missing for a section');
my @offon = ('off','on');
my $sender_uname = $env{'form.sender_uname'};
my $sender_domain = $env{'form.sender_domain'};
@@ -8862,11 +8929,17 @@ sub modify_autoenroll {
$sender_domain = '';
}
my $coowners = $env{'form.autoassign_coowners'};
+ my $failsafe = $env{'form.autoenroll_failsafe'};
+ $failsafe =~ s{^\s+|\s+$}{}g;
+ if ($failsafe =~ /\D/) {
+ undef($failsafe);
+ }
my %autoenrollhash = (
autoenroll => { 'run' => $env{'form.autoenroll_run'},
'sender_uname' => $sender_uname,
'sender_domain' => $sender_domain,
'co-owners' => $coowners,
+ 'autofailsafe' => $failsafe,
}
);
my $putresult = &Apache::lonnet::put_dom('configuration',\%autoenrollhash,
@@ -8893,7 +8966,10 @@ sub modify_autoenroll {
}
} elsif ($coowners) {
$changes{'coowners'} = 1;
- }
+ }
+ if ($currautoenroll{'autofailsafe'} ne $failsafe) {
+ $changes{'autofailsafe'} = 1;
+ }
if (keys(%changes) > 0) {
$resulttext = &mt('Changes made:').'';
if ($changes{'run'}) {
@@ -8913,6 +8989,17 @@ sub modify_autoenroll {
$lastactref->{'domainconfig'} = 1;
}
}
+ if ($changes{'autofailsafe'}) {
+ if ($failsafe ne '') {
+ $resulttext .= '- '.&mt("$title{'failsafe'} set to [_1]",$failsafe).'
';
+ } else {
+ $resulttext .= '- '.&mt("$title{'failsafe'} deleted");
+ }
+ &Apache::lonnet::get_domain_defaults($dom,1);
+ if (ref($lastactref) eq 'HASH') {
+ $lastactref->{'domdefaults'} = 1;
+ }
+ }
$resulttext .= '
';
} else {
$resulttext = &mt('No changes made to auto-enrollment settings');
|