version 1.102, 2023/08/03 15:57:23
|
version 1.103, 2023/09/05 03:42:31
|
Line 104 sub get_enrollment_settings {
|
Line 104 sub get_enrollment_settings {
|
my ($cdom,$cnum) = @_; |
my ($cdom,$cnum) = @_; |
my ($internals,$accessdates) = &autoenroll_keys(); |
my ($internals,$accessdates) = &autoenroll_keys(); |
my @items; |
my @items; |
if ((ref($internals) eq 'ARRAY') && (ref($accessdates) eq 'ARRAY')) { |
if ((ref($internals) eq 'ARRAY') && (ref($accessdates) eq 'ARRAY')) { |
@items = map { 'internal.'.$_; } (@{$internals}); |
@items = map { 'internal.'.$_; } (@{$internals}); |
push(@items,@{$accessdates}); |
push(@items,@{$accessdates}); |
} |
} |
Line 445 sub print_modification_menu {
|
Line 445 sub print_modification_menu {
|
); |
); |
} |
} |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
if ($permission->{'setparms'} eq 'edit') { |
if ($permission->{'setparms'} eq 'edit') { |
$categorytitle = 'View/Modify Community Settings'; |
$categorytitle = 'View/Modify Community Settings'; |
$linktext{'setparms'} = 'View/Modify community owner, self-enrollment and table lifetime'; |
$linktext{'setparms'} = 'View/Modify community owner, self-enrollment and table lifetime'; |
$linktext{'catsettings'} = 'View/Modify catalog settings for community'; |
$linktext{'catsettings'} = 'View/Modify catalog settings for community'; |
Line 455 sub print_modification_menu {
|
Line 455 sub print_modification_menu {
|
$linktext{'catsettings'} = 'View catalog settings for community'; |
$linktext{'catsettings'} = 'View catalog settings for community'; |
} |
} |
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.'); |
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a community.'); |
$setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a community via Content Editor.'); |
$setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a community via Content Editor.'); |
} else { |
} else { |
if ($permission->{'setparms'} eq 'edit') { |
if ($permission->{'setparms'} eq 'edit') { |
$categorytitle = 'View/Modify Course Settings'; |
$categorytitle = 'View/Modify Course Settings'; |
Line 481 sub print_modification_menu {
|
Line 481 sub print_modification_menu {
|
$extendedtype = ucfirst(&Apache::lonuserutils::get_extended_type($cdom,$cnum,$type,\%settings)); |
$extendedtype = ucfirst(&Apache::lonuserutils::get_extended_type($cdom,$cnum,$type,\%settings)); |
} |
} |
my $anon_text = &mt('Responder threshold required to display anonymous survey submissions.'); |
my $anon_text = &mt('Responder threshold required to display anonymous survey submissions.'); |
my $postsubmit_text = &mt('Override defaults for submit button behavior post-submission for this specific course.'); |
my $postsubmit_text = &mt('Override defaults for submit button behavior post-submission for this specific course.'); |
my $mysqltables_text = &mt('Override default for lifetime of "temporary" MySQL tables containing student performance data.'); |
my $mysqltables_text = &mt('Override default for lifetime of "temporary" MySQL tables containing student performance data.'); |
my $ltiauth_text = &mt('Override default for requirement for re-authentication for LTI-limited launch of deep-linked item.'); |
my $ltiauth_text = &mt('Override default for requirement for re-authentication for LTI-limited launch of deep-linked item.'); |
my $exttool_text = &mt('Override default permissions for external tools use for this specific course.'); |
my $exttool_text = &mt('Override default permissions for external tools use for this specific course.'); |
Line 615 sub print_adhocrole_selected {
|
Line 615 sub print_adhocrole_selected {
|
} |
} |
$selectrole = 1; |
$selectrole = 1; |
} elsif ($permission->{'adhocrole'} eq 'custom') { |
} elsif ($permission->{'adhocrole'} eq 'custom') { |
my ($okroles,$description) = &Apache::lonnet::get_my_adhocroles($env{'form.pickedcourse'},1); |
my ($okroles,$description) = &Apache::lonnet::get_my_adhocroles($env{'form.pickedcourse'},1); |
if (ref($okroles) eq 'ARRAY') { |
if (ref($okroles) eq 'ARRAY') { |
my $possrole = $env{'form.adhocrole'}; |
my $possrole = $env{'form.adhocrole'}; |
if (($possrole ne '') && (grep(/^\Q$possrole\E$/,@{$okroles}))) { |
if (($possrole ne '') && (grep(/^\Q$possrole\E$/,@{$okroles}))) { |
my $confname = &Apache::lonnet::get_domainconfiguser($cdom); |
my $confname = &Apache::lonnet::get_domainconfiguser($cdom); |
$newrole = "cr/$cdom/$confname/$possrole./$cdom/$cnum"; |
$newrole = "cr/$cdom/$confname/$possrole./$cdom/$cnum"; |
Line 817 sub print_set_anonsurvey_threshold {
|
Line 817 sub print_set_anonsurvey_threshold {
|
my %settings = &Apache::lonnet::get('environment',['internal.anonsurvey_threshold'],$cdom,$cnum); |
my %settings = &Apache::lonnet::get('environment',['internal.anonsurvey_threshold'],$cdom,$cnum); |
my $threshold = $settings{'internal.anonsurvey_threshold'}; |
my $threshold = $settings{'internal.anonsurvey_threshold'}; |
if ($threshold eq '') { |
if ($threshold eq '') { |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
$threshold = $domconfig{'coursedefaults'}{'anonsurvey_threshold'}; |
$threshold = $domconfig{'coursedefaults'}{'anonsurvey_threshold'}; |
Line 832 sub print_set_anonsurvey_threshold {
|
Line 832 sub print_set_anonsurvey_threshold {
|
my $hidden_elements = &hidden_form_elements(); |
my $hidden_elements = &hidden_form_elements(); |
my ($disabled,$submit); |
my ($disabled,$submit); |
if ($readonly) { |
if ($readonly) { |
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
} else { |
} else { |
$submit = '<input type="submit" value="'.$lt{'modi'}.'" />'; |
$submit = '<input type="submit" value="'.$lt{'modi'}.'" />'; |
} |
} |
Line 872 sub print_postsubmit_config {
|
Line 872 sub print_postsubmit_config {
|
if ($postsubmit eq '') { |
if ($postsubmit eq '') { |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
$postsubmit = 1; |
$postsubmit = 1; |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}{'postsubmit'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}{'postsubmit'}) eq 'HASH') { |
if ($domconfig{'coursedefaults'}{'postsubmit'}{'client'} eq 'off') { |
if ($domconfig{'coursedefaults'}{'postsubmit'}{'client'} eq 'off') { |
$postsubmit = 0; |
$postsubmit = 0; |
} |
} |
} |
} |
} |
} |
Line 910 sub print_postsubmit_config {
|
Line 910 sub print_postsubmit_config {
|
<h4><span class="LC_nobreak">$showtype: $cdesc</span></h4> |
<h4><span class="LC_nobreak">$showtype: $cdesc</span></h4> |
<form action="/adm/modifycourse" method="post" name="setpostsubmit" onsubmit="return verify_postsubmit();"> |
<form action="/adm/modifycourse" method="post" name="setpostsubmit" onsubmit="return verify_postsubmit();"> |
<p> |
<p> |
$helpitem $lt{'disa'}: |
$helpitem $lt{'disa'}: |
<label><input type="radio" name="postsubmit" $checkedon onclick="togglePostsubmit('studentsubmission');" value="1" $disabled /> |
<label><input type="radio" name="postsubmit" $checkedon onclick="togglePostsubmit('studentsubmission');" value="1" $disabled /> |
$lt{'yes'}</label> |
$lt{'yes'}</label> |
<label><input type="radio" name="postsubmit" $checkedoff onclick="togglePostsubmit('studentsubmission');" value="0" $disabled /> |
<label><input type="radio" name="postsubmit" $checkedoff onclick="togglePostsubmit('studentsubmission');" value="0" $disabled /> |
Line 933 ENDDOCUMENT
|
Line 933 ENDDOCUMENT
|
|
|
sub domain_postsubtimeout { |
sub domain_postsubtimeout { |
my ($cdom,$type,$settings) = @_; |
my ($cdom,$type,$settings) = @_; |
return unless (ref($settings) eq 'HASH'); |
return unless (ref($settings) eq 'HASH'); |
my $lctype = &get_lctype($type,$settings); |
my $lctype = &get_lctype($type,$settings); |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
Line 993 sub print_catsettings {
|
Line 993 sub print_catsettings {
|
if ($readonly) { |
if ($readonly) { |
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
} |
} |
my %currsettings = |
my %currsettings = |
&Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum); |
&Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum); |
if (grep(/^togglecats$/,@cat_params)) { |
if (grep(/^togglecats$/,@cat_params)) { |
my $excludeon = ''; |
my $excludeon = ''; |
my $excludeoff = ' checked="checked" '; |
my $excludeoff = ' checked="checked" '; |
if ($currsettings{'hidefromcat'} eq 'yes') { |
if ($currsettings{'hidefromcat'} eq 'yes') { |
$excludeon = $excludeoff; |
$excludeon = $excludeoff; |
$excludeoff = ''; |
$excludeoff = ''; |
} |
} |
$r->print('<br /><h4>'.$lt{'visi'}.'</h4>'. |
$r->print('<br /><h4>'.$lt{'visi'}.'</h4>'. |
'<p>'. |
'<p>'. |
Line 1083 sub print_course_modification_page {
|
Line 1083 sub print_course_modification_page {
|
'gobt' => "Save", |
'gobt' => "Save", |
'sett' => 'Setting', |
'sett' => 'Setting', |
'domd' => 'Domain default', |
'domd' => 'Domain default', |
'whom' => 'Who configures', |
'whom' => 'Who configures', |
); |
); |
my ($ownertable,$ccrole,$javascript_validations,$authenitems,$ccname,$disabled); |
my ($ownertable,$ccrole,$javascript_validations,$authenitems,$ccname,$disabled); |
my %enrollvar = &get_enrollment_settings($cdom,$cnum); |
my %enrollvar = &get_enrollment_settings($cdom,$cnum); |
Line 1117 sub print_course_modification_page {
|
Line 1117 sub print_course_modification_page {
|
$cc_status{$uname.':'.$udom} = $lt{'actv'}; |
$cc_status{$uname.':'.$udom} = $lt{'actv'}; |
} |
} |
} |
} |
if (($enrollvar{'courseowner'} ne '') && |
if (($enrollvar{'courseowner'} ne '') && |
(!grep(/^$enrollvar{'courseowner'}$/,@local_ccs))) { |
(!grep(/^$enrollvar{'courseowner'}$/,@local_ccs))) { |
push(@local_ccs,$enrollvar{'courseowner'}); |
push(@local_ccs,$enrollvar{'courseowner'}); |
my ($owneruname,$ownerdom) = split(/:/,$enrollvar{'courseowner'}); |
my ($owneruname,$ownerdom) = split(/:/,$enrollvar{'courseowner'}); |
$pname{$enrollvar{'courseowner'}} = |
$pname{$enrollvar{'courseowner'}} = |
&Apache::loncommon::plainname($owneruname,$ownerdom); |
&Apache::loncommon::plainname($owneruname,$ownerdom); |
my $active_cc = &Apache::loncommon::check_user_status($ownerdom,$owneruname, |
my $active_cc = &Apache::loncommon::check_user_status($ownerdom,$owneruname, |
$cdom,$cnum,$ccrole); |
$cdom,$cnum,$ccrole); |
Line 1151 sub print_course_modification_page {
|
Line 1151 sub print_course_modification_page {
|
} else { |
} else { |
$ownertable .= '<td><input type="radio" name="courseowner" value="'.$cc.'"'.$disabled.' /></td>'."\n"; |
$ownertable .= '<td><input type="radio" name="courseowner" value="'.$cc.'"'.$disabled.' /></td>'."\n"; |
} |
} |
$ownertable .= |
$ownertable .= |
'<td>'.$pname{$cc}.'</td>'."\n". |
'<td>'.$pname{$cc}.'</td>'."\n". |
'<td>'.$cc.'</td>'."\n". |
'<td>'.$cc.'</td>'."\n". |
'<td>'.$cc_status{$cc}.' '.$ccname.'</td>'."\n". |
'<td>'.$cc_status{$cc}.' '.$ccname.'</td>'."\n". |
Line 1228 sub print_course_modification_page {
|
Line 1228 sub print_course_modification_page {
|
'<th>'.$lt{'whom'}.'</th>'. |
'<th>'.$lt{'whom'}.'</th>'. |
&Apache::loncommon::end_data_table_header_row()."\n"); |
&Apache::loncommon::end_data_table_header_row()."\n"); |
my %optionname; |
my %optionname; |
$optionname{''} = &mt('Use domain default'); |
$optionname{''} = &mt('Use domain default'); |
$optionname{'0'} = $dctitle; |
$optionname{'0'} = $dctitle; |
$optionname{'1'} = $cctitle; |
$optionname{'1'} = $cctitle; |
foreach my $item (@{$selfenrollrows}) { |
foreach my $item (@{$selfenrollrows}) { |
Line 1243 sub print_course_modification_page {
|
Line 1243 sub print_course_modification_page {
|
$checked{'1'} = ' checked="checked"'; |
$checked{'1'} = ' checked="checked"'; |
} else { |
} else { |
$checked{''} = ' checked="checked"'; |
$checked{''} = ' checked="checked"'; |
} |
} |
$r->print(&Apache::loncommon::start_data_table_row()."\n". |
$r->print(&Apache::loncommon::start_data_table_row()."\n". |
'<td>'.$selfenrolltitles->{$item}.'</td>'."\n". |
'<td>'.$selfenrolltitles->{$item}.'</td>'."\n". |
'<td>'.&mt('[_1] configures',$default).'</td>'."\n". |
'<td>'.&mt('[_1] configures',$default).'</td>'."\n". |
'<td>'); |
'<td>'); |
foreach my $option ('','0','1') { |
foreach my $option ('','0','1') { |
$r->print('<span class="LC_nobreak"><label>'. |
$r->print('<span class="LC_nobreak"><label>'. |
'<input type="radio" name="selfenrollmgr_'.$item.'" '. |
'<input type="radio" name="selfenrollmgr_'.$item.'" '. |
'value="'.$option.'"'.$checked{$option}.$disabled.' />'. |
'value="'.$option.'"'.$checked{$option}.$disabled.' />'. |
Line 1317 sub print_set_ltiauth {
|
Line 1317 sub print_set_ltiauth {
|
my ($domdef,$checkeddom,$checkedcrs,$domdefdisplay,$divsty,$authok,$authno); |
my ($domdef,$checkeddom,$checkedcrs,$domdefdisplay,$divsty,$authok,$authno); |
$domdef = 0; |
$domdef = 0; |
$checkeddom = ' checked="checked"'; |
$checkeddom = ' checked="checked"'; |
$domdefdisplay = $lt{'logi'}; |
$domdefdisplay = $lt{'logi'}; |
$divsty = 'display:none'; |
$divsty = 'display:none'; |
$authno = ' checked="checked"'; |
$authno = ' checked="checked"'; |
my %domconfig = |
my %domconfig = |
Line 1409 sub print_set_exttool {
|
Line 1409 sub print_set_exttool {
|
} elsif ($domdef) { |
} elsif ($domdef) { |
$domdefdisplay = $titles{'crs'}; |
$domdefdisplay = $titles{'crs'}; |
} elsif ($domdefdom) { |
} elsif ($domdefdom) { |
$domdefdisplay = $titles{'dom'}; |
$domdefdisplay = $titles{'dom'}; |
} else { |
} else { |
$domdefdisplay = $titles{'none'}; |
$domdefdisplay = $titles{'none'}; |
} |
} |
Line 1420 sub print_set_exttool {
|
Line 1420 sub print_set_exttool {
|
dom => '', |
dom => '', |
crs => '', |
crs => '', |
none => '', |
none => '', |
); |
); |
if ($crsexttool ne '') { |
if ($crsexttool ne '') { |
$checkedcrs = $checkeddom; |
$checkedcrs = $checkeddom; |
$checkeddom = ''; |
$checkeddom = ''; |
$divsty = 'display:inline-block'; |
$divsty = 'display:inline-block'; |
foreach my $option ('both','dom','crs','none') { |
foreach my $option ('both','dom','crs','none') { |
if ($crsexttool eq $option) { |
if ($crsexttool eq $option) { |
$crschecked{$option} = ' checked="checked"'; |
$crschecked{$option} = ' checked="checked"'; |
} else { |
} else { |
$crschecked{$option} = ''; |
$crschecked{$option} = ''; |
} |
} |
Line 1577 sub gather_authenitems {
|
Line 1577 sub gather_authenitems {
|
unless ($curr_authtype eq '') { |
unless ($curr_authtype eq '') { |
$curr_authfield = $curr_authtype.'arg'; |
$curr_authfield = $curr_authtype.'arg'; |
} |
} |
my $javascript_validations = |
my $javascript_validations = |
&Apache::lonuserutils::javascript_validations('modifycourse',$krbdefdom, |
&Apache::lonuserutils::javascript_validations('modifycourse',$krbdefdom, |
$curr_authtype,$curr_authfield); |
$curr_authtype,$curr_authfield); |
my %param = ( formname => 'document.'.$env{'form.phase'}, |
my %param = ( formname => 'document.'.$env{'form.phase'}, |
Line 1611 sub modify_course {
|
Line 1611 sub modify_course {
|
unless (($type eq 'Community') || ($type eq 'Placement')) { |
unless (($type eq 'Community') || ($type eq 'Placement')) { |
push(@items,('internal.coursecode','internal.authtype','internal.autharg', |
push(@items,('internal.coursecode','internal.authtype','internal.autharg', |
'internal.sectionnums','internal.crosslistings')); |
'internal.sectionnums','internal.crosslistings')); |
if (&showcredits($cdom)) { |
if (&showcredits($cdom)) { |
push(@items,'internal.defaultcredits'); |
push(@items,'internal.defaultcredits'); |
} |
} |
my %passwdconf = &Apache::lonnet::get_passwdconf($cdom); |
my %passwdconf = &Apache::lonnet::get_passwdconf($cdom); |
Line 1734 sub modify_course {
|
Line 1734 sub modify_course {
|
$newattr{'courseowner'}=$env{'form.courseowner'}; |
$newattr{'courseowner'}=$env{'form.courseowner'}; |
unless ( $newattr{'courseowner'} eq $currattr{'courseowner'} ) { |
unless ( $newattr{'courseowner'} eq $currattr{'courseowner'} ) { |
$changed{'owner'} = 1; |
$changed{'owner'} = 1; |
} |
} |
} |
} |
|
|
if ($changed{'owner'} || $changed{'code'} || $changed{'passwd'}) { |
if ($changed{'owner'} || $changed{'code'} || $changed{'passwd'}) { |
Line 1801 sub modify_course {
|
Line 1801 sub modify_course {
|
} else { |
} else { |
if ($env{'course.'.$cdom.'_'.$cnum.'.description'} ne '') { |
if ($env{'course.'.$cdom.'_'.$cnum.'.description'} ne '') { |
my %newenv; |
my %newenv; |
map { $newenv{'course.'.$cdom.'_'.$cnum.'.internal.'.$_} = $newattr{$_}; } @changes; |
map { $newenv{'course.'.$cdom.'_'.$cnum.'.internal.'.$_} = $newattr{$_}; } @changes; |
&Apache::lonnet::appenv(\%newenv); |
&Apache::lonnet::appenv(\%newenv); |
} |
} |
foreach my $attr (@modifiable_params) { |
foreach my $attr (@modifiable_params) { |
Line 1860 sub modify_course {
|
Line 1860 sub modify_course {
|
if ($course_check eq 'ok') { |
if ($course_check eq 'ok') { |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'},$coowners); |
my $outcome = &Apache::lonnet::auto_new_course($cnum,$cdom,$inst_course_id,$newattr{'courseowner'},$coowners); |
unless ($outcome eq 'ok') { |
unless ($outcome eq 'ok') { |
|
|
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome).'<br/>'); |
push(@warnings,&mt('If automatic enrollment is enabled for "[_1]", automated enrollment may fail for "[_2]" - section: [_3] for the following reason: "[_4]".',$description,$newattr{'coursecode'},$instsec,$outcome).'<br/>'); |
} |
} |
} else { |
} else { |
Line 1924 sub modify_course {
|
Line 1923 sub modify_course {
|
$nochgresponse .= "</ul><br/><br/>"; |
$nochgresponse .= "</ul><br/><br/>"; |
} |
} |
my ($warning,$numwarnings); |
my ($warning,$numwarnings); |
my $numwarnings = scalar(@warnings); |
my $numwarnings = scalar(@warnings); |
if ($numwarnings) { |
if ($numwarnings) { |
$warning = &mt('The following [quant,_1,warning was,warnings were] generated when applying your changes to automated enrollment:',$numwarnings).'<p><ul>'; |
$warning = &mt('The following [quant,_1,warning was,warnings were] generated when applying your changes to automated enrollment:',$numwarnings).'<p><ul>'; |
foreach my $warn (@warnings) { |
foreach my $warn (@warnings) { |
Line 2156 sub modify_quota {
|
Line 2155 sub modify_quota {
|
$showresult{$item} = 1; |
$showresult{$item} = 1; |
} |
} |
} else { |
} else { |
if ($item eq 'coursequota') { |
if ($item eq 'coursequota') { |
$r->print(&mt('The proposed group portfolio quota contained invalid characters, so the quota is unchanged.').'<br />'); |
$r->print(&mt('The proposed group portfolio quota contained invalid characters, so the quota is unchanged.').'<br />'); |
} else { |
} else { |
$r->print(&mt('The proposed quota for content uploaded via the Content Editor contained invalid characters, so the quota is unchanged.').'<br />'); |
$r->print(&mt('The proposed quota for content uploaded via the Content Editor contained invalid characters, so the quota is unchanged.').'<br />'); |
Line 2169 sub modify_quota {
|
Line 2168 sub modify_quota {
|
my $putreply = &Apache::lonnet::put('environment',\%cenv,$cdom, |
my $putreply = &Apache::lonnet::put('environment',\%cenv,$cdom, |
$cnum); |
$cnum); |
foreach my $key (sort(keys(%showresult))) { |
foreach my $key (sort(keys(%showresult))) { |
if (($oldsettings{'internal.'.$key} eq '') && |
if (($oldsettings{'internal.'.$key} eq '') && |
($env{'form.'.$key} == $default{$key})) { |
($env{'form.'.$key} == $default{$key})) { |
if ($key eq 'uploadquota') { |
if ($key eq 'uploadquota') { |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
Line 2179 sub modify_quota {
|
Line 2178 sub modify_quota {
|
$r->print(&mt('The disk space allocated for files uploaded to this course via the Content Editor is the default quota for this domain: [_1] MB.', |
$r->print(&mt('The disk space allocated for files uploaded to this course via the Content Editor is the default quota for this domain: [_1] MB.', |
$default{$key}).'<br />'); |
$default{$key}).'<br />'); |
} |
} |
} else { |
} else { |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print(&mt('The disk space allocated for group portfolio files in this community is the default quota for this domain: [_1] MB.', |
$r->print(&mt('The disk space allocated for group portfolio files in this community is the default quota for this domain: [_1] MB.', |
$default{$key}).'<br />'); |
$default{$key}).'<br />'); |
Line 2239 sub modify_anonsurvey_threshold {
|
Line 2238 sub modify_anonsurvey_threshold {
|
my %oldsettings = &Apache::lonnet::get('environment',['internal.anonsurvey_threshold'],$cdom,$cnum); |
my %oldsettings = &Apache::lonnet::get('environment',['internal.anonsurvey_threshold'],$cdom,$cnum); |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
&Apache::lonnet::get_dom('configuration',['coursedefaults'],$cdom); |
my $defaultthreshold; |
my $defaultthreshold; |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}) eq 'HASH') { |
$defaultthreshold = $domconfig{'coursedefaults'}{'anonsurvey_threshold'}; |
$defaultthreshold = $domconfig{'coursedefaults'}{'anonsurvey_threshold'}; |
if ($defaultthreshold eq '') { |
if ($defaultthreshold eq '') { |
Line 2306 sub modify_postsubmit_config {
|
Line 2305 sub modify_postsubmit_config {
|
$r->print('<h3>'.$lt{'subb'}.'</h3>'."\n". |
$r->print('<h3>'.$lt{'subb'}.'</h3>'."\n". |
'<h4><span class="LC_nobreak">'.&mt($type).': '.$cdesc.'</span></h4>'."\n". |
'<h4><span class="LC_nobreak">'.&mt($type).': '.$cdesc.'</span></h4>'."\n". |
'<form action="/adm/modifycourse" method="post" name="processpostsubmit"><p>'."\n"); |
'<form action="/adm/modifycourse" method="post" name="processpostsubmit"><p>'."\n"); |
my %oldsettings = |
my %oldsettings = |
&Apache::lonnet::get('environment',['internal.postsubmit','internal.postsubtimeout','internal.coursecode','internal.textbook'],$cdom,$cnum); |
&Apache::lonnet::get('environment',['internal.postsubmit','internal.postsubtimeout','internal.coursecode','internal.textbook'],$cdom,$cnum); |
my $postsubmit = $env{'form.postsubmit'}; |
my $postsubmit = $env{'form.postsubmit'}; |
if ($postsubmit eq '1') { |
if ($postsubmit eq '1') { |
my $postsubtimeout = $env{'form.postsubtimeout'}; |
my $postsubtimeout = $env{'form.postsubtimeout'}; |
$postsubtimeout =~ s/[^\d\.]+//g; |
$postsubtimeout =~ s/[^\d\.]+//g; |
if (($oldsettings{'internal.postsubmit'} eq $postsubmit) && ($oldsettings{'internal.postsubtimeout'} eq $postsubtimeout)) { |
if (($oldsettings{'internal.postsubmit'} eq $postsubmit) && ($oldsettings{'internal.postsubtimeout'} eq $postsubtimeout)) { |
$r->print($lt{'unch'}); |
$r->print($lt{'unch'}); |
} else { |
} else { |
my %cenv = ( |
my %cenv = ( |
'internal.postsubmit' => $postsubmit, |
'internal.postsubmit' => $postsubmit, |
Line 2329 sub modify_postsubmit_config {
|
Line 2328 sub modify_postsubmit_config {
|
} else { |
} else { |
$r->print($lt{'erro'}); |
$r->print($lt{'erro'}); |
} |
} |
} else { |
} else { |
$cenv{'internal.postsubtimeout'} = $postsubtimeout; |
$cenv{'internal.postsubtimeout'} = $postsubtimeout; |
my $putreply = &Apache::lonnet::put('environment',\%cenv,$cdom,$cnum); |
my $putreply = &Apache::lonnet::put('environment',\%cenv,$cdom,$cnum); |
if ($putreply eq 'ok') { |
if ($putreply eq 'ok') { |
if ($postsubtimeout eq '0') { |
if ($postsubtimeout eq '0') { |
$r->print(&mt('Submit button will be disabled after student submission until page is reloaded.')); |
$r->print(&mt('Submit button will be disabled after student submission until page is reloaded.')); |
} else { |
} else { |
$r->print(&mt('Submit button will be disabled after student submission for [quant,_1,second].',$postsubtimeout)); |
$r->print(&mt('Submit button will be disabled after student submission for [quant,_1,second].',$postsubtimeout)); |
} |
} |
Line 2348 sub modify_postsubmit_config {
|
Line 2347 sub modify_postsubmit_config {
|
$r->print($lt{'unch'}); |
$r->print($lt{'unch'}); |
} else { |
} else { |
if (exists($oldsettings{'internal.postsubtimeout'})) { |
if (exists($oldsettings{'internal.postsubtimeout'})) { |
&Apache::lonnet::del('environment',['internal.postsubtimeout'],$cdom,$cnum); |
&Apache::lonnet::del('environment',['internal.postsubtimeout'],$cdom,$cnum); |
} |
} |
my %cenv = ( |
my %cenv = ( |
'internal.postsubmit' => $postsubmit, |
'internal.postsubmit' => $postsubmit, |
Line 2393 sub modify_catsettings {
|
Line 2392 sub modify_catsettings {
|
my (%cenv,@changes,@nochanges); |
my (%cenv,@changes,@nochanges); |
my %currsettings = |
my %currsettings = |
&Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum); |
&Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum); |
my (@newcategories,%showitem); |
my (@newcategories,%showitem); |
if (grep(/^togglecats$/,@cat_params)) { |
if (grep(/^togglecats$/,@cat_params)) { |
if ($currsettings{'hidefromcat'} ne $env{'form.hidefromcat'}) { |
if ($currsettings{'hidefromcat'} ne $env{'form.hidefromcat'}) { |
push(@changes,'hidefromcat'); |
push(@changes,'hidefromcat'); |
Line 2439 sub modify_catsettings {
|
Line 2438 sub modify_catsettings {
|
foreach my $cat (@newcategories) { |
foreach my $cat (@newcategories) { |
if (!grep(/^\Q$cat\E$/,@currcategories)) { |
if (!grep(/^\Q$cat\E$/,@currcategories)) { |
$catchg = 1; |
$catchg = 1; |
last; |
last; |
} |
} |
} |
} |
} |
} |
} else { |
} else { |
if (@newcategories > 0) { |
if (@newcategories > 0) { |
Line 2540 sub modify_ltiauth {
|
Line 2539 sub modify_ltiauth {
|
$change = 1; |
$change = 1; |
} |
} |
} elsif ($env{'form.ltiauthset'} eq 'course') { |
} elsif ($env{'form.ltiauthset'} eq 'course') { |
if ($env{'form.ltiauth'} =~ /^0|1$/) { |
if ($env{'form.ltiauth'} =~ /^0|1$/) { |
$newltiauth = $env{'form.ltiauth'}; |
$newltiauth = $env{'form.ltiauth'}; |
} |
} |
if ($oldltiauth == $newltiauth) { |
if ($oldltiauth == $newltiauth) { |
Line 2808 ENDSCRIPT
|
Line 2807 ENDSCRIPT
|
&js_escape(\$alert); |
&js_escape(\$alert); |
my $regexp = ' /^\s*\d+\s*$/'; |
my $regexp = ' /^\s*\d+\s*$/'; |
|
|
$js .= <<"ENDSCRIPT"; |
$js .= <<"ENDSCRIPT"; |
|
|
function verify_postsubmit() { |
function verify_postsubmit() { |
var optionsElement = document.setpostsubmit.postsubmit; |
var optionsElement = document.setpostsubmit.postsubmit; |
Line 2840 function verify_postsubmit() {
|
Line 2839 function verify_postsubmit() {
|
} |
} |
} else { |
} else { |
if (currval == 0) { |
if (currval == 0) { |
verified = 'ok'; |
verified = 'ok'; |
} else { |
} else { |
alert('$invalid'); |
alert('$invalid'); |
return false; |
return false; |
Line 2858 function togglePostsubmit(caller) {
|
Line 2857 function togglePostsubmit(caller) {
|
var optionsElement = document.setpostsubmit.postsubmit; |
var optionsElement = document.setpostsubmit.postsubmit; |
if (document.getElementById(caller)) { |
if (document.getElementById(caller)) { |
var divitem = document.getElementById(caller); |
var divitem = document.getElementById(caller); |
var optionsElement = document.setpostsubmit.postsubmit; |
var optionsElement = document.setpostsubmit.postsubmit; |
if (optionsElement.length) { |
if (optionsElement.length) { |
var currval; |
var currval; |
for (var i=0; i<optionsElement.length; i++) { |
for (var i=0; i<optionsElement.length; i++) { |
Line 3055 sub course_settings_descrip {
|
Line 3054 sub course_settings_descrip {
|
} |
} |
|
|
sub hidden_form_elements { |
sub hidden_form_elements { |
my $hidden_elements = |
my $hidden_elements = |
&Apache::lonhtmlcommon::echo_form_input(['gosearch','updater','coursecode', |
&Apache::lonhtmlcommon::echo_form_input(['gosearch','updater','coursecode', |
'prevphase','numlocalcc','courseowner','login','coursequota','intarg', |
'prevphase','numlocalcc','courseowner','login','coursequota','intarg', |
'locarg','krbarg','krbver','counter','hidefromcat','usecategory', |
'locarg','krbarg','krbver','counter','hidefromcat','usecategory', |
Line 3185 sub handler {
|
Line 3184 sub handler {
|
$choose_text = "Choose a placement test"; |
$choose_text = "Choose a placement test"; |
} else { |
} else { |
$choose_text = "Choose a course"; |
$choose_text = "Choose a course"; |
} |
} |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$firstform,'')", |
({href=>"javascript:changePage(document.$firstform,'')", |
text=>"Course/Community search"}, |
text=>"Course/Community search"}, |
Line 3200 sub handler {
|
Line 3199 sub handler {
|
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$enter_text = 'Enter community'; |
$enter_text = 'Enter community'; |
} elsif ($type eq 'Placement') { |
} elsif ($type eq 'Placement') { |
$enter_text = 'Enter placement test'; |
$enter_text = 'Enter placement test'; |
} else { |
} else { |
$enter_text = 'Enter course'; |
$enter_text = 'Enter course'; |
} |
} |
Line 3223 sub handler {
|
Line 3222 sub handler {
|
my ($cdom,$cnum) = split(/_/,$env{'form.pickedcourse'}); |
my ($cdom,$cnum) = split(/_/,$env{'form.pickedcourse'}); |
my ($readonly,$linktext); |
my ($readonly,$linktext); |
if ($permission->{$phase} eq 'view') { |
if ($permission->{$phase} eq 'view') { |
$readonly = 1; |
$readonly = 1; |
} |
} |
if (($phase eq 'setquota') && ($permission->{'setquota'})) { |
if (($phase eq 'setquota') && ($permission->{'setquota'})) { |
if ($permission->{'setquota'} eq 'view') { |
if ($permission->{'setquota'} eq 'view') { |
$linktext = 'Set quota'; |
$linktext = 'Set quota'; |
} else { |
} else { |
$linktext = 'Display quota'; |
$linktext = 'Display quota'; |
} |
} |
Line 3235 sub handler {
|
Line 3234 sub handler {
|
({href=>"javascript:changePage(document.$phase,'$phase')", |
({href=>"javascript:changePage(document.$phase,'$phase')", |
text=>$linktext}); |
text=>$linktext}); |
&print_setquota($r,$cdom,$cnum,$cdesc,$type,$readonly); |
&print_setquota($r,$cdom,$cnum,$cdesc,$type,$readonly); |
} elsif (($phase eq 'processquota') && ($permission->{'processquota'})) { |
} elsif (($phase eq 'processquota') && ($permission->{'processquota'})) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'setquota')", |
({href=>"javascript:changePage(document.$phase,'setquota')", |
text=>"Set quota"}); |
text=>"Set quota"}); |
Line 3314 sub handler {
|
Line 3313 sub handler {
|
if (!exists($env{'form.state'})) { |
if (!exists($env{'form.state'})) { |
&print_selfenrollconfig($r,$type,$cdesc,$coursehash,$readonly); |
&print_selfenrollconfig($r,$type,$cdesc,$coursehash,$readonly); |
} elsif ($env{'form.state'} eq 'done') { |
} elsif ($env{'form.state'} eq 'done') { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'$phase')", |
({href=>"javascript:changePage(document.$phase,'$phase')", |
text=>"Result"}); |
text=>"Result"}); |
&modify_selfenrollconfig($r,$type,$cdesc,$coursehash); |
&modify_selfenrollconfig($r,$type,$cdesc,$coursehash); |