version 1.49.2.28, 2021/12/24 21:09:09
|
version 1.85, 2018/01/02 14:43:17
|
Line 310 sub handler {
|
Line 310 sub handler {
|
idnu => 'Course ID or number', |
idnu => 'Course ID or number', |
unco => 'Unique code', |
unco => 'Unique code', |
desc => 'Course Description', |
desc => 'Course Description', |
cred => 'Student credits', |
cred => 'Student credits', |
ownr => 'Course Owner', |
ownr => 'Course Owner', |
cown => 'Course Co-owners', |
cown => 'Course Co-owners', |
catg => 'Categorize course', |
catg => 'Categorize course', |
Line 375 sub handler {
|
Line 375 sub handler {
|
help => 'Course_Prefs_General', |
help => 'Course_Prefs_General', |
ordered => ['owner','co-owners','loncaparev','description', |
ordered => ['owner','co-owners','loncaparev','description', |
'clonedfrom','courseid','uniquecode','categories', |
'clonedfrom','courseid','uniquecode','categories', |
'hidefromcat','syllabus','cloners','url', |
'hidefromcat','externalsyllabus','cloners','url', |
'rolenames'], |
'rolenames'], |
itemtext => { |
itemtext => { |
'owner' => $lt{'ownr'}, |
'owner' => $lt{'ownr'}, |
'co-owners' => $lt{'cown'}, |
'co-owners' => $lt{'cown'}, |
'description' => $lt{'desc'}, |
'description' => $lt{'desc'}, |
'courseid' => $lt{'idnu'}, |
'courseid' => $lt{'idnu'}, |
'uniquecode' => $lt{'unco'}, |
'uniquecode' => $lt{'unco'}, |
'categories' => $lt{'catg'}, |
'categories' => $lt{'catg'}, |
'hidefromcat' => $lt{'excc'}, |
'hidefromcat' => $lt{'excc'}, |
'cloners' => $lt{'clon'}, |
'cloners' => $lt{'clon'}, |
'syllabus' => 'Syllabus status', |
'externalsyllabus' => 'Syllabus status', |
'url' => 'Top Level Map', |
'url' => 'Top Level Map', |
'rolenames' => $lt{'rept'}, |
'rolenames' => $lt{'rept'}, |
'loncaparev' => $lt{'lcrv'}, |
'loncaparev' => $lt{'lcrv'}, |
Line 419 sub handler {
|
Line 419 sub handler {
|
{ text => 'Discussion and Chat', |
{ text => 'Discussion and Chat', |
help => 'Course_Prefs_Discussions', |
help => 'Course_Prefs_Discussions', |
ordered => ['pch.roles.denied','pch.users.denied', |
ordered => ['pch.roles.denied','pch.users.denied', |
|
'pac.roles.denied','pac.users.denied', |
'plc.roles.denied','plc.users.denied', |
'plc.roles.denied','plc.users.denied', |
'allow_limited_html_in_feedback', |
'allow_limited_html_in_feedback', |
'allow_discussion_post_editing', |
'allow_discussion_post_editing', |
Line 428 sub handler {
|
Line 429 sub handler {
|
'pch.users.denied' => 'No Resource Discussion', |
'pch.users.denied' => 'No Resource Discussion', |
'plc.roles.denied' => 'No Chat room use', |
'plc.roles.denied' => 'No Chat room use', |
'plc.users.denied' => 'No Chat room use', |
'plc.users.denied' => 'No Chat room use', |
|
'pac.roles.denied' => 'No Anonymous Resource Discussion', |
|
'pac.users.denied' => 'No Anonymous Resource Discussion', |
allow_limited_html_in_feedback => 'Allow limited HTML in discussion', |
allow_limited_html_in_feedback => 'Allow limited HTML in discussion', |
allow_discussion_post_editing => 'Users can edit/delete own discussion posts', |
allow_discussion_post_editing => 'Users can edit/delete own discussion posts', |
discussion_post_fonts => 'Discussion post fonts based on likes/unlikes', |
discussion_post_fonts => 'Discussion post fonts based on likes/unlikes', |
}, |
}, |
}, |
}, |
'classlists' => |
'classlists' => |
Line 464 sub handler {
|
Line 467 sub handler {
|
help => 'Course_Prefs_Display', |
help => 'Course_Prefs_Display', |
ordered => ['default_xml_style','pageseparators', |
ordered => ['default_xml_style','pageseparators', |
'disable_receipt_display','texengine', |
'disable_receipt_display','texengine', |
'tthoptions','uselcmath','usejsme','inline_chem'], |
'tthoptions','uselcmath','usejsme'], |
itemtext => { |
itemtext => { |
default_xml_style => 'Default XML style file', |
default_xml_style => 'Default XML style file', |
pageseparators => 'Visibly Separate Items on Pages', |
pageseparators => 'Visibly Separate Items on Pages', |
Line 473 sub handler {
|
Line 476 sub handler {
|
tthoptions => 'Default set of options to pass to tth/m when converting TeX', |
tthoptions => 'Default set of options to pass to tth/m when converting TeX', |
uselcmath => 'Student formula entry uses inline preview, not DragMath pop-up', |
uselcmath => 'Student formula entry uses inline preview, not DragMath pop-up', |
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', |
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', |
inline_chem => 'Chemical reaction response uses inline preview, not pop-up', |
|
}, |
}, |
}, |
}, |
'grading' => |
'grading' => |
Line 494 sub handler {
|
Line 496 sub handler {
|
help => 'Course_Prefs_Printouts', |
help => 'Course_Prefs_Printouts', |
ordered => ['problem_stream_switch','suppress_tries', |
ordered => ['problem_stream_switch','suppress_tries', |
'default_paper_size','print_header_format', |
'default_paper_size','print_header_format', |
'disableexampointprint'], |
'disableexampointprint','canuse_pdfforms'], |
itemtext => { |
itemtext => { |
problem_stream_switch => 'Allow problems to be split over pages', |
problem_stream_switch => 'Allow problems to be split over pages', |
suppress_tries => 'Suppress number of tries in printing', |
suppress_tries => 'Suppress number of tries in printing', |
Line 764 sub process_changes {
|
Line 766 sub process_changes {
|
(!$can_categorize)); |
(!$can_categorize)); |
next if (($entry eq 'loncaparev') || |
next if (($entry eq 'loncaparev') || |
($entry eq 'owner') || |
($entry eq 'owner') || |
($entry eq 'clonedfrom') || |
($entry eq 'clonedfrom')); |
($entry eq 'syllabus')); |
|
push(@ordered,$entry); |
push(@ordered,$entry); |
} |
} |
} elsif ($action eq 'classlists') { |
} elsif ($action eq 'classlists') { |
Line 968 sub process_changes {
|
Line 969 sub process_changes {
|
my $udom = $env{'user.domain'}; |
my $udom = $env{'user.domain'}; |
my $pendingcoowners = $values->{'internal.pendingco-owners'}; |
my $pendingcoowners = $values->{'internal.pendingco-owners'}; |
my @pendingcoown = split(',',$pendingcoowners); |
my @pendingcoown = split(',',$pendingcoowners); |
if ($env{'form.pending_coowner'}) { |
if ($env{'form.pending_coowoner'}) { |
foreach my $item (@pendingcoown) { |
foreach my $item (@pendingcoown) { |
unless ($item eq $uname.':'.$udom) { |
unless ($item eq $uname.':'.$udom) { |
push(@newpending,$item); |
push(@newpending,$item); |
} |
} |
} |
} |
@newcoown = @currcoown; |
@newcoown = @currcoown; |
if ($env{'form.pending_coowner'} eq 'accept') { |
if ($env{'form.pending_coowoner'} eq 'accept') { |
unless (grep(/^\Q$uname\E:\Q$udom\E$/,@currcoown)) { |
unless (grep(/^\Q$uname\E:\Q$udom\E$/,@currcoown)) { |
push(@newcoown,$uname.':'.$udom); |
push(@newcoown,$uname.':'.$udom); |
} |
} |
} |
} |
} elsif ($env{'form.remove_coowner'}) { |
} elsif ($env{'form.remove_coowoner'}) { |
foreach my $item (@currcoown) { |
foreach my $item (@currcoown) { |
unless ($item eq $uname.':'.$udom) { |
unless ($item eq $uname.':'.$udom) { |
push(@newcoown,$item); |
push(@newcoown,$item); |
Line 1058 sub process_changes {
|
Line 1059 sub process_changes {
|
} |
} |
} |
} |
} |
} |
} elsif (($entry eq 'plc.roles.denied') || ($entry eq 'pch.roles.denied')) { |
} elsif (($entry eq 'plc.roles.denied') || ($entry eq 'pch.roles.denied') || |
|
($entry eq 'pac.roles.denied')) { |
my @denied = &Apache::loncommon::get_env_multiple('form.'.$entry); |
my @denied = &Apache::loncommon::get_env_multiple('form.'.$entry); |
@denied = sort(@denied); |
@denied = sort(@denied); |
my $deniedstr = ''; |
my $deniedstr = ''; |
Line 1066 sub process_changes {
|
Line 1068 sub process_changes {
|
$deniedstr = join(',',@denied); |
$deniedstr = join(',',@denied); |
} |
} |
$newvalues{$entry} = $deniedstr; |
$newvalues{$entry} = $deniedstr; |
} elsif (($entry eq 'plc.users.denied') || ($entry eq 'pch.users.denied')) { |
} elsif (($entry eq 'plc.users.denied') || ($entry eq 'pch.users.denied') || |
|
($entry eq 'pac.users.denied')) { |
my $total = $env{'form.'.$entry.'_total'}; |
my $total = $env{'form.'.$entry.'_total'}; |
my $userstr = ''; |
my $userstr = ''; |
my @denied; |
my @denied; |
Line 1118 sub process_changes {
|
Line 1121 sub process_changes {
|
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my $fontchange = 0; |
my $fontchange = 0; |
foreach my $class (@{$classorder}) { |
foreach my $class (@{$classorder}) { |
my $ext_entry = $entry.'_'.$class; |
my $ext_entry = $entry.'_'.$class; |
my $size = $env{'form.'.$ext_entry.'_size'}; |
my $size = $env{'form.'.$ext_entry.'_size'}; |
my $unit = $env{'form.'.$ext_entry.'_unit'}; |
my $unit = $env{'form.'.$ext_entry.'_unit'}; |
my $weight = $env{'form.'.$ext_entry.'_weight'}; |
my $weight = $env{'form.'.$ext_entry.'_weight'}; |
my $style = $env{'form.'.$ext_entry.'_style'}; |
my $style = $env{'form.'.$ext_entry.'_style'}; |
my $other = $env{'form.'.$ext_entry.'_other'}; |
my $other = $env{'form.'.$ext_entry.'_other'}; |
$size =~ s/,//g; |
$size =~ s/,//g; |
$unit =~ s/,//g; |
$unit =~ s/,//g; |
$weight =~ s/,//g; |
$weight =~ s/,//g; |
$style =~ s/,//g; |
$style =~ s/,//g; |
$other =~ s/[^\w;:\s\-\%.]//g; |
$other =~ s/[^\w;:\s\-\%.]//g; |
Line 1133 sub process_changes {
|
Line 1136 sub process_changes {
|
$newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); |
$newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); |
my $current = $values->{$ext_entry}; |
my $current = $values->{$ext_entry}; |
if ($values->{$ext_entry} eq '') { |
if ($values->{$ext_entry} eq '') { |
$current = ',,,'; |
$current = ',,,'; |
} |
} |
if ($newvalues{$ext_entry} ne $current) { |
if ($newvalues{$ext_entry} ne $current) { |
$changes->{$ext_entry} = $newvalues{$ext_entry}; |
$changes->{$ext_entry} = $newvalues{$ext_entry}; |
Line 1142 sub process_changes {
|
Line 1145 sub process_changes {
|
} |
} |
if ($fontchange) { |
if ($fontchange) { |
$changes->{$entry} = 1; |
$changes->{$entry} = 1; |
} |
} |
} elsif ($entry eq 'nothideprivileged') { |
} elsif ($entry eq 'nothideprivileged') { |
my @curr_nothide; |
my @curr_nothide; |
my @new_nothide; |
my @new_nothide; |
Line 1217 sub process_changes {
|
Line 1220 sub process_changes {
|
my $newtext = $maxnum-1; |
my $newtext = $maxnum-1; |
$newhdr[$env{'form.printfmthdr_pos_'.$newtext}] = $env{'form.printfmthdr_text_'.$newtext}; |
$newhdr[$env{'form.printfmthdr_pos_'.$newtext}] = $env{'form.printfmthdr_text_'.$newtext}; |
$newvalues{$entry} = join('',@newhdr); |
$newvalues{$entry} = join('',@newhdr); |
} elsif (($entry eq 'languages') || |
} elsif (($entry eq 'languages') || |
($entry eq 'checkforpriv')) { |
($entry eq 'checkforpriv')) { |
my $settings; |
my $settings; |
my $total = $env{'form.'.$entry.'_total'}; |
my $total = $env{'form.'.$entry.'_total'}; |
Line 1233 sub process_changes {
|
Line 1236 sub process_changes {
|
} |
} |
if ($env{'form.'.$entry.'_'.$total} ne '') { |
if ($env{'form.'.$entry.'_'.$total} ne '') { |
my $new = $env{'form.'.$entry.'_'.$total}; |
my $new = $env{'form.'.$entry.'_'.$total}; |
if ($entry eq 'languages') { |
if ($entry eq 'languages') { |
my %langchoices = &get_lang_choices(); |
my %langchoices = &get_lang_choices(); |
if ($langchoices{$new}) { |
if ($langchoices{$new}) { |
$settings .= $new; |
$settings .= $new; |
Line 1476 sub store_changes {
|
Line 1479 sub store_changes {
|
$displayval = &Apache::lonlocal::locallocaltime($displayval); |
$displayval = &Apache::lonlocal::locallocaltime($displayval); |
} elsif ($key eq 'categories') { |
} elsif ($key eq 'categories') { |
$displayval = $env{'form.categories_display'}; |
$displayval = $env{'form.categories_display'}; |
} elsif (($key eq 'canuse_pdfforms') || ($key eq 'usejsme') || |
} elsif (($key eq 'canuse_pdfforms') || ($key eq 'usejsme') || ($key eq 'uselcmath')) { |
($key eq 'uselcmath') || ($key eq 'inline_chem')) { |
|
if ($changes->{$item}{$key} eq '1') { |
if ($changes->{$item}{$key} eq '1') { |
$displayval = &mt('Yes'); |
$displayval = &mt('Yes'); |
} elsif ($changes->{$item}{$key} eq '0') { |
} elsif ($changes->{$item}{$key} eq '0') { |
Line 1509 sub store_changes {
|
Line 1511 sub store_changes {
|
} |
} |
} |
} |
unless (&Apache::lonnet::is_course_owner($cdom,$cnum)) { |
unless (&Apache::lonnet::is_course_owner($cdom,$cnum)) { |
if ($env{'form.pending_coowner'} eq 'accept') { |
if ($env{'form.pending_coowoner'} eq 'accept') { |
$displayval = &mt('on'); |
$displayval = &mt('on'); |
} elsif ($env{'form.pending_coowner'} eq 'decline') { |
} elsif ($env{'form.pending_coowoner'} eq 'decline') { |
$displayval = ''; |
$displayval = ''; |
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Invitation to be co-owner declined')).'</li>'; |
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Invitation to be co-owner declined')).'</li>'; |
} elsif ($env{'form.remove_coowner'}) { |
} elsif ($env{'form.remove_coowoner'}) { |
$displayval = &mt('off'); |
$displayval = &mt('off'); |
} |
} |
if ($displayval) { |
if ($displayval) { |
Line 1779 sub get_jscript {
|
Line 1781 sub get_jscript {
|
$local_to_standard{$code_order[$i]} = $standardnames[$i]; |
$local_to_standard{$code_order[$i]} = $standardnames[$i]; |
} |
} |
foreach my $cloner (@cloners) { |
foreach my $cloner (@cloners) { |
if (($cloner !~ /^\Q*:\E$match_domain$/) && |
if (($cloner !~ /^\Q*:\E$match_domain$/) && |
($cloner !~ /^$match_username\:$match_domain$/)) { |
($cloner !~ /^$match_username\:$match_domain$/)) { |
foreach my $item (split(/\&/,$cloner)) { |
foreach my $item (split(/\&/,$cloner)) { |
my ($key,$val) = split(/\=/,$item); |
my ($key,$val) = split(/\=/,$item); |
Line 1881 function syllabusinfo() {
|
Line 1883 function syllabusinfo() {
|
} |
} |
ENDSCRIPT |
ENDSCRIPT |
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
$cloners_js."\n".$instcode_js. |
$cloners_js."\n".$instcode_js. |
$syllabus_js."\n".'//]]>'."\n". |
$syllabus_js."\n".'//]]>'."\n". |
Line 2064 sub print_courseinfo {
|
Line 2066 sub print_courseinfo {
|
&mt('Modification may make assessment data inaccessible!'). |
&mt('Modification may make assessment data inaccessible!'). |
'</span>'; |
'</span>'; |
$editsyllabus = &mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">', |
$editsyllabus = &mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">', |
'</a>'); |
'</a>'); |
} |
} |
my %items = ( |
my %items = ( |
'url' => { |
'url' => { |
Line 2110 sub print_courseinfo {
|
Line 2112 sub print_courseinfo {
|
size => '20', |
size => '20', |
advanced => 1 |
advanced => 1 |
}, |
}, |
'syllabus' => { |
'externalsyllabus' => { |
text => '<b>'.&mt($itemtext->{'syllabus'}).'</b><br />'. |
text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />'. |
&mt('(Syllabus type in use)').(' ' x2). |
&mt('(Syllabus type in use)').(' ' x2). |
$editsyllabus, |
$editsyllabus, |
}, |
}, |
Line 2145 sub print_courseinfo {
|
Line 2147 sub print_courseinfo {
|
next if (!$env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}); |
next if (!$env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}); |
} |
} |
unless (($item eq 'cloners') || ($item eq 'rolenames')) { |
unless (($item eq 'cloners') || ($item eq 'rolenames')) { |
$colspan = 2; |
$colspan = 2; |
} |
} |
$count ++; |
$count ++; |
if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { |
if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { |
Line 2189 sub print_courseinfo {
|
Line 2191 sub print_courseinfo {
|
$default = '0'; |
$default = '0'; |
} |
} |
$datatable .= &new_cloners_dom_row($cdom,'0',$default); |
$datatable .= &new_cloners_dom_row($cdom,'0',$default); |
} |
} |
} elsif ($settings->{$item} ne '*') { |
} elsif ($settings->{$item} ne '*') { |
my @entries = split(/,/,$settings->{$item}); |
my @entries = split(/,/,$settings->{$item}); |
if (@entries > 0) { |
if (@entries > 0) { |
Line 2328 sub print_courseinfo {
|
Line 2330 sub print_courseinfo {
|
if ($clonesrc =~ m{/$match_domain/$match_courseid}) { |
if ($clonesrc =~ m{/$match_domain/$match_courseid}) { |
my %clonesrcinfo = &Apache::lonnet::coursedescription($clonesrc); |
my %clonesrcinfo = &Apache::lonnet::coursedescription($clonesrc); |
if ($clonesrcinfo{'description'}) { |
if ($clonesrcinfo{'description'}) { |
$clonedfrom = $clonesrcinfo{'description'}.' '.($clonesrc); |
$clonedfrom = $clonesrcinfo{'description'}.' '.($clonesrc); |
} |
} |
} |
} |
$datatable .= $clonedfrom; |
$datatable .= $clonedfrom; |
} elsif ($item eq 'uniquecode') { |
} elsif ($item eq 'uniquecode') { |
my $code = $env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}; |
my $code = $env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}; |
if ($code) { |
if ($code) { |
$datatable .= $code; |
$datatable .= $code; |
} |
} |
Line 2356 sub print_courseinfo {
|
Line 2358 sub print_courseinfo {
|
$datatable .= &manage_coownership($cnum,$cdom,\@currcoown,$noedit); |
$datatable .= &manage_coownership($cnum,$cdom,\@currcoown,$noedit); |
} |
} |
} |
} |
} elsif ($item eq 'syllabus') { |
} elsif ($item eq 'externalsyllabus') { |
my $external = $env{'course.'.$env{'request.course.id'}.'.externalsyllabus'}; |
my $external = $env{'course.'.$env{'request.course.id'}.'.externalsyllabus'}; |
my $uploaded = $env{'course.'.$env{'request.course.id'}.'.uploadedsyllabus'}; |
my $uploaded = $env{'course.'.$env{'request.course.id'}.'.uploadedsyllabus'}; |
my $minimal = $env{'course.'.$env{'request.course.id'}.'.minimalsyllabus'}; |
my $minimal = $env{'course.'.$env{'request.course.id'}.'.minimalsyllabus'}; |
Line 2380 sub print_courseinfo {
|
Line 2382 sub print_courseinfo {
|
} elsif ($uploaded) { |
} elsif ($uploaded) { |
$datatable .= &mt('Uploaded file'); |
$datatable .= &mt('Uploaded file'); |
} else { |
} else { |
$datatable .= &mt('Standard template'); |
$datatable .= &mt('Standard template'); |
} |
} |
$datatable .= (' ' x 2). |
$datatable .= (' ' x 2). |
&mt('[_1]View[_2]', |
&mt('[_1]View[_2]', |
'<a href="javascript:syllabusinfo();">', |
'<a href="javascript:syllabusinfo();">', |
'</a>'); |
'</a>'); |
} elsif ($item eq 'loncaparev') { |
} elsif ($item eq 'loncaparev') { |
my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; |
my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; |
my $showreqd; |
my $showreqd; |
Line 2410 sub new_cloners_dom_row {
|
Line 2412 sub new_cloners_dom_row {
|
my ($output,$checkedon,$checkedoff); |
my ($output,$checkedon,$checkedoff); |
if ($newdom ne '') { |
if ($newdom ne '') { |
if ($num eq $default) { |
if ($num eq $default) { |
$checkedon = 'checked="checked" '; |
$checkedon = 'checked="checked" '; |
} else { |
} else { |
$checkedoff = 'checked="checked" '; |
$checkedoff = 'checked="checked" '; |
} |
} |
Line 2561 ENDSCRIPT
|
Line 2563 ENDSCRIPT
|
|
|
sub display_loncaparev_constraints { |
sub display_loncaparev_constraints { |
my ($r,$navmap,$loncaparev,$crstype) = @_; |
my ($r,$navmap,$loncaparev,$crstype) = @_; |
my ($reqdmajor,$reqdminor); |
my ($reqdmajor,$reqdminor); |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
Line 2578 sub display_loncaparev_constraints {
|
Line 2580 sub display_loncaparev_constraints {
|
$Apache::lonrelrequtils::checkcrstypes{$crstype}).'</h4>'; |
$Apache::lonrelrequtils::checkcrstypes{$crstype}).'</h4>'; |
} |
} |
my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps, |
my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps, |
%byresponsetype,%bysubmission,%fromblocks); |
%byresponsetype,%bysubmission,%fromblocks,%bycrsrestype); |
@scopeorder = ('all','section/group','user'); |
@scopeorder = ('all','section/group','user'); |
my $now = time; |
my $now = time; |
my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom); |
my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom); |
if (ref($resourcedata) eq 'HASH') { |
if (ref($resourcedata) eq 'HASH') { |
foreach my $key (keys(%{$resourcedata})) { |
foreach my $key (keys(%{$resourcedata})) { |
|
my %found; |
foreach my $item (keys(%Apache::lonrelrequtils::checkparms)) { |
foreach my $item (keys(%Apache::lonrelrequtils::checkparms)) { |
if ($key =~ /(\Q$item\E)$/) { |
if ($key =~ /(\Q$item\E)$/) { |
if (ref($Apache::lonrelrequtils::checkparms{$item}) eq 'ARRAY') { |
if (ref($Apache::lonrelrequtils::checkparms{$item}) eq 'ARRAY') { |
my $value = $resourcedata->{$key}; |
my $value = $resourcedata->{$key}; |
if ($item eq 'examcode') { |
if ($item eq 'examcode') { |
if (&Apache::lonnet::validCODE($value)) { |
if (&Apache::lonnet::validCODE($value)) { |
$value = 'valid'; |
$value = 'valid'; |
} else { |
} else { |
$value = ''; |
$value = ''; |
} |
} |
} elsif ($item eq 'printstartdate') { |
} elsif ($item eq 'printstartdate') { |
if ($value =~ /^\d+$/) { |
if ($value =~ /^\d+$/) { |
if ($value > $now) { |
if ($value > $now) { |
$value = 'future'; |
$value = 'future'; |
} |
} |
} |
} |
} elsif ($item eq 'printenddate') { |
} elsif ($item eq 'printenddate') { |
if ($value =~ /^\d+$/) { |
if ($value =~ /^\d+$/) { |
if ($value < $now) { |
if ($value < $now) { |
$value = 'past'; |
$value = 'past'; |
} |
} |
} |
} |
|
} |
} |
if (grep(/^\Q$value\E$/,@{$Apache::lonrelrequtils::checkparms{$item}})) { |
my ($middle,$scope,$which,$level,$map,$resource); |
my $stdtype = &Apache::lonparmset::standard_parameter_types($item); |
if (grep(/^\Q$value\E$/,@{$Apache::lonrelrequtils::checkparms{$item}})) { |
$found{$item}{'valname'} = &get_param_description($stdtype,$value); |
my $stdtype = &Apache::lonparmset::standard_parameter_types($item); |
$found{$item}{'rev'} = $Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value.'::'}; |
my $stdname = &Apache::lonparmset::standard_parameter_names($item); |
} |
my $valname = &get_param_description($stdtype,$value); |
} |
my $rev = $Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value}; |
} |
my $start = $cid.'.'; |
} |
if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) { |
foreach my $item (keys(%Apache::lonrelrequtils::checkparmvalsmatch)) { |
$middle = $1; |
if (ref($Apache::lonrelrequtils::checkparmvalsmatch{$item}) eq 'ARRAY') { |
$which = $2; |
my $value = $resourcedata->{$key}; |
$scope = 'user'; |
foreach my $valuematch (@{$Apache::lonrelrequtils::checkparmvalsmatch{$item}}) { |
} elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) { |
if ($value =~ /$valuematch/) { |
$middle = $1; |
my $stdtype = &Apache::lonparmset::standard_parameter_types($item); |
$which = $2; |
$found{$item}{'valname'} = &get_param_description($stdtype,$value,1); |
$scope = 'section/group'; |
$found{$item}{'rev'} = |
} else { |
$Apache::lonnet::needsrelease{'parameter:'.$item.'::'.$valuematch.':'}; |
$scope = 'all'; |
last; |
} |
} |
my $what="$stdname=$valname"; |
} |
if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) { |
} |
$level = 'general'; |
} |
if ($scope eq 'all') { |
foreach my $item (keys(%Apache::lonrelrequtils::checkparmnamesmatch)) { |
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
my $regexp; |
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) { |
if ($item eq 'maplevelrecurse') { |
push(@{$fromparam{$rev}{$scope}},$what); |
$regexp = '\.(?:sequence|page)___\(rec\)\.'; |
} |
} |
} else { |
if ($regexp ne '') { |
push(@{$fromparam{$rev}{$scope}},$what); |
if ($key =~ /$regexp.*\.(\w+)$/) { |
} |
my $name = $1; |
} else { |
my $value = $resourcedata->{$key}; |
if (ref($fromparam{$rev}{$scope}{$which}) eq 'ARRAY') { |
if ($name eq 'type') { |
unless (grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}{$which}})) { |
last unless (($value eq 'problem') || ($value eq 'practice') || ($value eq 'exam') || |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
($value eq 'survey') || ($value eq 'surveycred') || ($value eq 'anonsurvey') || |
} |
($value eq 'anonsurveycred') || ($value eq 'randomizetry') || ($value eq 'library')); |
} else { |
} |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
my $stdtype = &Apache::lonparmset::standard_parameter_types($name); |
} |
$found{$name}{'valname'} = &get_param_description($stdtype,$value); |
} |
$found{$name}{'extra'} = &mt('Recursive into sub-folders'); |
$rowspan{$rev} ++; |
$found{$name}{'rev'} = |
} elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) { |
$Apache::lonnet::needsrelease{'parameter::::'.$item}; |
$level = 'folder'; |
} |
$map = $1; |
} |
if ($scope eq 'all') { |
} |
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') { |
foreach my $item (keys(%found)) { |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) { |
my $stdname = &Apache::lonparmset::standard_parameter_names($item); |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
my $rev = $found{$item}{'rev'}; |
} |
my $valname = $found{$item}{'valname'}; |
} else { |
my $extra = $found{$item}{'extra'}; |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
my ($middle,$scope,$which,$level,$map,$resource); |
} |
my $start = $cid.'.'; |
} else { |
if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) { |
if (ref($bymap{$map}{$rev}{$scope}{$which}) eq 'ARRAY') { |
$middle = $1; |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}{$which}})) { |
$which = $2; |
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
$scope = 'user'; |
} |
} elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) { |
} else { |
$middle = $1; |
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
$which = $2; |
} |
$scope = 'section/group'; |
} |
} else { |
} elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) { |
$scope = 'all'; |
$level = 'resource'; |
} |
$resource = $1; |
my $what="$stdname=$valname"; |
if ($scope eq 'all') { |
if ($extra) { |
if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') { |
$what .= "<br/>$extra<br />"; |
unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) { |
} |
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) { |
} |
$level = 'general'; |
} else { |
if ($scope eq 'all') { |
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
} |
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) { |
} else { |
push(@{$fromparam{$rev}{$scope}},$what); |
if (ref($byresource{$resource}{$rev}{$scope}{$which}) eq 'ARRAY') { |
} |
unless (grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}{$which}})) { |
} else { |
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
push(@{$fromparam{$rev}{$scope}},$what); |
} |
} |
} else { |
} else { |
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
if (ref($fromparam{$rev}{$scope}{$which}) eq 'ARRAY') { |
} |
unless (grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}{$which}})) { |
} |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
} |
} |
|
} else { |
|
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
|
} |
|
} |
|
$rowspan{$rev} ++; |
|
} elsif ($key =~ /^\Q$start$middle\E(.+)___\((all|rec)\).\w+\.\Q$item\E$/) { |
|
$level = 'folder'; |
|
$map = $1; |
|
if ($scope eq 'all') { |
|
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') { |
|
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) { |
|
push(@{$bymap{$map}{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
push(@{$bymap{$map}{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
if (ref($bymap{$map}{$rev}{$scope}{$which}) eq 'ARRAY') { |
|
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}{$which}})) { |
|
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
|
} |
|
} else { |
|
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
|
} |
|
} |
|
} elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) { |
|
$level = 'resource'; |
|
$resource = $1; |
|
if ($scope eq 'all') { |
|
if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') { |
|
unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) { |
|
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
if (ref($byresource{$resource}{$rev}{$scope}{$which}) eq 'ARRAY') { |
|
unless (grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}{$which}})) { |
|
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
|
} |
|
} else { |
|
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
} |
} |
} |
} |
} |
} |
Line 2787 sub display_loncaparev_constraints {
|
Line 2833 sub display_loncaparev_constraints {
|
if (ref($fromblocks{$type}) eq 'HASH') { |
if (ref($fromblocks{$type}) eq 'HASH') { |
foreach my $rev (keys(%{$fromblocks{$type}})) { |
foreach my $rev (keys(%{$fromblocks{$type}})) { |
my ($major,$minor) = split(/\./,$rev); |
my ($major,$minor) = split(/\./,$rev); |
($reqdmajor,$reqdminor) = |
($reqdmajor,$reqdminor) = |
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor); |
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor); |
$output .= &Apache::loncommon::start_data_table_row(). |
$output .= &Apache::loncommon::start_data_table_row(). |
'<td>'.$rev.'</td><td>'.$lt{$type}.'</td><td>'; |
'<td>'.$rev.'</td><td>'.$lt{$type}.'</td><td>'; |
Line 2805 sub display_loncaparev_constraints {
|
Line 2851 sub display_loncaparev_constraints {
|
|
|
if (defined($navmap)) { |
if (defined($navmap)) { |
my %anonsubms=&Apache::lonnet::dump('nohist_anonsurveys',$cdom,$cnum); |
my %anonsubms=&Apache::lonnet::dump('nohist_anonsurveys',$cdom,$cnum); |
my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey'}; |
my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey::'}; |
my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum); |
my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum); |
my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry'}; |
my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry::'}; |
|
my $rev_exttool=$Apache::lonnet::needsrelease{'course:courserestype:exttool'}; |
my $stdtype=&Apache::lonparmset::standard_parameter_types('type'); |
my $stdtype=&Apache::lonparmset::standard_parameter_types('type'); |
my $stdname=&Apache::lonparmset::standard_parameter_names('type'); |
my $stdname=&Apache::lonparmset::standard_parameter_names('type'); |
my $valanon=&get_param_description($stdtype,'anonsurvey'); |
my $valanon=&get_param_description($stdtype,'anonsurvey'); |
my $valrandtry=&get_param_description($stdtype,'randomizetry'); |
my $valrandtry=&get_param_description($stdtype,'randomizetry'); |
my %checkedrev; |
my %checkedrev; |
foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) { |
foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() || $_[0]->is_tool() },1,0)) { |
my @parts = @{$res->parts()}; |
my @parts = @{$res->parts()}; |
my $symb = $res->symb(); |
my $symb = $res->symb(); |
my $enclosing_map = &Apache::lonnet::declutter($res->enclosing_map_src()); |
my $enclosing_map = &Apache::lonnet::declutter($res->enclosing_map_src()); |
|
if ($res->is_tool()) { |
|
my $rev = $rev_exttool; |
|
$bycrsrestype{$symb}{$rev} = &mt('External Tool'); |
|
$allmaps{$enclosing_map} = 1; |
|
next; |
|
} |
foreach my $part (@parts) { |
foreach my $part (@parts) { |
if (exists($anonsubms{$symb."\0".$part})) { |
if (exists($anonsubms{$symb."\0".$part})) { |
my $rev = $rev_anonsurv; |
my $rev = $rev_anonsurv; |
Line 2867 sub display_loncaparev_constraints {
|
Line 2920 sub display_loncaparev_constraints {
|
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor, |
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor, |
$reqdmajor,$reqdminor); |
$reqdmajor,$reqdminor); |
$checkedrev{$key} = 1; |
$checkedrev{$key} = 1; |
} |
} |
push(@{$byresponsetype{$symb}{$rev}},$key); |
push(@{$byresponsetype{$symb}{$rev}},$key); |
$allmaps{$enclosing_map} = 1; |
$allmaps{$enclosing_map} = 1; |
} |
} |
Line 2920 sub display_loncaparev_constraints {
|
Line 2973 sub display_loncaparev_constraints {
|
$r->print($output); |
$r->print($output); |
if (defined($navmap)) { |
if (defined($navmap)) { |
&show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission, |
&show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission, |
\%byresponsetype,\@scopeorder,\%lt); |
\%byresponsetype,\%bycrsrestype,\@scopeorder,\%lt); |
} |
} |
$r->print('<br /><br />'); |
$r->print('<br /><br />'); |
} else { |
} else { |
Line 2938 sub display_loncaparev_constraints {
|
Line 2991 sub display_loncaparev_constraints {
|
|
|
sub show_contents_view { |
sub show_contents_view { |
my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype, |
my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype, |
$scopeorder,$lt) = @_; |
$bycrsrestype,$scopeorder,$lt) = @_; |
if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) || |
if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) || |
(keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) { |
(keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0) || |
|
(keys(%{$bycrsrestype}) > 0)) { |
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons"); |
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons"); |
my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />'; |
my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />'; |
my $icon = '<img src="'.$location.'/navmap.folder.open.gif" alt="" />'; |
my $icon = '<img src="'.$location.'/navmap.folder.open.gif" alt="" />'; |
Line 3004 sub show_contents_view {
|
Line 3058 sub show_contents_view {
|
if (ref($byresponsetype->{$symb}) eq 'HASH') { |
if (ref($byresponsetype->{$symb}) eq 'HASH') { |
$rowspan += scalar(keys(%{$byresponsetype->{$symb}})); |
$rowspan += scalar(keys(%{$byresponsetype->{$symb}})); |
} |
} |
|
if (ref($bycrsrestype->{$symb}) eq 'HASH') { |
|
$rowspan += scalar(keys(%{$bycrsrestype->{$symb}})); |
|
} |
next if (!$rowspan); |
next if (!$rowspan); |
$icon = '<img class="LC_contentImage" src="'.$location.'/problem.gif" alt="'. |
$icon = '<img class="LC_contentImage" src="'.$location.'/problem.gif" alt="'. |
&mt('Problem').'" />'; |
&mt('Problem').'" />'; |
Line 3068 sub show_contents_view {
|
Line 3125 sub show_contents_view {
|
$r->print('</td>'); |
$r->print('</td>'); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
$newrow = 1; |
|
} |
|
if (ref($bycrsrestype->{$symb}) eq 'HASH') { |
|
foreach my $rev (sort(keys(%{$bycrsrestype->{$symb}}))) { |
|
if ($newrow) { |
|
$r->print(&Apache::loncommon::continue_data_table_row()); |
|
} |
|
$r->print('<td>'.$rev.'</td><td>'.$bycrsrestype->{$symb}{$rev}.'</td>'); |
|
} |
} |
} |
} |
} |
} |
} |
Line 3080 sub show_contents_view {
|
Line 3146 sub show_contents_view {
|
sub releases_by_map { |
sub releases_by_map { |
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
my $newrow = 0; |
my $newrow = 0; |
if (ref($bymap->{$url}) eq 'HASH') { |
if (ref($bymap->{$url}) eq 'HASH') { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
if ($newrow) { |
if ($newrow) { |
Line 3117 sub releases_by_map {
|
Line 3183 sub releases_by_map {
|
} |
} |
|
|
sub get_param_description { |
sub get_param_description { |
my ($stdtype,$value) = @_; |
my ($stdtype,$value,$regexp) = @_; |
my $name = $value; |
my ($name,$parammatches,$paramstrings,@possibles); |
my $paramstrings = &Apache::lonparmset::standard_string_options($stdtype); |
if ($stdtype =~ /^string/) { |
unless (ref($paramstrings) eq 'ARRAY') { |
$paramstrings = &Apache::lonparmset::standard_string_options($stdtype); |
return $name; |
} elsif ($stdtype eq 'date_interval') { |
|
$paramstrings = &Apache::lonparmset::standard_interval_options($stdtype); |
|
} |
|
if ($regexp) { |
|
if ($stdtype =~ /^string/) { |
|
$parammatches = &Apache::lonparmset::standard_string_matches($stdtype); |
|
} elsif ($stdtype eq 'date_interval') { |
|
$parammatches = &Apache::lonparmset::standard_interval_matches($stdtype); |
|
} |
|
if (ref($parammatches) eq 'ARRAY') { |
|
@possibles = @{$parammatches}; |
|
} else { |
|
undef($regexp); |
|
$name = $value; |
|
} |
} |
} |
foreach my $possibilities (@{$paramstrings}) { |
unless ($regexp) { |
|
$name = $value; |
|
if (ref($paramstrings) eq 'ARRAY') { |
|
@possibles = @{$paramstrings}; |
|
} else { |
|
if (($stdtype eq 'date_start') || ($stdtype eq 'date_end')) { |
|
if ($name == 0) { |
|
$name = &mt('Never'); |
|
} elsif (($name ne '') && ($name !~ /\D/)) { |
|
$name = &Apache::lonlocal::locallocaltime($name); |
|
} |
|
} |
|
return $name; |
|
} |
|
} |
|
foreach my $possibilities (@possibles) { |
next unless (ref($possibilities) eq 'ARRAY'); |
next unless (ref($possibilities) eq 'ARRAY'); |
my ($thing, $description) = @{ $possibilities }; |
my $gotregexmatch = ''; |
if ($thing eq $value) { |
if ($regexp) { |
$name = $description; |
last if ($gotregexmatch); |
last; |
my ($item,$pattern) = @{ $possibilities }; |
|
if ($value =~ /$pattern/) { |
|
if (ref($paramstrings) eq 'ARRAY') { |
|
foreach my $possibles (@{$paramstrings}) { |
|
next unless (ref($possibles) eq 'ARRAY'); |
|
my ($thing,$description) = @{$possibles}; |
|
if ($thing eq $item) { |
|
$name = $description; |
|
$gotregexmatch = 1; |
|
last; |
|
} |
|
} |
|
last if ($gotregexmatch); |
|
} |
|
} |
|
} else { |
|
my ($thing,$description) = @{ $possibilities }; |
|
if ($thing eq $value) { |
|
$name = $description; |
|
last; |
|
} |
} |
} |
} |
} |
return $name; |
return $name; |
Line 3272 sub manage_coownership {
|
Line 3387 sub manage_coownership {
|
} |
} |
$output .= '<span class="LC_nobreak">'; |
$output .= '<span class="LC_nobreak">'; |
if ($is_coowner) { |
if ($is_coowner) { |
$output .= &mt('You are currently a co-owner:').' <label><input type="checkbox" name="remove_coowner" value="'.$uname.':'.$udom.'" />'.&mt('Discontinue?').'</label>'; |
$output .= &mt('You are currently a co-owner:').' <label><input type="checkbox" name="remove_coowoner" value="'.$uname.':'.$udom.'" />'.&mt('Discontinue?').'</label>'; |
} else { |
} else { |
$output .= &mt('The course owner has invited you to become a co-owner:').' <label><input type="radio" name="pending_coowner" value="accept"'.$disabled.' />'.&mt('Accept?').'</label>'.(' 'x2). |
$output .= &mt('The course owner has invited you to become a co-owner:').' <label><input type="radio" name="pending_coowoner" value="accept"'.$disabled.' />'.&mt('Accept?').'</label>'.(' 'x2). |
'<label><input type="radio" name=pending_coowner" value="decline"'.$disabled.' />'.&mt('Decline?').'</label>'; |
'<label><input type="radio" name=pending_coowoner" value="decline"'.$disabled.' />'.&mt('Decline?').'</label>'; |
} |
} |
$output .= '</span>'; |
$output .= '</span>'; |
if (@currcoown) { |
if (@currcoown) { |
Line 3338 sub print_localization {
|
Line 3453 sub print_localization {
|
undef,$includeempty,$disabled); |
undef,$includeempty,$disabled); |
} else { |
} else { |
if ($settings->{$item} eq '') { |
if ($settings->{$item} eq '') { |
unless ($noedit) { |
unless ($noedit) { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&Apache::loncommon::select_language('languages_0','',1); |
&Apache::loncommon::select_language('languages_0','',1); |
} |
} |
Line 3368 sub print_localization {
|
Line 3483 sub print_localization {
|
} |
} |
} |
} |
unless ($noedit) { |
unless ($noedit) { |
$datatable .= |
$datatable .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&mt('Additional language:'). '</span><br />'. |
&mt('Additional language:'). '</span><br />'. |
&Apache::loncommon::select_language('languages_'.$num,'',1). |
&Apache::loncommon::select_language('languages_'.$num,'',1). |
'<input type="hidden" name="languages_total" value="'.$num.'" />'. |
'<input type="hidden" name="languages_total" value="'.$num.'" />'. |
'</td>'.&Apache::loncommon::end_data_table_row(); |
'</td>'.&Apache::loncommon::end_data_table_row(); |
} |
} |
$datatable .= &Apache::loncommon::end_data_table().'<br />'; |
$datatable .= &Apache::loncommon::end_data_table().'<br />'; |
} |
} |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
Line 3445 sub print_feedback {
|
Line 3560 sub print_feedback {
|
} |
} |
if ($position eq 'top') { |
if ($position eq 'top') { |
my $includeempty = 0; |
my $includeempty = 0; |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,\@sections, |
&user_table($cdom,$item,\@sections, |
$settings->{$item},\%lt,$noedit); |
$settings->{$item},\%lt,$noedit); |
} else { |
} else { |
$datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', |
$datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', |
Line 3464 sub user_table {
|
Line 3579 sub user_table {
|
if ($currvalue eq '') { |
if ($currvalue eq '') { |
unless ($noedit) { |
unless ($noedit) { |
$output .= &select_recipient($item,'0',$cdom,$sections); |
$output .= &select_recipient($item,'0',$cdom,$sections); |
} |
} |
} else { |
} else { |
my $num = 0; |
my $num = 0; |
my @curr = split(/,/,$currvalue); |
my @curr = split(/,/,$currvalue); |
Line 3533 sub select_recipient {
|
Line 3648 sub select_recipient {
|
my $domform = &Apache::loncommon::select_dom_form($cdom,$item.'_udom_'.$num,$includeempty); |
my $domform = &Apache::loncommon::select_dom_form($cdom,$item.'_udom_'.$num,$includeempty); |
my $selectlink = |
my $selectlink = |
&Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num, |
&Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num, |
$item.'_udom_'.$num,'only'); |
$item.'_udom_'.$num,1); |
my $output = |
my $output = |
'<table><tr><td align="center">'.&mt('Username').'<br />'. |
'<table><tr><td align="center">'.&mt('Username').'<br />'. |
'<input type="text" name="'.$item.'_uname_'.$num.'" value="" /></td>'. |
'<input type="text" name="'.$item.'_uname_'.$num.'" value="" /></td>'. |
Line 3616 sub print_discussion {
|
Line 3731 sub print_discussion {
|
&mt('(specific user(s))'), |
&mt('(specific user(s))'), |
input => 'checkbox', |
input => 'checkbox', |
}, |
}, |
|
|
|
'pac.roles.denied' => { |
|
text => '<span class="LC_nobreak"><b>'.&mt($itemtext->{'pac.roles.denied'}).'</b>'. |
|
&Apache::loncommon::help_open_topic("Course_Disable_Anonymous_Discussion").'</span><br />'. |
|
&mt('(role-based)'), |
|
input => 'checkbox', |
|
}, |
|
|
|
'pac.users.denied' => { |
|
text => '<span class="LC_nobreak"><b>'.&mt($itemtext->{'pac.users.denied'}).'</b><br />'. |
|
&mt('(specific user(s))'), |
|
input => 'checkbox', |
|
}, |
|
|
'allow_limited_html_in_feedback' => { |
'allow_limited_html_in_feedback' => { |
text => '<b>'.&mt($itemtext->{'allow_limited_html_in_feedback'}).'</b>', |
text => '<b>'.&mt($itemtext->{'allow_limited_html_in_feedback'}).'</b>', |
input => 'radio', |
input => 'radio', |
Line 3648 sub print_discussion {
|
Line 3777 sub print_discussion {
|
my $colspan; |
my $colspan; |
if ($item eq 'allow_limited_html_in_feedback') { |
if ($item eq 'allow_limited_html_in_feedback') { |
$colspan = 2; |
$colspan = 2; |
} |
} |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
if ($item eq 'plc.roles.denied') { |
if ($item eq 'plc.roles.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit). |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit). |
'</table>'; |
'</table>'; |
} elsif ($item eq 'plc.users.denied') { |
} elsif ($item eq 'plc.users.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,undef, |
&user_table($cdom,$item,undef, |
$settings->{$item},\%lt,$noedit); |
$settings->{$item},\%lt,$noedit); |
} elsif ($item eq 'pch.roles.denied') { |
} elsif ($item eq 'pch.roles.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
Line 3666 sub print_discussion {
|
Line 3795 sub print_discussion {
|
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,undef, |
&user_table($cdom,$item,undef, |
$settings->{$item},\%lt,$noedit); |
$settings->{$item},\%lt,$noedit); |
|
} elsif ($item eq 'pac.roles.denied') { |
|
$datatable .= '</td><td align="right">'. |
|
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit). |
|
'</table>'; |
|
} elsif ($item eq 'pac.users.denied') { |
|
$datatable .= '</td><td align="right">'. |
|
&user_table($cdom,$item,undef, |
|
$settings->{$item},\%lt,$noedit); |
} elsif ($item eq 'allow_limited_html_in_feedback') { |
} elsif ($item eq 'allow_limited_html_in_feedback') { |
$datatable .= &yesno_radio($item,$settings,undef,undef,undef,$noedit); |
$datatable .= &yesno_radio($item,$settings,undef,undef,undef,$noedit); |
} elsif ($item eq 'allow_discussion_post_editing') { |
} elsif ($item eq 'allow_discussion_post_editing') { |
Line 3685 sub print_discussion {
|
Line 3822 sub print_discussion {
|
'<th align="center">'.&mt('font-size').'</th>'. |
'<th align="center">'.&mt('font-size').'</th>'. |
'<th align="center">'.&mt('font-weight').'</th>'. |
'<th align="center">'.&mt('font-weight').'</th>'. |
'<th align="center">'.&mt('font-style').'</th>'. |
'<th align="center">'.&mt('font-style').'</th>'. |
'<th align="center">'.&mt('Other css').'</th>'. |
'<th align="center">'.&mt('Other css').'</th>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&set_discussion_fonts($cdom,$cnum,$item,$settings,$noedit). |
&set_discussion_fonts($cdom,$cnum,$item,$settings,$noedit). |
&Apache::loncommon::end_data_table().'<br />'; |
&Apache::loncommon::end_data_table().'<br />'; |
Line 3737 sub role_checkboxes {
|
Line 3874 sub role_checkboxes {
|
my $count = 0; |
my $count = 0; |
my $disabled; |
my $disabled; |
if ($noedit) { |
if ($noedit) { |
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
} |
} |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $checked = ''; |
my $checked = ''; |
Line 3865 sub set_discussion_fonts {
|
Line 4002 sub set_discussion_fonts {
|
|
|
sub discussion_vote_classes { |
sub discussion_vote_classes { |
my $classorder = ['twoplus','oneplus','zero','oneminus','twominus']; |
my $classorder = ['twoplus','oneplus','zero','oneminus','twominus']; |
my %classtitles = &Apache::lonlocal::texthash( |
my %classtitles = &Apache::lonlocal::texthash( |
'twoplus' => 'Two sigma above mean', |
'twoplus' => 'Two sigma above mean', |
'oneplus' => 'One sigma above mean', |
'oneplus' => 'One sigma above mean', |
'zero' => 'Within one sigma of mean', |
'zero' => 'Within one sigma of mean', |
Line 3931 sub print_classlists {
|
Line 4068 sub print_classlists {
|
'defaultcredits' => { |
'defaultcredits' => { |
text => '<b>'.&mt($itemtext->{'defaultcredits'}).'</b>', |
text => '<b>'.&mt($itemtext->{'defaultcredits'}).'</b>', |
}, |
}, |
|
|
'nothideprivileged' => { |
'nothideprivileged' => { |
text => '<b>'.&mt($itemtext->{'nothideprivileged'}).'</b>', |
text => '<b>'.&mt($itemtext->{'nothideprivileged'}).'</b>', |
input => 'checkbox', |
input => 'checkbox', |
Line 4018 sub print_appearance {
|
Line 4155 sub print_appearance {
|
text => '<b>'.&mt($itemtext->{'usejsme'}).'</b>', |
text => '<b>'.&mt($itemtext->{'usejsme'}).'</b>', |
input => 'radio', |
input => 'radio', |
}, |
}, |
'inline_chem' => { |
|
text => '<b>'.&mt($itemtext->{'inline_chem'}).'</b>', |
|
input => 'radio', |
|
}, |
|
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit); |
} |
} |
Line 4038 sub print_grading {
|
Line 4171 sub print_grading {
|
input => 'selectbox', |
input => 'selectbox', |
options => { |
options => { |
standard => &mt('Standard: shows points'), |
standard => &mt('Standard: shows points'), |
|
categories => &mt('Categories: shows points according to categories'), |
external => &mt('External: shows number of completed parts and totals'), |
external => &mt('External: shows number of completed parts and totals'), |
externalnototals => &mt('External: shows only number of completed parts'), |
externalnototals => &mt('External: shows only number of completed parts'), |
spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'), |
spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'), |
}, |
}, |
order => ['standard','external','externalnototals','spreadsheet'], |
order => ['standard','categories','external','externalnototals','spreadsheet'], |
}, |
}, |
'rndseed' => { |
'rndseed' => { |
text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'. |
text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'. |
Line 4234 sub print_other {
|
Line 4368 sub print_other {
|
input => 'textbox', |
input => 'textbox', |
size => '30', |
size => '30', |
}; |
}; |
return &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'other',$noedit); |
my $output = &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'other',$noedit); |
} |
} |
|
|
sub get_other_items { |
sub get_other_items { |
Line 4404 sub make_item_rows {
|
Line 4538 sub make_item_rows {
|
$settings->{$item},$disabled); |
$settings->{$item},$disabled); |
} elsif ($items->{$item}{input} eq 'radio') { |
} elsif ($items->{$item}{input} eq 'radio') { |
my ($unsetdefault,$valueyes,$valueno); |
my ($unsetdefault,$valueyes,$valueno); |
if (($item eq 'usejsme') || ($item eq 'uselcmath') || ($item eq 'inline_chem')) { |
if (($item eq 'usejsme') || ($item eq 'uselcmath')) { |
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
unless ($domdefs{$item} eq '0') { |
unless ($domdefs{$item} eq '0') { |
$unsetdefault = 1; |
$unsetdefault = 1; |
Line 4454 sub nothidepriv_row {
|
Line 4588 sub nothidepriv_row {
|
} |
} |
} |
} |
if ($settings->{'checkforpriv'}) { |
if ($settings->{'checkforpriv'}) { |
@checkdoms = split(/,/,$settings->{'checkforpriv'}); |
@checkdoms = split(/,/,$settings->{'checkforpriv'}); |
} |
} |
} |
} |
push(@checkdoms,$cdom); |
push(@checkdoms,$cdom); |
Line 4468 sub nothidepriv_row {
|
Line 4602 sub nothidepriv_row {
|
if ($end == -1 || $start == -1) { |
if ($end == -1 || $start == -1) { |
next; |
next; |
} |
} |
foreach my $dom (@checkdoms) { |
foreach my $dom (@checkdoms) { |
if (&Apache::lonnet::privileged($uname,$udom,\@checkdoms,['dc','su'])) { |
if (&Apache::lonnet::privileged($uname,$udom,\@checkdoms,['dc','su'])) { |
unless (grep(/^\Q$user\E$/,@privusers)) { |
unless (grep(/^\Q$user\E$/,@privusers)) { |
push(@privusers,$user); |
push(@privusers,$user); |
Line 4544 sub checkforpriv_row {
|
Line 4678 sub checkforpriv_row {
|
my $domdesc = &Apache::lonnet::domain($currdom,'description'); |
my $domdesc = &Apache::lonnet::domain($currdom,'description'); |
if ($domdesc eq '') { |
if ($domdesc eq '') { |
$domdesc = $currdom; |
$domdesc = $currdom; |
} |
} |
$datatable .= |
$datatable .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
Line 4556 sub checkforpriv_row {
|
Line 4690 sub checkforpriv_row {
|
&mt('Delete').'</label></span></td>'. |
&mt('Delete').'</label></span></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
unless (grep(/^\Q$currdom\E$/,@excdoms)) { |
unless (grep(/^\Q$currdom\E$/,@excdoms)) { |
push(@excdoms,$currdom); |
push(@excdoms,$currdom); |
} |
} |
} |
} |
} |
} |
if ((scalar(keys(%domains)) - scalar(@excdoms)) > 0) { |
if ((scalar(keys(%domains)) - scalar(@excdoms)) > 0) { |
$datatable .= |
$datatable .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&mt('Additional domain:'). '</span><br />'. |
&mt('Additional domain:'). '</span><br />'. |
Line 4675 ENDJS
|
Line 4809 ENDJS
|
$output .= '</tr>'; |
$output .= '</tr>'; |
} |
} |
} |
} |
my $pos = $currnum+1; |
my $pos = $currnum+1; |
unless ($noedit) { |
unless ($noedit) { |
$output .= |
$output .= |
'<tr>'. |
'<tr>'. |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |