version 1.49.2.18, 2015/05/22 16:39:43
|
version 1.75, 2016/02/20 00:12:39
|
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 382 sub handler {
|
Line 382 sub handler {
|
'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'}, |
Line 493 sub handler {
|
Line 493 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 1081 sub process_changes {
|
Line 1081 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 1096 sub process_changes {
|
Line 1096 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 1105 sub process_changes {
|
Line 1105 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 1180 sub process_changes {
|
Line 1180 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 1196 sub process_changes {
|
Line 1196 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 1741 sub get_jscript {
|
Line 1741 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 1843 function syllabusinfo() {
|
Line 1843 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 2099 sub print_courseinfo {
|
Line 2099 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 2274 sub print_courseinfo {
|
Line 2274 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 2326 sub print_courseinfo {
|
Line 2326 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 2356 sub new_cloners_dom_row {
|
Line 2356 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 2430 sub assign_course_categories {
|
Line 2430 sub assign_course_categories {
|
} else { |
} else { |
$alert = &mt("Use 'Save' in the main window to save course categories"); |
$alert = &mt("Use 'Save' in the main window to save course categories"); |
} |
} |
|
&js_escape(\$alert); |
$catwin_js = <<ENDSCRIPT; |
$catwin_js = <<ENDSCRIPT; |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
|
Line 2506 ENDSCRIPT
|
Line 2507 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 2529 sub display_loncaparev_constraints {
|
Line 2530 sub display_loncaparev_constraints {
|
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::checkparmsmatch)) { |
$middle = $1; |
if (ref($Apache::lonrelrequtils::checkparmsmatch{$item}) eq 'ARRAY') { |
$which = $2; |
my $value = $resourcedata->{$key}; |
$scope = 'user'; |
foreach my $valuematch (@{$Apache::lonrelrequtils::checkparmsmatch{$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(%found)) { |
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
my $stdname = &Apache::lonparmset::standard_parameter_names($item); |
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) { |
my $rev = $found{$item}{'rev'}; |
push(@{$fromparam{$rev}{$scope}},$what); |
my $valname = $found{$item}{'valname'}; |
} |
my ($middle,$scope,$which,$level,$map,$resource); |
} else { |
my $start = $cid.'.'; |
push(@{$fromparam{$rev}{$scope}},$what); |
if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) { |
} |
$middle = $1; |
} else { |
$which = $2; |
if (ref($fromparam{$rev}{$scope}{$which}) eq 'ARRAY') { |
$scope = 'user'; |
unless (grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}{$which}})) { |
} elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) { |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
$middle = $1; |
} |
$which = $2; |
} else { |
$scope = 'section/group'; |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
} else { |
} |
$scope = 'all'; |
} |
} |
$rowspan{$rev} ++; |
my $what="$stdname=$valname"; |
} elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) { |
if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) { |
$level = 'folder'; |
$level = 'general'; |
$map = $1; |
if ($scope eq 'all') { |
if ($scope eq 'all') { |
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') { |
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) { |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) { |
push(@{$fromparam{$rev}{$scope}},$what); |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
} |
} |
} else { |
} else { |
push(@{$fromparam{$rev}{$scope}},$what); |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
} |
} |
} else { |
} else { |
if (ref($fromparam{$rev}{$scope}{$which}) eq 'ARRAY') { |
if (ref($bymap{$map}{$rev}{$scope}{$which}) eq 'ARRAY') { |
unless (grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}{$which}})) { |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}{$which}})) { |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
} |
} |
} else { |
} else { |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
} |
} |
} |
} |
$rowspan{$rev} ++; |
} elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) { |
} elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) { |
$level = 'resource'; |
$level = 'folder'; |
$resource = $1; |
$map = $1; |
if ($scope eq 'all') { |
if ($scope eq 'all') { |
if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') { |
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') { |
unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) { |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) { |
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
} |
} |
} else { |
} else { |
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
} |
} |
} else { |
} else { |
if (ref($byresource{$resource}{$rev}{$scope}{$which}) eq 'ARRAY') { |
if (ref($bymap{$map}{$rev}{$scope}{$which}) eq 'ARRAY') { |
unless (grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}{$which}})) { |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}{$which}})) { |
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
} |
} |
} else { |
} else { |
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
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 2684 sub display_loncaparev_constraints {
|
Line 2703 sub display_loncaparev_constraints {
|
if (keys(%comm_blocks) > 0) { |
if (keys(%comm_blocks) > 0) { |
foreach my $block (keys(%comm_blocks)) { |
foreach my $block (keys(%comm_blocks)) { |
if ($block =~ /^firstaccess____(.+)$/) { |
if ($block =~ /^firstaccess____(.+)$/) { |
my $rev = $Apache::lonnet::needsrelease{'course:commblock:timer'}; |
my $rev = $Apache::lonnet::needsrelease{'course:commblock:timer:'}; |
if (ref($comm_blocks{$block}) eq 'HASH') { |
if (ref($comm_blocks{$block}) eq 'HASH') { |
push(@{$fromblocks{'timer'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
push(@{$fromblocks{'timer'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
' '.&mt('set by [_1]', |
' '.&mt('set by [_1]', |
Line 2699 sub display_loncaparev_constraints {
|
Line 2718 sub display_loncaparev_constraints {
|
if (ref($comm_blocks{$block}{'blocks'}) eq 'HASH') { |
if (ref($comm_blocks{$block}{'blocks'}) eq 'HASH') { |
if (ref($comm_blocks{$block}{'blocks'}{'docs'}) eq 'HASH') { |
if (ref($comm_blocks{$block}{'blocks'}{'docs'}) eq 'HASH') { |
if (keys(%{$comm_blocks{$block}{'blocks'}{'docs'}}) > 0) { |
if (keys(%{$comm_blocks{$block}{'blocks'}{'docs'}}) > 0) { |
my $rev = $Apache::lonnet::needsrelease{'course:commblock:docs'}; |
my $rev = $Apache::lonnet::needsrelease{'course:commblock:docs:'}; |
push(@{$fromblocks{'docs'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
push(@{$fromblocks{'docs'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
' '. |
' '. |
&mt('set by [_1]', |
&mt('set by [_1]', |
&Apache::loncommon::plainname(split(/:/,$comm_blocks{$block}{'setter'})))); |
&Apache::loncommon::plainname(split(/:/,$comm_blocks{$block}{'setter'})))); |
} |
} |
} elsif ($comm_blocks{$block}{'blocks'}{'printout'} eq 'on') { |
} elsif ($comm_blocks{$block}{'blocks'}{'printout'} eq 'on') { |
my $rev = $Apache::lonnet::needsrelease{'course:commblock:printout'}; |
my $rev = $Apache::lonnet::needsrelease{'course:commblock:printout:'}; |
push(@{$fromblocks{'printout'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
push(@{$fromblocks{'printout'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
' '. |
' '. |
&mt('set by [_1]', |
&mt('set by [_1]', |
Line 2732 sub display_loncaparev_constraints {
|
Line 2751 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 2750 sub display_loncaparev_constraints {
|
Line 2769 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 $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'); |
Line 2812 sub display_loncaparev_constraints {
|
Line 2831 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 3025 sub show_contents_view {
|
Line 3044 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; |
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) { |
|
$r->print(&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::continue_data_table_row()); |
|
} |
$r->print('<td valign="middle">'.$rev.'</td><td>'); |
$r->print('<td valign="middle">'.$rev.'</td><td>'); |
if (ref($bymap->{$url}{$rev}) eq 'HASH') { |
if (ref($bymap->{$url}{$rev}) eq 'HASH') { |
$r->print('<table border="0">'); |
$r->print('<table border="0">'); |
Line 3048 sub releases_by_map {
|
Line 3072 sub releases_by_map {
|
$r->print('</table>'); |
$r->print('</table>'); |
} |
} |
$r->print('</td>'); |
$r->print('</td>'); |
|
$newrow = 1; |
} |
} |
} else { |
} else { |
$r->print('<td colspan="2"> </td>'); |
$r->print('<td colspan="2"> </td>'); |
Line 3056 sub releases_by_map {
|
Line 3081 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 { |
|
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 3239 sub print_localization {
|
Line 3306 sub print_localization {
|
$count ++; |
$count ++; |
my $colspan; |
my $colspan; |
unless ($item eq 'languages') { |
unless ($item eq 'languages') { |
$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 'timezone') { |
if ($item eq 'timezone') { |
Line 3359 sub print_feedback {
|
Line 3426 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); |
$settings->{$item},\%lt); |
} else { |
} else { |
$datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', |
$datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', |
Line 3549 sub print_discussion {
|
Line 3616 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). |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings). |
'</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); |
$settings->{$item},\%lt); |
} elsif ($item eq 'pch.roles.denied') { |
} elsif ($item eq 'pch.roles.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
Line 3586 sub print_discussion {
|
Line 3653 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). |
&set_discussion_fonts($cdom,$cnum,$item,$settings). |
&Apache::loncommon::end_data_table().'<br />'; |
&Apache::loncommon::end_data_table().'<br />'; |
Line 3758 sub set_discussion_fonts {
|
Line 3825 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 3824 sub print_classlists {
|
Line 3891 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 3892 sub print_appearance {
|
Line 3959 sub print_appearance {
|
input => 'selectbox', |
input => 'selectbox', |
options => { |
options => { |
MathJax => 'MathJax', |
MathJax => 'MathJax', |
jsMath => 'jsMath', |
|
mimetex => &mt('Convert to Images'), |
mimetex => &mt('Convert to Images'), |
tth => &mt('TeX to HTML'), |
tth => &mt('TeX to HTML'), |
}, |
}, |
order => ['MathJax','jsMath','mimetex','tth'], |
order => ['MathJax','mimetex','tth'], |
nullval => $mathdef, |
nullval => $mathdef, |
}, |
}, |
'tthoptions' => { |
'tthoptions' => { |
Line 3928 sub print_grading {
|
Line 3994 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 4326 sub nothidepriv_row {
|
Line 4393 sub nothidepriv_row {
|
} |
} |
} |
} |
if ($settings->{'checkforpriv'}) { |
if ($settings->{'checkforpriv'}) { |
@checkdoms = split(/,/,$settings->{'checkforpriv'}); |
@checkdoms = split(/,/,$settings->{'checkforpriv'}); |
} |
} |
} |
} |
push(@checkdoms,$cdom); |
push(@checkdoms,$cdom); |
Line 4340 sub nothidepriv_row {
|
Line 4407 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 4407 sub checkforpriv_row {
|
Line 4474 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 4419 sub checkforpriv_row {
|
Line 4486 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 />'. |