version 1.75, 2015/03/07 23:17:15
|
version 1.81, 2016/04/04 01:09:48
|
Line 41 use LONCAPA qw(:DEFAULT :match);
|
Line 41 use LONCAPA qw(:DEFAULT :match);
|
|
|
sub get_dc_settable { |
sub get_dc_settable { |
my ($type,$cdom) = @_; |
my ($type,$cdom) = @_; |
if ($type eq 'Community') { |
if (($type eq 'Community') || ($type eq 'Placement')) { |
return ('courseowner','selfenrollmgrdc','selfenrollmgrcc'); |
return ('courseowner','selfenrollmgrdc','selfenrollmgrcc'); |
} else { |
} else { |
my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc'); |
my @items = ('courseowner','coursecode','authtype','autharg','selfenrollmgrdc','selfenrollmgrcc'); |
Line 71 sub catalog_settable {
|
Line 71 sub catalog_settable {
|
if ($confhash->{'categorizecomm'} ne 'comm') { |
if ($confhash->{'categorizecomm'} ne 'comm') { |
push(@settable,'categorize'); |
push(@settable,'categorize'); |
} |
} |
|
} elsif ($type eq 'Placement') { |
|
if ($confhash->{'togglecatsplace'} ne 'place') { |
|
push(@settable,'togglecats'); |
|
} |
|
if ($confhash->{'categorizeplace'} ne 'place') { |
|
push(@settable,'categorize'); |
|
} |
} else { |
} else { |
if ($confhash->{'togglecats'} ne 'crs') { |
if ($confhash->{'togglecats'} ne 'crs') { |
push(@settable,'togglecats'); |
push(@settable,'togglecats'); |
Line 167 sub print_course_search_page {
|
Line 174 sub print_course_search_page {
|
$r->print(&Apache::loncommon::js_changer()); |
$r->print(&Apache::loncommon::js_changer()); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>'); |
$r->print('<h3>'.&mt('Search for a community in the [_1] domain',$domdesc).'</h3>'); |
|
} elsif ($type eq 'Placement') { |
|
$r->print('<h3>'.&mt('Search for a placement test in the [_1] domain',$domdesc).'</h3>'); |
} else { |
} else { |
$r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>'); |
$r->print('<h3>'.&mt('Search for a course in the [_1] domain',$domdesc).'</h3>'); |
} |
} |
Line 178 sub print_course_search_page {
|
Line 187 sub print_course_search_page {
|
'<li>'.&mt('Enter the community with the role of [_1]',$cctitle).'</li>'."\n". |
'<li>'.&mt('Enter the community with the role of [_1]',$cctitle).'</li>'."\n". |
'<li>'.&mt('View or modify community settings which only a [_1] may modify.',$dctitle). |
'<li>'.&mt('View or modify community settings which only a [_1] may modify.',$dctitle). |
'</li>'."\n".'</ul>'); |
'</li>'."\n".'</ul>'); |
|
} elsif ($type eq 'Placement') { |
|
$r->print(&mt('Actions available after searching for a placement test:').'<ul>'. |
|
'<li>'.&mt('Enter the placement test with the role of [_1]',$cctitle).'</li>'."\n". |
|
'<li>'.&mt('View or modify placement test settings which only a [_1] may modify.',$dctitle). |
|
'</li>'."\n".'</ul>'); |
} else { |
} else { |
$r->print(&mt('Actions available after searching for a course:').'<ul>'. |
$r->print(&mt('Actions available after searching for a course:').'<ul>'. |
'<li>'.&mt('Enter the course with the role of [_1]',$cctitle).'</li>'."\n". |
'<li>'.&mt('Enter the course with the role of [_1]',$cctitle).'</li>'."\n". |
Line 208 sub print_course_selection_page {
|
Line 222 sub print_course_selection_page {
|
my %courses = &Apache::loncommon::search_courses($dom,$type,$filter,$numtitles, |
my %courses = &Apache::loncommon::search_courses($dom,$type,$filter,$numtitles, |
undef,undef,undef,\@codetitles); |
undef,undef,undef,\@codetitles); |
&Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,undef,undef, |
&Apache::lonpickcourse::display_matched_courses($r,$type,0,$action,undef,undef,undef, |
%courses); |
undef,undef,%courses); |
return; |
return; |
} |
} |
|
|
Line 254 sub print_modification_menu {
|
Line 268 sub print_modification_menu {
|
$categorytitle = 'View/Modify Course Settings'; |
$categorytitle = 'View/Modify Course Settings'; |
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.'); |
$setquota_text = &mt('Total disk space allocated for storage of portfolio files in all groups in a course.'); |
$setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a course via Content Editor.'); |
$setuploadquota_text = &mt('Disk space allocated for storage of content uploaded directly to a course via Content Editor.'); |
if (&showcredits($dom)) { |
if ($type eq 'Placement') { |
|
$setparams_text = 'View/Modify course owner and self-enrollment'; |
|
} elsif (&showcredits($dom)) { |
$setparams_text = 'View/Modify course owner, institutional code, default authentication, credits, and self-enrollment'; |
$setparams_text = 'View/Modify course owner, institutional code, default authentication, credits, and self-enrollment'; |
} else { |
} else { |
$setparams_text = 'View/Modify course owner, institutional code, default authentication, and self-enrollment'; |
$setparams_text = 'View/Modify course owner, institutional code, default authentication, and self-enrollment'; |
Line 320 sub print_modification_menu {
|
Line 336 sub print_modification_menu {
|
{ |
{ |
linktext => 'Display current settings for automated enrollment', |
linktext => 'Display current settings for automated enrollment', |
url => &phaseurl('viewparms'), |
url => &phaseurl('viewparms'), |
permission => ($type ne 'Community'), |
permission => (($type ne 'Community') && ($type ne 'Placement')), |
#help => '', |
#help => '', |
icon => 'roles.png', |
icon => 'roles.png', |
linktitle => '' |
linktitle => '' |
Line 359 sub print_modification_menu {
|
Line 375 sub print_modification_menu {
|
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>'."\n". |
$menu_html .= '<li>'.&mt('Community owner (permitted to assign Coordinator roles in the community).').'</li>'."\n". |
'<li>'.&mt('Override defaults for who configures self-enrollment for this specific community').'</li>'."\n"; |
'<li>'.&mt('Override defaults for who configures self-enrollment for this specific community').'</li>'."\n"; |
|
} elsif ($type eq 'Placement') { |
|
$menu_html .= '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n". |
|
'<li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n"; |
|
|
} else { |
} else { |
$menu_html .= '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n". |
$menu_html .= '<li>'.&mt('Course owner (permitted to assign Course Coordinator roles in the course).').'</li>'."\n". |
'<li>'.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").'</li>'."\n"; |
'<li>'.&mt("Institutional code and default authentication (both required for auto-enrollment of students from institutional datafeeds).").'</li>'."\n"; |
if (&showcredits($dom)) { |
if (($type ne 'Placement') && &showcredits($dom)) { |
$menu_html .= '<li>'.&mt('Default credits earned by student on course completion.').'</li>'."\n"; |
$menu_html .= '<li>'.&mt('Default credits earned by student on course completion.').'</li>'."\n"; |
} |
} |
$menu_html .= ' <li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n"; |
$menu_html .= ' <li>'.&mt('Override defaults for who configures self-enrollment for this specific course.').'</li>'."\n"; |
Line 634 sub domain_postsubtimeout {
|
Line 654 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 = lc($type); |
my $lctype = lc($type); |
unless ($type eq 'Community') { |
unless (($type eq 'Community') || ($type eq 'Placement')) { |
$lctype = 'unofficial'; |
$lctype = 'unofficial'; |
if ($settings->{'internal.coursecode'}) { |
if ($settings->{'internal.coursecode'}) { |
$lctype = 'official'; |
$lctype = 'official'; |
Line 693 sub print_catsettings {
|
Line 713 sub print_catsettings {
|
' <label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.' />'.&mt('Yes').'</label> <label><input name="hidefromcat" type="radio" value="" '.$excludeoff.' />'.&mt('No').'</label><br /><p>'); |
' <label><input name="hidefromcat" type="radio" value="yes" '.$excludeon.' />'.&mt('Yes').'</label> <label><input name="hidefromcat" type="radio" value="" '.$excludeoff.' />'.&mt('No').'</label><br /><p>'); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.")); |
$r->print(&mt("If a community has been categorized using at least one of the categories defined for communities in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.")); |
|
} elsif ($type eq 'Placement') { |
|
$r->print(&mt("If a placement test has been categorized using at least one of the categories defined for placement tests in the domain, it will be listed in the domain's publicly accessible Course/Community Catalog, unless excluded.")); |
} else { |
} else { |
$r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':<ul>'. |
$r->print(&mt("Unless excluded, a course will be listed in the domain's publicly accessible Course/Community Catalog, if at least one of the following applies").':<ul>'. |
'<li>'.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').'</li>'. |
'<li>'.&mt('Auto-cataloging is enabled and the course is assigned an institutional code.').'</li>'. |
Line 714 sub print_catsettings {
|
Line 736 sub print_catsettings {
|
} else { |
} else { |
$r->print(&mt('No categories defined for this domain')); |
$r->print(&mt('No categories defined for this domain')); |
} |
} |
unless ($type eq 'Community') { |
unless (($type eq 'Community') || ($type eq 'Placement')) { |
$r->print('<p>'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses, in addition to receiving a listing under any manually assigned categor(ies).').'</p>'); |
$r->print('<p>'.&mt('If auto-cataloging based on institutional code is enabled in the domain, a course will continue to be listed in the catalog of official courses, in addition to receiving a listing under any manually assigned categor(ies).').'</p>'); |
} |
} |
} |
} |
Line 831 sub print_course_modification_page {
|
Line 853 sub print_course_modification_page {
|
$r->print(&Apache::lonhtmlcommon::row_title( |
$r->print(&Apache::lonhtmlcommon::row_title( |
&Apache::loncommon::help_open_topic('Modify_Community_Owner'). |
&Apache::loncommon::help_open_topic('Modify_Community_Owner'). |
' '.&mt('Community Owner'))."\n"); |
' '.&mt('Community Owner'))."\n"); |
|
} elsif ($crstype eq 'Placement') { |
|
$r->print(&Apache::lonhtmlcommon::row_title( |
|
&Apache::loncommon::help_open_topic('Modify_Course_Owner'). |
|
' '.&mt('Course Owner'))."\n"); |
} else { |
} else { |
$r->print(&Apache::lonhtmlcommon::row_title( |
$r->print(&Apache::lonhtmlcommon::row_title( |
&Apache::loncommon::help_open_topic('Modify_Course_Instcode'). |
&Apache::loncommon::help_open_topic('Modify_Course_Instcode'). |
Line 905 sub print_course_modification_page {
|
Line 931 sub print_course_modification_page {
|
'<br />'.&Apache::lonhtmlcommon::row_closure(1). |
'<br />'.&Apache::lonhtmlcommon::row_closure(1). |
&Apache::lonhtmlcommon::end_pick_box().'</p><p>'.$hidden_elements. |
&Apache::lonhtmlcommon::end_pick_box().'</p><p>'.$hidden_elements. |
'<input type="button" onclick="javascript:changePage(this.form,'."'processparms'".');'); |
'<input type="button" onclick="javascript:changePage(this.form,'."'processparms'".');'); |
if ($crstype eq 'Community') { |
if (($crstype eq 'Community') || ($crstype eq 'Placement')) { |
$r->print('this.form.submit();"'); |
$r->print('this.form.submit();"'); |
} else { |
} else { |
$r->print('javascript:verify_message(this.form);"'); |
$r->print('javascript:verify_message(this.form);"'); |
Line 1026 sub modify_course {
|
Line 1052 sub modify_course {
|
'internal.pendingco-owners','internal.selfenrollmgrdc', |
'internal.pendingco-owners','internal.selfenrollmgrdc', |
'internal.selfenrollmgrcc'); |
'internal.selfenrollmgrcc'); |
my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles(); |
my ($selfenrollrows,$selfenrolltitles) = &Apache::lonuserutils::get_selfenroll_titles(); |
unless ($type eq 'Community') { |
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)) { |
Line 1044 sub modify_course {
|
Line 1070 sub modify_course {
|
if ($type eq 'Community') { |
if ($type eq 'Community') { |
%changed = ( owner => 0 ); |
%changed = ( owner => 0 ); |
$ccrole = 'co'; |
$ccrole = 'co'; |
|
} elsif ($type eq 'Placement') { |
|
%changed = ( owner => 0 ); |
|
$ccrole = 'cc'; |
} else { |
} else { |
%changed = ( code => 0, |
%changed = ( code => 0, |
owner => 0, |
owner => 0, |
Line 1204 sub modify_course {
|
Line 1233 sub modify_course {
|
$nochgresponse .= '<li>'.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).'</li>'; |
$nochgresponse .= '<li>'.&mt('[_1] still set to: [_2]',$longtype{$attr},$shown).'</li>'; |
} |
} |
} |
} |
if (($type ne 'Community') && ($changed{'code'} || $changed{'owner'})) { |
if (($type ne 'Community') && ($type ne 'Placement') && ($changed{'code'} || $changed{'owner'})) { |
if ( $newattr{'courseowner'} eq '') { |
if ( $newattr{'courseowner'} eq '') { |
push(@warnings,&mt('There is no owner associated with this LON-CAPA course.'). |
push(@warnings,&mt('There is no owner associated with this LON-CAPA course.'). |
'<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.')); |
'<br />'.&mt('If automated enrollment at your institution requires validation of course owners, automated enrollment will fail.')); |
Line 1711 sub modify_postsubmit_config {
|
Line 1740 sub modify_postsubmit_config {
|
); |
); |
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') { |
$r->print(&mt('Submit buttin will not be disabled after student submission')); |
$r->print(&mt('Submit button will not be disabled after student submission')); |
} else { |
} else { |
$r->print($lt{'erro'}); |
$r->print($lt{'erro'}); |
} |
} |
Line 1901 function hide_searching() {
|
Line 1930 function hide_searching() {
|
} elsif ($phase eq 'setquota') { |
} elsif ($phase eq 'setquota') { |
my $invalid = &mt('The quota you entered contained invalid characters.'); |
my $invalid = &mt('The quota you entered contained invalid characters.'); |
my $alert = &mt('You must enter a number'); |
my $alert = &mt('You must enter a number'); |
|
&js_escape(\$invalid); |
|
&js_escape(\$alert); |
my $regexp = '/^\s*(\d+\.?\d*|\.\d+)\s*$/'; |
my $regexp = '/^\s*(\d+\.?\d*|\.\d+)\s*$/'; |
$js .= <<"ENDSCRIPT"; |
$js .= <<"ENDSCRIPT"; |
|
|
Line 1920 ENDSCRIPT
|
Line 1951 ENDSCRIPT
|
} elsif ($phase eq 'setanon') { |
} elsif ($phase eq 'setanon') { |
my $invalid = &mt('The responder threshold you entered is invalid.'); |
my $invalid = &mt('The responder threshold you entered is invalid.'); |
my $alert = &mt('You must enter a positive integer.'); |
my $alert = &mt('You must enter a positive integer.'); |
|
&js_escape(\$invalid); |
|
&js_escape(\$alert); |
my $regexp = ' /^\s*\d+\s*$/'; |
my $regexp = ' /^\s*\d+\s*$/'; |
$js .= <<"ENDSCRIPT"; |
$js .= <<"ENDSCRIPT"; |
|
|
Line 1945 ENDSCRIPT
|
Line 1978 ENDSCRIPT
|
my $invalid = &mt('The choice entered for disabling the submit button is invalid.'); |
my $invalid = &mt('The choice entered for disabling the submit button is invalid.'); |
my $invalidtimeout = &mt('The timeout you entered for disabling the submit button is invalid.'); |
my $invalidtimeout = &mt('The timeout you entered for disabling the submit button is invalid.'); |
my $alert = &mt('Enter one of: a positive integer, 0 (for no timeout), or leave blank to use domain default'); |
my $alert = &mt('Enter one of: a positive integer, 0 (for no timeout), or leave blank to use domain default'); |
|
&js_escape(\$invalid); |
|
&js_escape(\$invalidtimeout); |
|
&js_escape(\$alert); |
my $regexp = ' /^\s*\d+\s*$/'; |
my $regexp = ' /^\s*\d+\s*$/'; |
|
|
$js .= <<"ENDSCRIPT"; |
$js .= <<"ENDSCRIPT"; |
Line 2034 ENDSCRIPT
|
Line 2070 ENDSCRIPT
|
my $bread_text = "View/Modify Courses/Communities"; |
my $bread_text = "View/Modify Courses/Communities"; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$bread_text = 'Community Settings'; |
$bread_text = 'Community Settings'; |
|
} elsif ($type eq 'Placement') { |
|
$bread_text = 'Placement Test Settings'; |
} else { |
} else { |
$bread_text = 'Course Settings'; |
$bread_text = 'Course Settings'; |
} |
} |
Line 2129 sub hidden_form_elements {
|
Line 2167 sub hidden_form_elements {
|
sub showcredits { |
sub showcredits { |
my ($dom) = @_; |
my ($dom) = @_; |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbokcredits'}) { |
if ($domdefaults{'officialcredits'} || $domdefaults{'unofficialcredits'} || $domdefaults{'textbookcredits'}) { |
return 1; |
return 1; |
} |
} |
} |
} |
Line 2167 sub handler {
|
Line 2205 sub handler {
|
} |
} |
my $choose_text; |
my $choose_text; |
my $type = $env{'form.type'}; |
my $type = $env{'form.type'}; |
|
print STDERR "type is ||$type||\n"; |
if ($type eq '') { |
if ($type eq '') { |
$type = 'Course'; |
$type = 'Course'; |
} |
} |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$choose_text = "Choose a community"; |
$choose_text = "Choose a community"; |
|
} elsif ($type eq 'Placement') { |
|
$choose_text = "Choose a placement test"; |
} else { |
} else { |
$choose_text = "Choose a course"; |
$choose_text = "Choose a course"; |
} |
} |
Line 2188 sub handler {
|
Line 2229 sub handler {
|
my $enter_text; |
my $enter_text; |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$enter_text = 'Enter community'; |
$enter_text = 'Enter community'; |
|
} elsif ($type eq 'Placement') { |
|
$enter_text = 'Enter placement test'; |
} else { |
} else { |
$enter_text = 'Enter course'; |
$enter_text = 'Enter course'; |
} |
} |
Line 2292 sub handler {
|
Line 2335 sub handler {
|
$r->print('<span class="LC_error">'); |
$r->print('<span class="LC_error">'); |
if ($type eq 'Community') { |
if ($type eq 'Community') { |
$r->print(&mt('The community you selected is not a valid community in this domain')); |
$r->print(&mt('The community you selected is not a valid community in this domain')); |
|
} elsif ($type eq 'Placement') { |
|
$r->print(&mt('The course you selected is not a valid placement test in this domain')); |
} else { |
} else { |
$r->print(&mt('The course you selected is not a valid course in this domain')); |
$r->print(&mt('The course you selected is not a valid course in this domain')); |
} |
} |