version 1.522.2.28.4.10, 2023/07/06 19:24:31
|
version 1.531, 2013/04/08 23:21:15
|
Line 36 lonparmset - Handler to set parameters f
|
Line 36 lonparmset - Handler to set parameters f
|
|
|
=head1 SYNOPSIS |
=head1 SYNOPSIS |
|
|
lonparmset provides an interface to setting content parameters in a |
lonparmset provides an interface to setting course parameters. |
course. |
|
|
|
=head1 DESCRIPTION |
=head1 DESCRIPTION |
|
|
Line 47 This module sets coursewide and assessme
|
Line 46 This module sets coursewide and assessme
|
|
|
=over |
=over |
|
|
|
=pod |
|
|
=item parmval() |
=item parmval() |
|
|
Figure out a cascading parameter. |
Figure out a cascading parameter. |
Line 130 javascript function 'pjump'.
|
Line 131 javascript function 'pjump'.
|
|
|
=item print_td() |
=item print_td() |
|
|
=item check_other_groups() |
=item print_usergroups() |
|
|
=item parm_control_group() |
=item parm_control_group() |
|
|
Line 138 javascript function 'pjump'.
|
Line 139 javascript function 'pjump'.
|
|
|
extractResourceInformation extracts lots of information about all of the the course's resources into a variety of hashes. |
extractResourceInformation extracts lots of information about all of the the course's resources into a variety of hashes. |
|
|
Input: See list below |
Input: See list below: |
|
|
=over 4 |
|
|
|
=item * B<env{'user.name'}> : Current username |
=item * B<env{'user.name'}> : Current username |
|
|
=item * B<env{'user.domain'}> : Domain of current user. |
=item * B<env{'user.domain'}> : Domain of current user. |
|
|
=item * B<env{"request.course.fn"}> : Course |
=item * b<env{"request.course.fn"} : Course |
|
|
=back |
|
|
|
Outputs: See list below |
|
|
|
=over 4 |
Outputs: See list below: |
|
|
=item * B<ids> (out) : An array that will contain all of the ids in the course. |
=item * B<ids> (out) : An array that will contain all of the ids in the course. |
|
|
Line 178 Outputs: See list below
|
Line 173 Outputs: See list below
|
|
|
=item * B<defkeytype> |
=item * B<defkeytype> |
|
|
=back |
|
|
|
=item isdateparm() |
=item isdateparm() |
|
|
=item parmmenu() |
=item parmmenu() |
Line 217 Returns: nothing
|
Line 210 Returns: nothing
|
|
|
Variables used (guessed by Jeremy): |
Variables used (guessed by Jeremy): |
|
|
=over |
|
|
|
=item * B<pscat>: ParameterS CATegories? ends up a list of the types of parameters that exist, e.g., tol, weight, acc, opendate, duedate, answerdate, sig, maxtries, type. |
=item * B<pscat>: ParameterS CATegories? ends up a list of the types of parameters that exist, e.g., tol, weight, acc, opendate, duedate, answerdate, sig, maxtries, type. |
|
|
=item * B<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? |
=item * B<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? |
Line 231 Variables used (guessed by Jeremy):
|
Line 222 Variables used (guessed by Jeremy):
|
When storing information, store as part 0 |
When storing information, store as part 0 |
When requesting information, request from full part |
When requesting information, request from full part |
|
|
=back |
|
|
|
=item tablestart() |
=item tablestart() |
|
|
=item tableend() |
=item tableend() |
Line 299 Set portfolio metadata
|
Line 288 Set portfolio metadata
|
|
|
Main handler. Calls &assessparms subroutine. |
Main handler. Calls &assessparms subroutine. |
|
|
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 324 use HTML::Entities;
|
Line 314 use HTML::Entities;
|
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
|
|
sub startSettingsScreen { |
|
my ($r,$mode,$crstype)=@_; |
|
|
|
my $tabtext = &mt('Course Settings'); |
|
if ($crstype eq 'Community') { |
|
$tabtext = &mt('Community Settings'); |
|
} |
|
$r->print("\n".'<ul class="LC_TabContentBigger" id="main">'); |
|
$r->print("\n".'<li'.($mode eq 'coursepref'?' class="active"':'').'><a href="/adm/courseprefs"><b> '. |
|
$tabtext. |
|
' </b></a></li>'); |
|
|
|
$r->print("\n".'<li'.($mode eq 'parmset'?' class="active"':'').' id="tabbededitor"><a href="/adm/parmset"><b>'. |
|
&mt('Content and Problem Settings').'</b></a></li>'); |
|
$r->print("\n".'</ul>'."\n"); |
|
$r->print('<div class="LC_Box" style="clear:both;margin:0;" id="parameditor"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">'); |
|
} |
|
|
|
sub endSettingsScreen { |
|
my ($r)=@_; |
|
$r->print('</div></div></div>'); |
|
} |
|
|
|
|
|
|
sub parmval { |
sub parmval { |
my ($what,$id,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; |
my ($what,$id,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; |
return &parmval_by_symb($what,&symbcache($id),$def,$uname,$udom,$csec, |
return &parmval_by_symb($what,&symbcache($id),$def,$uname,$udom,$csec, |
Line 761 sub valout {
|
Line 776 sub valout {
|
$result = |
$result = |
'<img src="/res/adm/pages/editmap.png"' |
'<img src="/res/adm/pages/editmap.png"' |
.' alt="'.&mt('Change').'"' |
.' alt="'.&mt('Change').'"' |
.' title="'.&mt('Change').'" style="border:0;" />'; |
.' title="'.&mt('Change').'" />'; |
} else { |
} else { |
$result=' '; |
$result=' '; |
} |
} |
} else { |
} else { |
if ($type eq 'date_interval') { |
if ($type eq 'date_interval') { |
my ($totalsecs,$donesuffix) = split(/_/,$value,2); |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
my ($usesdone,$donebuttontext,$proctor,$secretkey); |
|
if ($donesuffix =~ /^done\:([^\:]+)\:(.*)$/) { |
|
$donebuttontext = $1; |
|
(undef,$proctor,$secretkey) = split(/_/,$2); |
|
$usesdone = 'done'; |
|
} elsif ($donesuffix =~ /^done(|_.+)$/) { |
|
$donebuttontext = &mt('Done'); |
|
($usesdone,$proctor,$secretkey) = split(/_/,$donesuffix); |
|
} |
|
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($totalsecs); |
|
my @timer; |
my @timer; |
$year=$year-70; |
$year=$year-70; |
$mday--; |
$mday--; |
Line 810 sub valout {
|
Line 815 sub valout {
|
push(@timer,&mt('[quant,_1,sec]',0)); |
push(@timer,&mt('[quant,_1,sec]',0)); |
} |
} |
$result.=join(", ",@timer); |
$result.=join(", ",@timer); |
if ($usesdone eq 'done') { |
|
if ($secretkey) { |
|
$result .= ' '.&mt('+ "[_1]" with proctor key: [_2]',$donebuttontext,$secretkey); |
|
} else { |
|
$result .= ' + "'.$donebuttontext.'"'; |
|
} |
|
} |
|
} elsif (&isdateparm($type)) { |
} elsif (&isdateparm($type)) { |
$result = &Apache::lonlocal::locallocaltime($value). |
$result = &Apache::lonlocal::locallocaltime($value). |
&date_sanity_info($value); |
&date_sanity_info($value); |
Line 831 sub valout {
|
Line 829 sub valout {
|
|
|
|
|
sub plink { |
sub plink { |
my ($type,$dis,$value,$marker,$return,$call,$extra)=@_; |
my ($type,$dis,$value,$marker,$return,$call)=@_; |
my $winvalue=$value; |
my $winvalue=$value; |
unless ($winvalue) { |
unless ($winvalue) { |
if ((&isdateparm($type)) || (&is_specialstring($type))) { |
if (&isdateparm($type)) { |
$winvalue=$env{'form.recent_'.$type}; |
$winvalue=$env{'form.recent_'.$type}; |
} elsif ($type eq 'string_yesno') { |
|
if ($env{'form.recent_string'} =~ /^(yes|no)$/i) { |
|
$winvalue=$env{'form.recent_string'}; |
|
} |
|
} else { |
} else { |
$winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]}; |
$winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]}; |
} |
} |
Line 850 sub plink {
|
Line 844 sub plink {
|
my $valout = &valout($value,$type,1); |
my $valout = &valout($value,$type,1); |
my $unencmarker = $marker; |
my $unencmarker = $marker; |
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, |
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, |
\$hour, \$min, \$sec, \$extra) { |
\$hour, \$min, \$sec) { |
$$item = &HTML::Entities::encode($$item,'"<>&'); |
$$item = &HTML::Entities::encode($$item,'"<>&'); |
$$item =~ s/\'/\\\'/g; |
$$item =~ s/\'/\\\'/g; |
} |
} |
return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$unencmarker.'" /></td></tr><tr><td align="center">'. |
return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$unencmarker.'" /></td></tr><tr><td align="center">'. |
'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','" |
'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','" |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."','".$extra."'".');">'. |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
$valout.'</a></td></tr></table>'; |
$valout.'</a></td></tr></table>'; |
} |
} |
|
|
Line 872 sub page_js {
|
Line 866 sub page_js {
|
$pjump_def |
$pjump_def |
|
|
function psub() { |
function psub() { |
var specstring = /^string_!(yesno|any)/i; |
|
if (document.parmform.pres_marker.value!='') { |
if (document.parmform.pres_marker.value!='') { |
document.parmform.action+='#'+document.parmform.pres_marker.value; |
document.parmform.action+='#'+document.parmform.pres_marker.value; |
var typedef=new Array(); |
var typedef=new Array(); |
typedef=document.parmform.pres_type.value.split('_'); |
typedef=document.parmform.pres_type.value.split('_'); |
if (document.parmform.pres_type.value!='') { |
if (document.parmform.pres_type.value!='') { |
if ((typedef[0]=='date') || |
if (typedef[0]=='date') { |
(specstring.test(document.parmform.pres_type.value))) { |
eval('document.parmform.recent_'+ |
eval('document.parmform.recent_'+ |
document.parmform.pres_type.value+ |
document.parmform.pres_type.value+ |
'.value=document.parmform.pres_value.value;'); |
'.value=document.parmform.pres_value.value;'); |
} else { |
} else { |
eval('document.parmform.recent_'+typedef[0]+ |
eval('document.parmform.recent_'+typedef[0]+ |
'.value=document.parmform.pres_value.value;'); |
'.value=document.parmform.pres_value.value;'); |
|
} |
|
} |
} |
|
} |
document.parmform.submit(); |
document.parmform.submit(); |
} else { |
} else { |
document.parmform.pres_value.value=''; |
document.parmform.pres_value.value=''; |
Line 902 sub page_js {
|
Line 894 sub page_js {
|
var newWin = window.open(url, wdwName, options); |
var newWin = window.open(url, wdwName, options); |
newWin.focus(); |
newWin.focus(); |
} |
} |
|
|
// ]]> |
// ]]> |
|
|
</script> |
</script> |
$selscript |
$selscript |
ENDJS |
ENDJS |
Line 929 function showHide_courseContent() {
|
Line 923 function showHide_courseContent() {
|
COURSECONTENTSCRIPT |
COURSECONTENTSCRIPT |
} |
} |
|
|
sub validateparms_js { |
|
return <<'ENDSCRIPT'; |
|
|
|
function validateParms() { |
|
var textRegExp = /^settext_/; |
|
var ipRegExp = /^setip/; |
|
var ipallowRegExp = /^setipallow_/; |
|
var ipdenyRegExp = /^setipdeny_/; |
|
var deeplinkRegExp = /^deeplink_/; |
|
var dlListScopeRegExp = /^deeplink_(state|others|listing|scope)_/; |
|
var dlLinkProtectRegExp = /^deeplink_protect_/; |
|
var dlLtidRegExp = /^deeplink_ltid_/; |
|
var dlLticRegExp = /^deeplink_ltic_/; |
|
var dlKeyRegExp = /^deeplink_key_/; |
|
var dlMenusRegExp = /^deeplink_menus_/; |
|
var dlCollsRegExp = /^deeplink_colls_/; |
|
var dlTargetRegExp = /^deeplink_target_/; |
|
var dlExitRegExp = /^deeplink_exit_/; |
|
var dlExitTextRegExp = /^deeplink_exittext_/; |
|
var patternIP = /[\[\]\*\.a-zA-Z\d\-]+/; |
|
var numelements = document.parmform.elements.length; |
|
if ((typeof(numelements) != 'undefined') && (numelements != null)) { |
|
if (numelements) { |
|
for (i=0; i<numelements; i++) { |
|
var name=document.parmform.elements[i].name; |
|
if (ipRegExp.test(name)) { |
|
if (ipallowRegExp.test(name)) { |
|
var identifier = name.replace(ipallowRegExp,''); |
|
var possallow = document.parmform.elements[i].value; |
|
possallow = possallow.replace(/^\s+|\s+$/g,''); |
|
if (patternIP.test(possallow)) { |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
possallow = ','+possallow; |
|
} |
|
document.parmform.elements['set_'+identifier].value += possallow; |
|
} |
|
} else if (ipdenyRegExp.test(name)) { |
|
var identifier = name.replace(ipdenyRegExp,''); |
|
var possdeny = document.parmform.elements[i].value; |
|
possdeny = possdeny.replace(/^\s+|\s+$/g,''); |
|
if (patternIP.test(possdeny)) { |
|
possdeny = '!'+possdeny; |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
possdeny = ','+possdeny; |
|
} |
|
document.parmform.elements['set_'+identifier].value += possdeny; |
|
} |
|
} |
|
} else if (deeplinkRegExp.test(name)) { |
|
if (dlListScopeRegExp.test(name)) { |
|
var identifier = name.replace(dlListScopeRegExp,''); |
|
var idx = document.parmform.elements[i].selectedIndex; |
|
if (idx > 0) { |
|
var possdeeplink = document.parmform.elements[i].options[idx].value |
|
possdeeplink = possdeeplink.replace(/^\s+|\s+$/g,''); |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
possdeeplink = ','+possdeeplink; |
|
} |
|
document.parmform.elements['set_'+identifier].value += possdeeplink; |
|
} |
|
} else if (dlLinkProtectRegExp.test(name)) { |
|
if (document.parmform.elements[i].checked) { |
|
var identifier = name.replace(dlLinkProtectRegExp,''); |
|
var posslinkurl = document.parmform.elements[i].value; |
|
posslinkurl = posslinkurl.replace(/^\s+|\s+$/g,''); |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
posslinkurl = ','+posslinkurl; |
|
} |
|
document.parmform.elements['set_'+identifier].value += posslinkurl; |
|
} |
|
} else if (dlLtidRegExp.test(name)) { |
|
var identifier = name.replace(dlLtidRegExp,''); |
|
if (isRadioSet('deeplink_protect_'+identifier,'ltid')) { |
|
var possltid = document.parmform.elements[i].value; |
|
possltid = possltid.replace(/\D+/g,''); |
|
if (possltid.length) { |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
possltid = ':'+possltid; |
|
} |
|
document.parmform.elements['set_'+identifier].value += possltid; |
|
} else { |
|
document.parmform.elements['set_'+identifier].value = ''; |
|
alert("A link type of 'domain LTI launch' was selected but no domain LTI launcher was selected.\nPlease select one, or choose a different supported link type."); |
|
return false; |
|
} |
|
} |
|
} else if (dlLticRegExp.test(name)) { |
|
var identifier = name.replace(dlLticRegExp,''); |
|
if (isRadioSet('deeplink_protect_'+identifier,'ltic')) { |
|
var possltic = document.parmform.elements[i].value; |
|
possltic = possltic.replace(/\D+/g,''); |
|
if (possltic.length) { |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
possltic = ':'+possltic; |
|
} |
|
document.parmform.elements['set_'+identifier].value += possltic; |
|
} else { |
|
document.parmform.elements['set_'+identifier].value = ''; |
|
alert("A link type of 'course LTI launch' was selected but no course LTI launcher was selected.\nPlease select one, or choose a different supported link type."); |
|
return false; |
|
} |
|
} |
|
} else if (dlKeyRegExp.test(name)) { |
|
var identifier = name.replace(dlKeyRegExp,''); |
|
if (isRadioSet('deeplink_protect_'+identifier,'key')) { |
|
var posskey = document.parmform.elements[i].value; |
|
posskey = posskey.replace(/^\s+|\s+$/g,''); |
|
var origlength = posskey.length; |
|
posskey = posskey.replace(/[^a-zA-Z\d_.!@#$%^&*()+=-]/g,''); |
|
var newlength = posskey.length; |
|
if (newlength > 0) { |
|
var change = origlength - newlength; |
|
if (change) { |
|
alert(change+' disallowed character(s) removed from deeplink key'); |
|
} |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
posskey = ':'+posskey; |
|
} |
|
document.parmform.elements['set_'+identifier].value += posskey; |
|
} else { |
|
document.parmform.elements['set_'+identifier].value = ''; |
|
if (newlength < origlength) { |
|
alert("A link type of 'deep with key' was selected but the key value was blank, after removing disallowed characters.\nPlease enter a key using one or more of: a-zA-Z0-9_.!@#$%^&*()+=-"); |
|
} else { |
|
alert("A link type of 'deep with key' was selected but the key value was blank.\nPlease enter a key."); |
|
} |
|
return false; |
|
} |
|
} |
|
} else if (dlMenusRegExp.test(name)) { |
|
if (document.parmform.elements[i].checked) { |
|
var identifier = name.replace(dlMenusRegExp,''); |
|
var posslinkmenu = document.parmform.elements[i].value; |
|
posslinkmenu = posslinkmenu.replace(/^\s+|\s+$/g,''); |
|
if (posslinkmenu == 'std') { |
|
posslinkmenu = '0'; |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
posslinkmenu = ','+posslinkmenu; |
|
} |
|
document.parmform.elements['set_'+identifier].value += posslinkmenu; |
|
} |
|
} |
|
} else if (dlCollsRegExp.test(name)) { |
|
var identifier = name.replace(dlCollsRegExp,''); |
|
if (isRadioSet('deeplink_menus_'+identifier,'colls')) { |
|
var posslinkmenu = document.parmform.elements[i].value; |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
posslinkmenu = ','+posslinkmenu; |
|
} |
|
document.parmform.elements['set_'+identifier].value += posslinkmenu; |
|
} |
|
} else if (dlTargetRegExp.test(name)) { |
|
var identifier = name.replace(dlTargetRegExp,''); |
|
var idx = document.parmform.elements[i].selectedIndex; |
|
if (idx > 0) { |
|
var linktarget = document.parmform.elements[i].options[idx].value |
|
linktarget = linktarget.replace(/^\s+|\s+$/g,''); |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
linktarget = ','+linktarget; |
|
} |
|
document.parmform.elements['set_'+identifier].value += linktarget; |
|
} |
|
} else if (dlExitRegExp.test(name)) { |
|
if (document.parmform.elements[i].checked) { |
|
var identifier = name.replace(dlExitRegExp,''); |
|
var posslinkexit = document.parmform.elements[i].value; |
|
posslinkexit = posslinkexit.replace(/^\s+|\s+$/g,''); |
|
if (document.parmform.elements['set_'+identifier].value) { |
|
posslinkexit = ','+posslinkexit; |
|
} |
|
document.parmform.elements['set_'+identifier].value += posslinkexit; |
|
} |
|
} else if (dlExitTextRegExp.test(name)) { |
|
var identifier = name.replace(dlExitTextRegExp,''); |
|
if ((isRadioSet('deeplink_exit_'+identifier,'yes')) || |
|
(isRadioSet('deeplink_exit_'+identifier,'url'))) { |
|
var posstext = document.parmform.elements[i].value; |
|
posstext = posstext.replace(/^\s+|\s+$/g,''); |
|
var origlength = posstext.length; |
|
posstext = posstext.replace(/[:;'",]/g,''); |
|
var newlength = posstext.length; |
|
if (newlength > 0) { |
|
var change = origlength - newlength; |
|
if (change) { |
|
alert(change+' disallowed character(s) removed from Exit Button text'); |
|
} |
|
if (posstext !== 'Exit Tool') { |
|
posstext = ':'+posstext; |
|
document.parmform.elements['set_'+identifier].value += posstext; |
|
} |
|
} else { |
|
document.parmform.elements['set_'+identifier].value = ''; |
|
if (newlength < origlength) { |
|
alert("An exit link type of 'In use' was selected but the button text value was blank, after removing disallowed characters.\nDisallowed characters are ,\":;'"); |
|
} else { |
|
alert("An exit link type of 'In use' was selected but the button text value was blank.\nPlease enter the text to use."); |
|
} |
|
return false; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return true; |
|
} |
|
|
|
function isRadioSet(name,expected) { |
|
var menuitems = document.getElementsByName(name); |
|
var radioLength = menuitems.length; |
|
result = false; |
|
if (radioLength > 1) { |
|
for (var j=0; j<radioLength; j++) { |
|
if (menuitems[j].checked) { |
|
if (menuitems[j].value == expected) { |
|
result = true; |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
return result; |
|
} |
|
|
|
ENDSCRIPT |
|
} |
|
|
|
# Javascript initialization, for overview mode |
|
sub ipacc_boxes_js { |
|
my $remove = &mt('Remove'); |
|
return <<"END"; |
|
\$(document).ready(function() { |
|
var wrapper = \$(".LC_string_ipacc_wrap"); |
|
var add_button = \$(".LC_add_ipacc_button"); |
|
var ipaccRegExp = /^LC_string_ipacc_/; |
|
|
|
\$(add_button).click(function(e){ |
|
e.preventDefault(); |
|
var identifier = \$(this).closest("div").attr("id"); |
|
identifier = identifier.replace(ipaccRegExp,''); |
|
\$(this).closest('div').find('.LC_string_ipacc_inner').append('<div><input type="text" name="setip'+identifier+'" /><a href="#" class="LC_remove_ipacc">$remove</a></div>'); |
|
}); |
|
|
|
\$(wrapper).delegate(".LC_remove_ipacc","click", function(e){ |
|
e.preventDefault(); \$(this).closest("div").remove(); |
|
}) |
|
}); |
|
|
|
|
|
END |
|
} |
|
|
|
sub done_proctor_js { |
|
my $defaultdone = &mt('Done'); |
|
&js_escape(\$defaultdone); |
|
return <<"END"; |
|
function toggleSecret(form,radio,key) { |
|
var radios = form[radio+key]; |
|
if (radios.length) { |
|
for (var i=0; i<radios.length; i++) { |
|
if (radios[i].checked) { |
|
if (radios[i].value == '_done_proctor') { |
|
if (document.getElementById('done_'+key+'_proctorkey')) { |
|
document.getElementById('done_'+key+'_proctorkey').type='text'; |
|
} |
|
} else { |
|
if (document.getElementById('done_'+key+'_proctorkey')) { |
|
document.getElementById('done_'+key+'_proctorkey').type='hidden'; |
|
document.getElementById('done_'+key+'_proctorkey').value=''; |
|
} |
|
} |
|
if (document.getElementById('done_'+key+'_buttontext')) { |
|
if (radios[i].value == '') { |
|
document.getElementById('done_'+key+'_buttontext').value = ''; |
|
} else { |
|
if (document.getElementById('done_'+key+'_buttontext').value == '') { |
|
document.getElementById('done_'+key+'_buttontext').value = '$defaultdone'; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
END |
|
|
|
} |
|
|
|
# Javascript function toggle |
|
sub deeplink_js { |
|
return <<"END"; |
|
function toggleDeepLink(form,item,key) { |
|
var radios = form['deeplink_'+item+'_'+key]; |
|
if (radios.length) { |
|
var keybox; |
|
if (document.getElementById('deeplink_key_'+item+'_'+key)) { |
|
keybox = document.getElementById('deeplink_key_'+item+'_'+key); |
|
} |
|
var divoptions = new Array(); |
|
if (item == 'protect') { |
|
divoptions = ['ltic','ltid']; |
|
} else { |
|
if (item == 'menus') { |
|
divoptions = ['colls']; |
|
} |
|
} |
|
var seldivs = new Array(); |
|
if ((item == 'protect') || (item == 'menus')) { |
|
for (var i=0; i<divoptions.length; i++) { |
|
if (document.getElementById('deeplinkdiv_'+divoptions[i]+'_'+item+'_'+key)) { |
|
seldivs[i] = document.getElementById('deeplinkdiv_'+divoptions[i]+'_'+item+'_'+key); |
|
} else { |
|
seldivs[i] = ''; |
|
} |
|
} |
|
} |
|
for (var i=0; i<radios.length; i++) { |
|
if (radios[i].checked) { |
|
if ((item == 'protect') || (item == 'menus')) { |
|
for (var j=0; j<seldivs.length; j++) { |
|
if (radios[i].value == divoptions[j]) { |
|
if (seldivs[j] != '') { |
|
seldivs[j].style.display = 'inline-block'; |
|
} |
|
if (item == 'protect') { |
|
keybox.type = 'hidden'; |
|
keybox.value = ''; |
|
} |
|
} else { |
|
if (seldivs[j] != '') { |
|
seldivs[j].style.display = 'none'; |
|
form['deeplink_'+divoptions[j]+'_'+key].selectedIndex = 0; |
|
} |
|
} |
|
} |
|
if (item == 'protect') { |
|
if (radios[i].value == 'key') { |
|
keybox.type = 'text'; |
|
} else { |
|
keybox.type = 'hidden'; |
|
} |
|
} |
|
} else if (item == 'exit') { |
|
if (document.getElementById('deeplinkdiv_'+item+'_'+key)) { |
|
if (radios[i].value == 'no') { |
|
document.getElementById('deeplinkdiv_'+item+'_'+key).style.display = 'none'; |
|
if (document.getElementById('deeplink_exittext_'+key)) { |
|
if (document.getElementById('deeplink_exittext_'+key).value != '') { |
|
document.getElementById('deeplink_exittext_'+key).value = ''; |
|
} |
|
} |
|
} else { |
|
document.getElementById('deeplinkdiv_'+item+'_'+key).style.display = 'inline-block'; |
|
if (document.getElementById('deeplink_exittext_'+key)) { |
|
if (document.getElementById('deeplink_exittext_'+key).value == '') { |
|
document.getElementById('deeplink_exittext_'+key).value = 'Exit Tool'; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
END |
|
|
|
} |
|
|
|
sub startpage { |
sub startpage { |
my ($r,$psymb) = @_; |
my ($r,$psymb,$crstype) = @_; |
|
|
my %loaditems = ( |
my %loaditems = ( |
'onload' => "group_or_section('cgroup')", |
'onload' => "group_or_section('cgroup')", |
Line 1327 sub startpage {
|
Line 951 sub startpage {
|
</script> |
</script> |
'; |
'; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Set/Modify Course Parameters',$js, |
&Apache::loncommon::start_page('Set/Modify Course Parameters',$js, |
{'add_entries' => \%loaditems,}); |
{'add_entries' => \%loaditems,}); |
my $breadcrumbs = |
my $breadcrumbs = |
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); |
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); |
my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'}); |
my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'}); |
my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'}); |
my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'}); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<form method="post" action="/adm/parmset?action=settable" name="parmform"> |
<form method="post" action="/adm/parmset?action=settable" name="parmform"> |
<input type="hidden" value="" name="pres_value" /> |
<input type="hidden" value="" name="pres_value" /> |
Line 1348 ENDHEAD
|
Line 973 ENDHEAD
|
|
|
sub print_row { |
sub print_row { |
my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone, |
my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone, |
$defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups,$noeditgrp, |
$defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups)=@_; |
$readonly)=@_; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
Line 1388 sub print_row {
|
Line 1012 sub print_row {
|
my $thismarker=$which; |
my $thismarker=$which; |
$thismarker=~s/^parameter\_//; |
$thismarker=~s/^parameter\_//; |
my $mprefix=$rid.'&'.$thismarker.'&'; |
my $mprefix=$rid.'&'.$thismarker.'&'; |
my ($parmname)=($thismarker=~/\_([^\_]+)$/); |
|
my $effective_parm = &valout($outpar[$result],$typeoutpar[$result]); |
my $effective_parm = &valout($outpar[$result],$typeoutpar[$result]); |
my ($othergrp,$grp_parm,$controlgrp,$extra); |
my ($othergrp,$grp_parm,$controlgrp); |
|
|
if ($parmname eq 'deeplink') { |
|
my ($domltistr,$crsltistr); |
|
my %lti = |
|
&Apache::lonnet::get_domain_lti($env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
'linkprot'); |
|
if (keys(%lti)) { |
|
foreach my $item (sort { $a <=> $b } (keys(%lti))) { |
|
if (($item =~ /^\d+$/) && (ref($lti{$item}) eq 'HASH')) { |
|
$domltistr .= $item.':'.&escape(&escape($lti{$item}{'name'})).','; |
|
} |
|
} |
|
$domltistr =~ s/,$//; |
|
if ($domltistr) { |
|
$extra = 'ltid_'.$domltistr; |
|
} |
|
} |
|
my %courselti = &Apache::lonnet::get_course_lti($cnum,$cdom,'provider'); |
|
if (keys(%courselti)) { |
|
foreach my $item (sort { $a <=> $b } keys(%courselti)) { |
|
if (($item =~ /^\d+$/) && (ref($courselti{$item}) eq 'HASH')) { |
|
$crsltistr .= $item.':'.&escape(&escape($courselti{$item}{'name'})).','; |
|
} |
|
} |
|
$crsltistr =~ s/,$//; |
|
if ($crsltistr) { |
|
if ($extra) { |
|
$extra .= '&'; |
|
} |
|
$extra .= 'ltic_'.$crsltistr; |
|
} |
|
} |
|
if ($env{'course.'.$env{'request.course.id'}.'.menucollections'}) { |
|
my @colls; |
|
foreach my $item (split(/;/,$env{'course.'.$env{'request.course.id'}.'.menucollections'})) { |
|
my ($num,$value) = split(/\%/,$item); |
|
if ($num =~ /^\d+$/) { |
|
push(@colls,$num); |
|
} |
|
} |
|
if (@colls) { |
|
if ($extra) { |
|
$extra .= '&'; |
|
} |
|
$extra .= 'menus_'.join(',',@colls); |
|
} |
|
} |
|
} |
|
if ($parmlev eq 'general') { |
if ($parmlev eq 'general') { |
|
|
if ($uname) { |
if ($uname) { |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($cgroup) { |
} elsif ($cgroup) { |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly,$extra); |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($csec) { |
} elsif ($csec) { |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} else { |
} else { |
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
} elsif ($parmlev eq 'map') { |
} elsif ($parmlev eq 'map') { |
|
|
if ($uname) { |
if ($uname) { |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($cgroup) { |
} elsif ($cgroup) { |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly,$extra); |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($csec) { |
} elsif ($csec) { |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} else { |
} else { |
&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
} else { |
} else { |
if ($uname) { |
if ($uname) { |
if (@{$usersgroups} > 1) { |
if (@{$usersgroups} > 1) { |
my ($coursereply,$grp_parm,$controlgrp); |
my ($coursereply,$grp_parm,$controlgrp); |
($coursereply,$othergrp,$grp_parm,$controlgrp) = |
($coursereply,$othergrp,$grp_parm,$controlgrp) = |
&check_other_groups($$part{$which}.'.'.$$name{$which}, |
&print_usergroups($r,$$part{$which}.'.'.$$name{$which}, |
$rid,$cgroup,$defbgone,$usersgroups,$result,$courseopt); |
$rid,$cgroup,$defbgone,$usersgroups,$result,$courseopt); |
if ($coursereply && $result > 3) { |
if ($coursereply && $result > 3) { |
if (defined($controlgrp)) { |
if (defined($controlgrp)) { |
Line 1479 sub print_row {
|
Line 1055 sub print_row {
|
} |
} |
} |
} |
|
|
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
|
|
&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
|
|
if ($csec) { |
if ($csec) { |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
|
|
if ($cgroup) { |
if ($cgroup) { |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly,$extra); |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly,$extra); |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly,$extra); |
&print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
|
|
if ($uname) { |
if ($uname) { |
if ($othergrp) { |
if ($othergrp) { |
$r->print($othergrp); |
$r->print($othergrp); |
} |
} |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly,$extra); |
&print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
|
|
} # end of $parmlev if/else |
} # end of $parmlev if/else |
Line 1524 sub print_row {
|
Line 1100 sub print_row {
|
} |
} |
|
|
sub print_td { |
sub print_td { |
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display,$noeditgrp,$readonly,$extra)=@_; |
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; |
$r->print('<td style="background-color:'.(($result==$which)?'#AAFFAA':$defbg). |
$r->print('<td style="background-color:'.(($result==$which)?'#AAFFAA':$defbg). |
';" align="center">'); |
';" align="center">'); |
my $nolink = 0; |
my $nolink = 0; |
if ($readonly) { |
if ($which == 11 || $which == 12) { |
$nolink = 1; |
$nolink = 1; |
} else { |
} elsif ($mprefix =~ /availablestudent\&$/) { |
if ($which == 11 || $which == 12) { |
if ($which > 3) { |
$nolink = 1; |
|
} elsif (($env{'request.course.sec'} ne '') && ($which > 9)) { |
|
$nolink = 1; |
|
} elsif ($which == 4 || $which == 5 || $which == 6) { |
|
if ($noeditgrp) { |
|
$nolink = 1; |
|
} |
|
} elsif ($mprefix =~ /availablestudent\&$/) { |
|
$nolink = 1; |
$nolink = 1; |
} elsif ($mprefix =~ /examcode\&$/) { |
|
unless ($which == 2) { |
|
$nolink = 1; |
|
} |
|
} |
} |
} |
} |
if ($nolink) { |
if ($nolink) { |
Line 1552 sub print_td {
|
Line 1116 sub print_td {
|
} else { |
} else { |
$r->print(&plink($$typeoutpar[$which], |
$r->print(&plink($$typeoutpar[$which], |
$$display{$value},$$outpar[$which], |
$$display{$value},$$outpar[$which], |
$mprefix."$which",'parmform.pres','psub',$extra)); |
$mprefix."$which",'parmform.pres','psub')); |
} |
} |
$r->print('</td>'."\n"); |
$r->print('</td>'."\n"); |
} |
} |
|
|
sub check_other_groups { |
sub print_usergroups { |
my ($what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_; |
my ($r,$what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_; |
my $courseid = $env{'request.course.id'}; |
my $courseid = $env{'request.course.id'}; |
my $output; |
my $output; |
my $symb = &symbcache($rid); |
my $symb = &symbcache($rid); |
Line 1573 sub check_other_groups {
|
Line 1137 sub check_other_groups {
|
if (($coursereply) && ($cgroup ne $resultgroup)) { |
if (($coursereply) && ($cgroup ne $resultgroup)) { |
if ($result > 3) { |
if ($result > 3) { |
$bgcolor = '#AAFFAA'; |
$bgcolor = '#AAFFAA'; |
|
$grp_parm = &valout($coursereply,$resulttype); |
} |
} |
$grp_parm = &valout($coursereply,$resulttype); |
$grp_parm = &valout($coursereply,$resulttype); |
$output = '<td style="background-color:'.$bgcolor.';" align="center">'; |
$output = '<td style="background-color:'.$bgcolor.';" align="center">'; |
Line 1640 sub extractResourceInformation {
|
Line 1205 sub extractResourceInformation {
|
my $srcf=$resource->src(); |
my $srcf=$resource->src(); |
$srcf=~/\.(\w+)$/; |
$srcf=~/\.(\w+)$/; |
$$typep{$id}=$1; |
$$typep{$id}=$1; |
my $toolsymb; |
|
if ($srcf =~ /ext\.tool$/) { |
|
$toolsymb = $resource->symb(); |
|
} |
|
$$keyp{$id}=''; |
$$keyp{$id}=''; |
$$uris{$id}=$srcf; |
$$uris{$id}=$srcf; |
|
|
foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys',$toolsymb))) { |
foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { |
next if ($key!~/^parameter_/); |
next if ($key!~/^parameter_/); |
|
|
# Hidden parameters |
# Hidden parameters |
next if (&Apache::lonnet::metadata($srcf,$key.'.hidden',$toolsymb) eq 'parm'); |
next if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm'); |
# |
# |
# allparms is a hash of parameter names |
# allparms is a hash of parameter names |
# |
# |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name',$toolsymb); |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { |
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { |
my ($display,$parmdis); |
my ($display,$parmdis); |
$display = &standard_parameter_names($name); |
$display = &standard_parameter_names($name); |
if ($display eq '') { |
if ($display eq '') { |
$display= &Apache::lonnet::metadata($srcf,$key.'.display',$toolsymb); |
$display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
$parmdis = $display; |
$parmdis = $display; |
$parmdis =~ s/\s*\[Part.*$//g; |
$parmdis =~ s/\s*\[Part.*$//g; |
} else { |
} else { |
Line 1669 sub extractResourceInformation {
|
Line 1230 sub extractResourceInformation {
|
$$allparms{$name}=$parmdis; |
$$allparms{$name}=$parmdis; |
if (ref($defkeytype)) { |
if (ref($defkeytype)) { |
$$defkeytype{$name}= |
$$defkeytype{$name}= |
&Apache::lonnet::metadata($srcf,$key.'.type',$toolsymb); |
&Apache::lonnet::metadata($srcf,$key.'.type'); |
} |
} |
} |
} |
|
|
# |
# |
# allparts is a hash of all parts |
# allparts is a hash of all parts |
# |
# |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part',$toolsymb); |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
$$allparts{$part} = &mt('Part: [_1]',$part); |
$$allparts{$part} = &mt('Part: [_1]',$part); |
# |
# |
# Remember all keys going with this resource |
# Remember all keys going with this resource |
Line 1702 sub extractResourceInformation {
|
Line 1263 sub extractResourceInformation {
|
$$mapp{$mapid}=$$mapp{$id}; |
$$mapp{$mapid}=$$mapp{$id}; |
$$allmaps{$mapid}=$$mapp{$id}; |
$$allmaps{$mapid}=$$mapp{$id}; |
if ($mapid eq '1') { |
if ($mapid eq '1') { |
$$maptitles{$mapid}=&mt('Main Content'); |
$$maptitles{$mapid}=&mt('Main Course Documents'); |
} else { |
} else { |
$$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id}); |
$$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id}); |
} |
} |
Line 1722 sub isdateparm {
|
Line 1283 sub isdateparm {
|
return (($type=~/^date/) && (!($type eq 'date_interval'))); |
return (($type=~/^date/) && (!($type eq 'date_interval'))); |
} |
} |
|
|
# Determine if parameter type is specialized string type (i.e., |
|
# not just string or string_yesno. |
|
|
|
sub is_specialstring { |
|
my $type=shift; |
|
return (($type=~/^string_/) && ($type ne 'string_yesno')); |
|
} |
|
|
|
# |
# |
# parmmenu displays a list of the selected parameters. |
# parmmenu displays a list of the selected parameters. |
# It also offers a link to show/hide the complete parameter list |
# It also offers a link to show/hide the complete parameter list |
# from which you can select all desired parameters. |
# from which you can select all desired parameters. |
# |
# |
sub parmmenu { |
sub parmmenu { |
my ($r)=@_; |
my ($r,$allparms,$pscat,$keyorder)=@_; |
|
my $tempkey; |
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 1815 sub parmmenu {
|
Line 1369 sub parmmenu {
|
ENDSCRIPT |
ENDSCRIPT |
|
|
$r->print('<hr />'); |
$r->print('<hr />'); |
&shortCuts($r); |
&shortCuts($r,$allparms,$pscat,$keyorder); |
$r->print('<hr />'); |
$r->print('<hr />'); |
} |
} |
# return a hash |
# return a hash |
Line 1843 sub lookUpTableParameter {
|
Line 1397 sub lookUpTableParameter {
|
'contentopen' => 'time_settings', |
'contentopen' => 'time_settings', |
'contentclose' => 'time_settings', |
'contentclose' => 'time_settings', |
'discussend' => 'time_settings', |
'discussend' => 'time_settings', |
'printstartdate' => 'time_settings', |
'printopendate' => 'time_settings', |
'printenddate' => 'time_settings', |
'printclosedate' => 'time_settings', |
'weight' => 'grading', |
'weight' => 'grading', |
'handgrade' => 'grading', |
'handgrade' => 'grading', |
'maxtries' => 'tries', |
'maxtries' => 'tries', |
Line 1864 sub lookUpTableParameter {
|
Line 1418 sub lookUpTableParameter {
|
'buttonshide' => 'hiding', |
'buttonshide' => 'hiding', |
'turnoffeditor' => 'hiding', |
'turnoffeditor' => 'hiding', |
'encrypturl' => 'hiding', |
'encrypturl' => 'hiding', |
'deeplink' => 'hiding', |
|
'randomorder' => 'high_level_randomization', |
'randomorder' => 'high_level_randomization', |
'randompick' => 'high_level_randomization', |
'randompick' => 'high_level_randomization', |
'available' => 'slots', |
'available' => 'slots', |
Line 1880 sub lookUpTableParameter {
|
Line 1433 sub lookUpTableParameter {
|
'lenient' => 'grading', |
'lenient' => 'grading', |
'retrypartial' => 'tries', |
'retrypartial' => 'tries', |
'discussvote' => 'misc', |
'discussvote' => 'misc', |
'examcode' => 'high_level_randomization', |
|
); |
); |
} |
} |
|
|
sub whatIsMyCategory { |
sub whatIsMyCategory { |
Line 1957 sub parmboxes {
|
Line 1510 sub parmboxes {
|
|
|
#Print parameters |
#Print parameters |
for my $key (sort { $category_order{$a} <=> $category_order{$b} } keys %categoryList) { |
for my $key (sort { $category_order{$a} <=> $category_order{$b} } keys %categoryList) { |
next if(@{$categoryList{$key}} == 0); |
if(@{$categoryList{$key}} == 0) { |
$r->print('<div class="LC_Box LC_400Box">' |
next; |
.'<h4 class="LC_hcell">' |
} else { |
.&mt($categories{$key}) |
$r->print('<div class="LC_Box LC_400Box">' |
.'</h4>'."\n"); |
.'<h4 class="LC_hcell">' |
foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { |
.&mt($categories{$key}) |
next if ($tempkey eq ''); |
.'</h4>'."\n"); |
$r->print('<span class="LC_nobreak">' |
foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { |
.'<label><input type="checkbox" name="pscat" ' |
$r->print('<span class="LC_nobreak">' |
.'value="'.$tempkey.'" '); |
.'<label><input type="checkbox" name="pscat" '); |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
$r->print('value="'.$tempkey.'" '); |
$r->print(' checked="checked"'); |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
} |
$r->print(' checked="checked"'); |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
} |
|
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
: $tempkey) |
: $tempkey) |
.'</label></span><br />'."\n"); |
.'</label></span><br />'."\n"); |
|
} |
|
$r->print("</div>\n"); |
} |
} |
$r->print("</div>\n"); |
|
} |
} |
|
|
$r->print("</div>\n"); |
$r->print("</div>\n"); |
Line 1983 sub parmboxes {
|
Line 1538 sub parmboxes {
|
# This function offers some links on the parameter section to get with one click a group a parameters |
# This function offers some links on the parameter section to get with one click a group a parameters |
# |
# |
sub shortCuts { |
sub shortCuts { |
my ($r)=@_; |
my ($r,$allparms,$pscat,$keyorder)=@_; |
|
|
# Parameter Selection |
# Parameter Selection |
$r->print( |
$r->print( |
Line 2042 sub partmenu {
|
Line 1597 sub partmenu {
|
} |
} |
|
|
sub usermenu { |
sub usermenu { |
my ($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,$usersgroups,$pssymb)=@_; |
my ($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,$usersgroups)=@_; |
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
&Apache::loncommon::selectstudent_link('parmform','uname','udom','condition'). |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
&Apache::lonhtmlcommon::scripttag(<<ENDJS); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
function setCourseadv(form,caller) { |
|
if (caller.value == 'st') { |
|
form.courseadv.value = 'none'; |
|
} else { |
|
form.courseadv.value = ''; |
|
} |
|
return; |
|
} |
|
ENDJS |
|
|
|
my (%chkroles,$stuonly,$courseadv); |
|
if ($env{'form.userroles'} eq 'any') { |
|
$chkroles{'any'} = ' checked="checked"'; |
|
} else { |
|
$chkroles{'st'} = ' checked="checked"'; |
|
$courseadv = 'none'; |
|
} |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
|
if ($crstype eq 'Community') { |
|
$stuonly = &mt('member only'); |
|
} else { |
|
$stuonly = &mt('student only'); |
|
} |
|
$chooseopt .= '<br /><span class="LC_cusr_subheading">'. |
|
&mt("User's role").': '. |
|
'<label><input type="radio" name="userroles" value="st"'.$chkroles{'st'}.' onclick="setCourseadv(this.form,this);" />'. |
|
$stuonly.'</label> '. |
|
'<label><input type="radio" name="userroles" value="any"'.$chkroles{'any'}.' onclick="setCourseadv(this.form,this);" />'. |
|
&mt('any role').'</label><input type="hidden" id="courseadv" name="courseadv" value="'.$courseadv.'" /></span>'; |
|
my $sections=''; |
my $sections=''; |
my %sectionhash = &Apache::loncommon::get_sections(); |
my %sectionhash = &Apache::loncommon::get_sections(); |
|
|
my $groups; |
my $groups; |
my %grouphash; |
my %grouphash = &Apache::longroup::coursegroups(); |
if (($pssymb) || &Apache::lonnet::allowed('mdg',$env{'request.course.id'})) { |
|
%grouphash = &Apache::longroup::coursegroups(); |
|
} elsif ($env{'request.course.groups'} ne '') { |
|
map { $grouphash{$_} = 1; } split(/:/,$env{'request.course.groups'}); |
|
} |
|
|
|
my $g_s_header=''; |
my $g_s_header=''; |
my $g_s_footer=''; |
my $g_s_footer=''; |
|
|
my $currsec = $env{'request.course.sec'}; |
if (%sectionhash) { |
if ($currsec) { |
|
$sections=&mt('Section:').' '.$currsec; |
|
if (%grouphash) { |
|
$sections .= ';'.(' ' x2); |
|
} |
|
} elsif (%sectionhash && $currsec eq '') { |
|
$sections=&mt('Section:').' <select name="csec"'; |
$sections=&mt('Section:').' <select name="csec"'; |
if (%grouphash && $parmlev ne 'full') { |
if (%grouphash && $parmlev ne 'full') { |
$sections .= qq| onchange="group_or_section('csec')" |; |
$sections .= qq| onchange="group_or_section('csec')" |; |
Line 2109 ENDJS
|
Line 1625 ENDJS
|
$sections.='</select>'; |
$sections.='</select>'; |
} |
} |
|
|
if (%sectionhash && %grouphash && $parmlev ne 'full' && $currsec eq '') { |
if (%sectionhash && %grouphash && $parmlev ne 'full') { |
$sections .= ' '.&mt('or').' '; |
$sections .= ' '.&mt('or').' '; |
$sections .= qq| |
$sections .= qq| |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 2128 function group_or_section(caller) {
|
Line 1644 function group_or_section(caller) {
|
// ]]> |
// ]]> |
</script> |
</script> |
|; |
|; |
} elsif ($currsec eq '') { |
} else { |
$sections .= qq| |
$sections .= qq| |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 2141 function group_or_section(caller) {
|
Line 1657 function group_or_section(caller) {
|
} |
} |
|
|
if (%grouphash) { |
if (%grouphash) { |
$groups=&mt('Group').': <select name="cgroup"'; |
$groups=&mt('Group:').' <select name="cgroup"'; |
if (%sectionhash && $env{'form.action'} eq 'settable' && $currsec eq '') { |
if (%sectionhash && $env{'form.action'} eq 'settable') { |
$groups .= qq| onchange="group_or_section('cgroup')" |; |
$groups .= qq| onchange="group_or_section('cgroup')" |; |
} |
} |
$groups .= '>'; |
$groups .= '>'; |
Line 2181 function group_or_section(caller) {
|
Line 1697 function group_or_section(caller) {
|
# This function shows on table Mode the available Parameters for the selected Resources |
# This function shows on table Mode the available Parameters for the selected Resources |
# |
# |
sub displaymenu { |
sub displaymenu { |
my ($r,$allparms,$pscat,$keyorder,$divid)=@_; |
my ($r,$allparms,$pscat,$psprt,$keyorder)=@_; |
|
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); |
|
|
&parmmenu($r); |
&parmmenu($r,$allparms,$pscat,$keyorder); |
$r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid)); |
$r->print(&Apache::loncommon::start_scrollbox()); |
&parmboxes($r,$allparms,$pscat,$keyorder); |
&parmboxes($r,$allparms,$pscat,$keyorder); |
$r->print(&Apache::loncommon::end_scrollbox()); |
$r->print(&Apache::loncommon::end_scrollbox()); |
|
|
Line 2197 sub displaymenu {
|
Line 1713 sub displaymenu {
|
} |
} |
|
|
sub mapmenu { |
sub mapmenu { |
my ($r,$allmaps,$pschp,$maptitles,$symbp,$parmlev)=@_; |
my ($r,$allmaps,$pschp,$maptitles,$symbp)=@_; |
my %allmaps_inverted = reverse %$allmaps; |
my %allmaps_inverted = reverse %$allmaps; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $tree=[]; |
my $tree=[]; |
Line 2245 sub mapmenu {
|
Line 1761 sub mapmenu {
|
} |
} |
} |
} |
# Show it ... |
# Show it ... |
my $rowattr = ' id="mapmenu"'; |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"')); |
if ($parmlev eq 'general') { |
|
$rowattr .= ' style="display:none"'; |
|
} |
|
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',$rowattr)); |
|
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
my $whitespace = |
my $whitespace = |
Line 2265 sub mapmenu {
|
Line 1777 sub mapmenu {
|
.'</div>' |
.'</div>' |
); |
); |
|
|
$r->print(&Apache::loncommon::start_scrollbox('700px','680px','400px','mapmenuscroll')); |
$r->print(&Apache::loncommon::start_scrollbox(undef,undef,undef,'mapmenuscroll')); |
$r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner')); |
$r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner')); |
|
|
# Display row: "All Maps or Folders" |
# Display row: "All Maps or Folders" |
Line 2284 sub mapmenu {
|
Line 1796 sub mapmenu {
|
.&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table_row() |
); |
); |
|
|
# Display row: "Main Content" |
# Display row: "Main Course Documents" |
if (exists($$allmaps{1})) { |
if (exists($$allmaps{1})) { |
$r->print( |
$r->print( |
&Apache::loncommon::start_data_table_row() |
&Apache::loncommon::start_data_table_row() |
Line 2370 sub levelmenu {
|
Line 1882 sub levelmenu {
|
|
|
|
|
sub sectionmenu { |
sub sectionmenu { |
my ($selectedsections)=@_; |
my ($r,$selectedsections)=@_; |
my %sectionhash = &Apache::loncommon::get_sections(); |
my %sectionhash = &Apache::loncommon::get_sections(); |
return '' if (!%sectionhash); |
return if (!%sectionhash); |
|
|
my (@possibles,$disabled); |
$r->print('<select name="Section" multiple="multiple" size="8">'); |
if ($env{'request.course.sec'} ne '') { |
foreach my $s ('all',sort keys %sectionhash) { |
@possibles = ($env{'request.course.sec'}); |
$r->print(' <option value="'.$s.'"'); |
$selectedsections = [$env{'request.course.sec'}]; |
foreach (@{$selectedsections}) { |
$disabled = ' disabled="disabled"'; |
if ($s eq $_) { |
} else { |
$r->print(' selected="selected"'); |
@possibles = ('all',sort(keys(%sectionhash))); |
last; |
} |
|
my $output = '<select name="Section" multiple="multiple" size="8"'.$disabled.'>'; |
|
foreach my $s (@possibles) { |
|
$output .= ' <option value="'.$s.'"'; |
|
if ((@{$selectedsections}) && (grep(/^\Q$s\E$/,@{$selectedsections}))) { |
|
$output .= ' selected="selected"'; |
|
} |
} |
$output .= '>'."$s</option>\n"; |
|
} |
} |
$output .= "</select>\n"; |
$r->print('>'.$s."</option>\n"); |
return $output; |
} |
|
$r->print("</select>\n"); |
} |
} |
|
|
sub groupmenu { |
sub groupmenu { |
my ($selectedgroups)=@_; |
my ($r,$selectedgroups)=@_; |
my %grouphash; |
my %grouphash = &Apache::longroup::coursegroups(); |
if (&Apache::lonnet::allowed('mdg',$env{'request.course.id'})) { |
return if (!%grouphash); |
%grouphash = &Apache::longroup::coursegroups(); |
|
} elsif ($env{'request.course.groups'} ne '') { |
|
map { $grouphash{$_} = 1; } split(/:/,$env{'request.course.groups'}); |
|
} |
|
return '' if (!%grouphash); |
|
|
|
my $output = '<select name="Group" multiple="multiple" size="8">'; |
$r->print('<select name="Group" multiple="multiple" size="8">'); |
foreach my $group (sort(keys(%grouphash))) { |
foreach my $group (sort(keys(%grouphash))) { |
$output .= ' <option value="'.$group.'"'; |
$r->print(' <option value="'.$group.'"'); |
if ((@{$selectedgroups}) && (grep(/^\Q$group\E$/,\@{$selectedgroups}))) { |
foreach (@{$selectedgroups}) { |
$output .= ' selected="selected"'; |
if ($group eq $_) { |
|
$r->print(' selected="selected"'); |
|
last; |
} |
} |
$output .= '>'.$group."</option>\n"; |
|
} |
} |
$output .= "</select>\n"; |
$r->print('>'.$group."</option>\n"); |
return $output; |
} |
|
$r->print("</select>\n"); |
} |
} |
|
|
|
|
sub keysplit { |
sub keysplit { |
my $keyp=shift; |
my $keyp=shift; |
return (split(/\,/,$keyp)); |
return (split(/\,/,$keyp)); |
Line 2484 sub standardkeyorder {
|
Line 1988 sub standardkeyorder {
|
'parameter_0_discussend' => 19, |
'parameter_0_discussend' => 19, |
'parameter_0_discusshide' => 20, |
'parameter_0_discusshide' => 20, |
'parameter_0_discussvote' => 21, |
'parameter_0_discussvote' => 21, |
'parameter_0_printstartdate' => 22, |
'parameter_0_printopendate' => 22, |
'parameter_0_printenddate' => 23); |
'parameter_0_printclosedate' => 23); |
} |
} |
|
|
|
|
sub assessparms { |
sub assessparms { |
|
|
my ($r,$parm_permission) = @_; |
my $r=shift; |
|
|
|
|
|
|
# -------------------------------------------------------- Variable declaration |
# -------------------------------------------------------- Variable declaration |
Line 2534 sub assessparms {
|
Line 2039 sub assessparms {
|
my $message=''; |
my $message=''; |
|
|
$csec=$env{'form.csec'}; |
$csec=$env{'form.csec'}; |
if ($env{'request.course.sec'} ne '') { |
|
$csec = $env{'request.course.sec'}; |
|
} |
|
|
|
# Check group privs. |
|
$cgroup=$env{'form.cgroup'}; |
$cgroup=$env{'form.cgroup'}; |
my $noeditgrp; |
|
if ($cgroup ne '') { |
|
unless (&Apache::lonnet::allowed('mdg',$env{'request.course.id'})) { |
|
if (($env{'request.course.groups'} eq '') || |
|
(!grep(/^\Q$cgroup\E$/,split(/:/,$env{'request.course.groups'})))) { |
|
$noeditgrp = 1; |
|
} |
|
} |
|
} |
|
|
|
if ($udom=$env{'form.udom'}) { |
if ($udom=$env{'form.udom'}) { |
} elsif ($udom=$env{'request.role.domain'}) { |
} elsif ($udom=$env{'request.role.domain'}) { |
Line 2563 sub assessparms {
|
Line 2054 sub assessparms {
|
|
|
|
|
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
if (!@psprt) { $psprt[0]='0'; } |
if (!@psprt) { $psprt[0]='all'; } |
if (($env{'form.part'}) && ($psprt[0] ne 'all')) { $psprt[0]=$env{'form.part'}; } |
if (($env{'form.part'}) && ($psprt[0] ne 'all')) { $psprt[0]=$env{'form.part'}; } |
|
|
my $pssymb=''; |
my $pssymb=''; |
Line 2620 sub assessparms {
|
Line 2111 sub assessparms {
|
$csec=&Apache::lonnet::getsection($udom,$uname, |
$csec=&Apache::lonnet::getsection($udom,$uname, |
$env{'request.course.id'}); |
$env{'request.course.id'}); |
if ($csec eq '-1') { |
if ($csec eq '-1') { |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
$message='<span class="LC_error">'. |
if ($env{'form.userroles'} eq 'any') { |
&mt("User")." '$uname' ".&mt("at domain")." '$udom' ". |
if (($env{'user.name'} eq $uname) && ($env{'user.domain'} eq $udom)) { |
&mt("not in this course")."</span>"; |
$csec = $env{'request.course.sec'}; |
$uname=''; |
$message = '<span class="LC_info">'; |
$csec=$env{'form.csec'}; |
if ($crstype eq 'Community') { |
|
$message .= &mt('User [_1] at domain [_2] has a non-member role in this community', |
|
$uname,$udom); |
|
} else { |
|
$message .= &mt('User [_1] at domain [_2] has a non-student role in this course', |
|
$uname,$udom); |
|
} |
|
$message .= '</span>'; |
|
} else { |
|
my @possroles = ('in','ep','ta','cr'); |
|
if ($crstype eq 'Community') { |
|
unshift(@possroles,'co'); |
|
} else { |
|
unshift(@possroles,'cc'); |
|
} |
|
my %not_student_roles = |
|
&Apache::lonnet::get_my_roles($uname,$udom,'userroles',['active'], |
|
\@possroles,[$udom],1,1); |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my %sections_by_role; |
|
foreach my $role (keys(%not_student_roles)) { |
|
if ($role =~ /^\Q$cnum:$cdom:\E([^:]+):(|[^:]+)$/) { |
|
my ($rolename,$sec) = ($1,$2); |
|
if ($rolename =~ m{^cr/}) { |
|
$rolename = 'cr'; |
|
} |
|
push(@{$sections_by_role{$rolename}},$sec); |
|
} |
|
} |
|
my $numroles = scalar(keys(%sections_by_role)); |
|
if ($numroles) { |
|
foreach my $role (@possroles) { |
|
if (ref($sections_by_role{$role}) eq 'ARRAY') { |
|
my @secs = sort { $a <=> $b } @{$sections_by_role{$role}}; |
|
$csec = $secs[0]; |
|
last; |
|
} |
|
} |
|
} |
|
if ($csec eq '-1') { |
|
$message = '<span class="LC_warning">'; |
|
if ($crstype eq 'Community') { |
|
$message .= &mt('User [_1] at domain [_2] does not have a role in this community', |
|
$uname,$udom); |
|
} else { |
|
$message .= &mt('User [_1] at domain [_2] does not have a role in this course', |
|
$uname,$udom); |
|
} |
|
$message .= '</span>'; |
|
$uname=''; |
|
if ($env{'request.course.sec'} ne '') { |
|
$csec=$env{'request.course.sec'}; |
|
} else { |
|
$csec=$env{'form.csec'}; |
|
} |
|
$cgroup=$env{'form.cgroup'}; |
|
} else { |
|
$message = '<span class="LC_info">'; |
|
if ($crstype eq 'Community') { |
|
$message .= &mt('User [_1] at domain [_2] has a non-member role in this community', |
|
$uname,$udom); |
|
} else { |
|
$message .= &mt('User [_1] at domain [_2] has a non-student role in this course', |
|
$uname,$udom); |
|
} |
|
$message .= '</span>'; |
|
} |
|
} |
|
} else { |
|
$message = '<span class="LC_warning">'; |
|
if ($crstype eq 'Community') { |
|
$message .= &mt('User [_1] at domain [_2] does not have a member role in this community', |
|
$uname,$udom); |
|
} else { |
|
$message .= &mt('User [_1] at domain [_2] does not have a student role in this course', |
|
$uname,$udom); |
|
} |
|
$message .= '</span>'; |
|
$uname=''; |
|
if ($env{'request.course.sec'} ne '') { |
|
$csec=$env{'request.course.sec'}; |
|
} else { |
|
$csec=$env{'form.csec'}; |
|
} |
|
$cgroup=$env{'form.cgroup'}; |
|
} |
|
} elsif ($env{'request.course.sec'} ne '') { |
|
if ($csec ne $env{'request.course.sec'}) { |
|
$message='<span class="LC_warning">'. |
|
&mt("User '[_1]' at domain '[_2]' not in section '[_3]'", |
|
$uname,$udom,$env{'request.course.sec'}). |
|
'</span>'; |
|
$uname=''; |
|
$csec=$env{'request.course.sec'}; |
|
} |
|
$cgroup=$env{'form.cgroup'}; |
$cgroup=$env{'form.cgroup'}; |
} |
} else { |
if ($uname ne '') { |
|
my %name=&Apache::lonnet::userenvironment($udom,$uname, |
my %name=&Apache::lonnet::userenvironment($udom,$uname, |
('firstname','middlename','lastname','generation','id')); |
('firstname','middlename','lastname','generation','id')); |
$message .= "\n<p>\n".&mt('Full Name').': ' |
$message="\n<p>\n".&mt("Full Name").": ". |
.$name{'firstname'}.' '.$name{'middlename'}.' ' |
$name{'firstname'}.' '.$name{'middlename'}.' ' |
.$name{'lastname'}.' '.$name{'generation'} |
.$name{'lastname'}.' '.$name{'generation'}. |
."<br />\n".&mt('Student/Employee ID').': '.$name{'id'}.'</p>'; |
"<br />\n".&mt('Student/Employee ID').": ".$name{'id'}.'<p>'; |
@usersgroups = &Apache::lonnet::get_users_groups( |
} |
$udom,$uname,$env{'request.course.id'}); |
@usersgroups = &Apache::lonnet::get_users_groups( |
if (@usersgroups > 0) { |
$udom,$uname,$env{'request.course.id'}); |
unless (grep(/^\Q$cgroup\E$/,@usersgroups)) { |
if (@usersgroups > 0) { |
$cgroup = $usersgroups[0]; |
unless (grep(/^\Q$cgroup\E$/,@usersgroups)) { |
} |
$cgroup = $usersgroups[0]; |
} else { |
|
$cgroup = ''; |
|
} |
} |
} |
} |
} |
} |
Line 2755 sub assessparms {
|
Line 2147 sub assessparms {
|
$symbp{'0.0'} = ''; |
$symbp{'0.0'} = ''; |
|
|
# ---------------------------------------------------------- Anything to store? |
# ---------------------------------------------------------- Anything to store? |
if ($env{'form.pres_marker'} && $parm_permission->{'edit'}) { |
if ($env{'form.pres_marker'}) { |
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
Line 2764 sub assessparms {
|
Line 2156 sub assessparms {
|
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my $totalstored = 0; |
my $totalstored = 0; |
my $totalskippeduser = 0; |
|
my $now = time; |
|
for (my $i=0;$i<=$#markers;$i++) { |
for (my $i=0;$i<=$#markers;$i++) { |
my ($needsrelease,$needsnewer,$name); |
my ($needsrelease,$needsnewer,$name); |
if (($env{'request.course.sec'} ne '') && ($markers[$i] =~ /\&(7|8|9)$/)) { |
|
next if ($csec ne $env{'request.course.sec'}); |
|
} |
|
if ($markers[$i] =~ /\&(6|5|4)$/) { |
|
next if ($noeditgrp); |
|
} elsif ($markers[$i] =~ /\&(3|2|1)$/) { |
|
if ($uname eq '') { |
|
$totalskippeduser ++; |
|
next; |
|
} |
|
} |
|
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
my (@ok_slots,@fail_slots,@del_slots); |
my (@ok_slots,@fail_slots,@del_slots); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
Line 2809 sub assessparms {
|
Line 2190 sub assessparms {
|
} |
} |
} |
} |
} |
} |
} elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote|examcode|printstartdate|printenddate)\&\d+$/) { |
} elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote)\&\d+$/) { |
$name = $1; |
$name = $1; |
my $val = $values[$i]; |
|
if ($name eq 'examcode') { |
|
if (&Apache::lonnet::validCODE($values[$i])) { |
|
$val = 'valid'; |
|
} |
|
} elsif ($name eq 'printstartdate') { |
|
if ($val =~ /^\d+$/) { |
|
if ($val > $now) { |
|
$val = 'future'; |
|
} |
|
} |
|
} elsif ($name eq 'printenddate') { |
|
if ($val =~ /^\d+$/) { |
|
if ($val < $now) { |
|
$val = 'past'; |
|
} |
|
} |
|
} |
|
$needsrelease = |
$needsrelease = |
$Apache::lonnet::needsrelease{"parameter:$name:$val"}; |
$Apache::lonnet::needsrelease{"parameter:$name:$values[$i]"}; |
if ($needsrelease) { |
if ($needsrelease) { |
unless ($got_chostname) { |
unless ($got_chostname) { |
($chostname,$cmajor,$cminor) = ¶meter_release_vars(); |
($chostname,$cmajor,$cminor) = ¶meter_release_vars(); |
$got_chostname = 1; |
$got_chostname = 1; |
} |
} |
$needsnewer = ¶meter_releasecheck($name,$val, |
$needsnewer = ¶meter_releasecheck($name,$values[$i], |
$needsrelease, |
$needsrelease, |
|
$chostname, |
$cmajor,$cminor); |
$cmajor,$cminor); |
} |
} |
} |
} |
Line 2855 sub assessparms {
|
Line 2219 sub assessparms {
|
# ---------------------------------------------------------------- Done storing |
# ---------------------------------------------------------------- Done storing |
if ($totalstored) { |
if ($totalstored) { |
$message.='<p class="LC_warning">' |
$message.='<p class="LC_warning">' |
.&mt('Changes for [quant,_1,parameter] saved.',$totalstored) |
|
.'<br />' |
|
.&mt('Changes can take up to 10 minutes before being active for all students.') |
.&mt('Changes can take up to 10 minutes before being active for all students.') |
.&Apache::loncommon::help_open_topic('Caching') |
.&Apache::loncommon::help_open_topic('Caching') |
.'</p>'; |
.'</p>'; |
} else { |
|
$message.='<p class="LC_info">'.&mt('No parameter changes saved.').'</p>'; |
|
} |
|
if ($totalskippeduser) { |
|
$message .= '<p class="LC_warning">'; |
|
if ($uhome eq 'no_host') { |
|
$message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the username or ID was invalid.', |
|
$totalskippeduser); |
|
} elsif ($env{'form.userroles'} eq 'any') { |
|
$message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the user does not have a course role.', |
|
$totalskippeduser); |
|
} else { |
|
$message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the user is not a student.', |
|
$totalskippeduser); |
|
} |
|
$message .= '</p>'; |
|
} |
} |
} |
} |
#----------------------------------------------- if all selected, fill in array |
#----------------------------------------------- if all selected, fill in array |
Line 2884 sub assessparms {
|
Line 2230 sub assessparms {
|
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
# ------------------------------------------------------------------ Start page |
# ------------------------------------------------------------------ Start page |
|
|
&startpage($r,$pssymb); |
my $crstype = &Apache::loncommon::course_type(); |
|
&startpage($r,$pssymb,$crstype); |
|
|
foreach my $item ('tolerance','date_default','date_start','date_end', |
foreach ('tolerance','date_default','date_start','date_end', |
'date_interval','int','float','string','string_lenient', |
'date_interval','int','float','string') { |
'string_examcode','string_deeplink','string_discussvote', |
|
'string_useslots','string_problemstatus','string_ip', |
|
'string_questiontype') { |
|
$r->print('<input type="hidden" value="'. |
$r->print('<input type="hidden" value="'. |
&HTML::Entities::encode($env{'form.recent_'.$item},'"&<>'). |
&HTML::Entities::encode($env{'form.recent_'.$_},'"&<>'). |
'" name="recent_'.$item.'" />'); |
'" name="recent_'.$_.'" />'); |
} |
} |
|
|
# ----- Start Parameter Selection |
# ----- Start Parameter Selection |
|
|
# Hide parm selection and possibly table? |
# Hide parm selection? |
my ($tablejs,$tabledivsty); |
|
if (((($env{'form.uname'} ne '') || ($env{'form.id'} ne '')) && ($uname eq '')) && |
|
($env{'form.dis'}) && ($pssymb eq '')) { |
|
$tablejs = 'document.getElementById('."'parmtable'".').style.display = "";'; |
|
$tabledivsty = ' style="display:none"'; |
|
} |
|
$r->print(<<ENDPARMSELSCRIPT); |
$r->print(<<ENDPARMSELSCRIPT); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
function parmsel_show() { |
function parmsel_show() { |
document.getElementById('parmsel').style.display = ""; |
document.getElementById('parmsel').style.display = ""; |
document.getElementById('parmsellink').style.display = "none"; |
document.getElementById('parmsellink').style.display = "none"; |
$tablejs |
|
} |
} |
// ]]> |
// ]]> |
</script> |
</script> |
Line 2937 ENDPARMSELSCRIPT
|
Line 2274 ENDPARMSELSCRIPT
|
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp,$parmlev); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
&partmenu($r,\%allparts,\@psprt); |
&partmenu($r,\%allparts,\@psprt); |
Line 2946 ENDPARMSELSCRIPT
|
Line 2283 ENDPARMSELSCRIPT
|
|
|
# Step 2 |
# Step 2 |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2')); |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2')); |
&displaymenu($r,\%allparms,\@pscat,\%keyorder,'parmmenuscroll'); |
&displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder); |
|
|
# Step 3 |
# Step 3 |
$r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3')); |
$r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3')); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups,$pssymb); |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
|
Line 2974 ENDPARMSELSCRIPT
|
Line 2311 ENDPARMSELSCRIPT
|
.'</a>' |
.'</a>' |
.'</p>'); |
.'</p>'); |
} else { |
} else { |
$r->print(); |
|
# parameter screen for a single resource. |
# parameter screen for a single resource. |
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my $title = &Apache::lonnet::gettitle($pssymb); |
my $title = &Apache::lonnet::gettitle($pssymb); |
Line 2984 ENDPARMSELSCRIPT
|
Line 2320 ENDPARMSELSCRIPT
|
'<br />'); |
'<br />'); |
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('Additional Display Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('Additional Display Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')). |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
'<label>'. |
|
'<input type="checkbox" name="psprt" value="all"'. |
|
($env{'form.psprt'}?' checked="checked"':'').' />'. |
|
&mt('Show all parts'). |
|
'</label></td></tr>'); |
|
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups,$pssymb); |
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print('<p>' |
$r->print('<p>' |
Line 3019 ENDPARMSELSCRIPT
|
Line 2349 ENDPARMSELSCRIPT
|
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat; |
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat; |
my $csuname=$env{'user.name'}; |
my $csuname=$env{'user.name'}; |
my $csudom=$env{'user.domain'}; |
my $csudom=$env{'user.domain'}; |
my $readonly = 1; |
|
if ($parm_permission->{'edit'}) { |
|
undef($readonly); |
|
} |
|
$r->print('<div id="parmtable"'.$tabledivsty.'>'); |
|
|
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
# |
# |
Line 3109 ENDTABLEHEADFOUR
|
Line 2434 ENDTABLEHEADFOUR
|
my $defbgtwo=''; |
my $defbgtwo=''; |
my $defbgthree = ''; |
my $defbgthree = ''; |
|
|
foreach (@ids) { |
foreach my $rid (@ids) { |
|
|
my $rid=$_; |
|
my ($inmapid)=($rid=~/\.(\d+)$/); |
my ($inmapid)=($rid=~/\.(\d+)$/); |
|
|
if ((!$pssymb && |
if ((!$pssymb && |
Line 3143 ENDTABLEHEADFOUR
|
Line 2467 ENDTABLEHEADFOUR
|
my %type= (); |
my %type= (); |
my %default=(); |
my %default=(); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $toolsymb; |
|
if ($uri =~ /ext\.tool$/) { |
|
$toolsymb = $symbp{$rid}; |
|
} |
|
|
|
my $filter=$env{'form.filter'}; |
my $filter=$env{'form.filter'}; |
foreach (&keysplit($keyp{$rid})) { |
foreach (&keysplit($keyp{$rid})) { |
my $tempkeyp = $_; |
my $tempkeyp = $_; |
if (grep $_ eq $tempkeyp, @catmarker) { |
if (grep $_ eq $tempkeyp, @catmarker) { |
my $parmname=&Apache::lonnet::metadata($uri,$_.'.name',$toolsymb); |
my $parmname=&Apache::lonnet::metadata($uri,$_.'.name'); |
# We may only want certain parameters listed |
# We may only want certain parameters listed |
if ($filter) { |
if ($filter) { |
unless ($filter=~/\Q$parmname\E/) { next; } |
unless ($filter=~/\Q$parmname\E/) { next; } |
} |
} |
$name{$_}=$parmname; |
$name{$_}=$parmname; |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part',$toolsymb); |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part'); |
|
|
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display',$toolsymb); |
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display'); |
if ($allparms{$name{$_}} ne '') { |
if ($allparms{$name{$_}} ne '') { |
my $identifier; |
my $identifier; |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
Line 3172 ENDTABLEHEADFOUR
|
Line 2492 ENDTABLEHEADFOUR
|
} |
} |
unless ($display{$_}) { $display{$_}=''; } |
unless ($display{$_}) { $display{$_}=''; } |
$display{$_}.=' ('.$name{$_}.')'; |
$display{$_}.=' ('.$name{$_}.')'; |
$default{$_}=&Apache::lonnet::metadata($uri,$_,$toolsymb); |
$default{$_}=&Apache::lonnet::metadata($uri,$_); |
$type{$_}=&Apache::lonnet::metadata($uri,$_.'.type',$toolsymb); |
$type{$_}=&Apache::lonnet::metadata($uri,$_.'.type'); |
$thistitle=&Apache::lonnet::metadata($uri,$_.'.title',$toolsymb); |
$thistitle=&Apache::lonnet::metadata($uri,$_.'.title'); |
} |
} |
} |
} |
my $totalparms=scalar keys %name; |
my $totalparms=scalar keys %name; |
Line 3213 ENDTABLEHEADFOUR
|
Line 2533 ENDTABLEHEADFOUR
|
&print_row($r,$_,\%part,\%name,\%symbp,$rid,\%default, |
&print_row($r,$_,\%part,\%name,\%symbp,$rid,\%default, |
\%type,\%display,$defbgone,$defbgtwo, |
\%type,\%display,$defbgone,$defbgtwo, |
$defbgthree,$parmlev,$uname,$udom,$csec, |
$defbgthree,$parmlev,$uname,$udom,$csec, |
$cgroup,\@usersgroups,$noeditgrp,$readonly); |
$cgroup,\@usersgroups); |
} |
} |
} |
} |
} |
} |
Line 3237 ENDTABLEHEADFOUR
|
Line 2557 ENDTABLEHEADFOUR
|
|
|
#-------------------------------------------- for each map, gather information |
#-------------------------------------------- for each map, gather information |
my $mapid; |
my $mapid; |
foreach $mapid (sort { $a <=> $b } keys(%maplist)) { |
foreach $mapid (sort {$maplist{$a} cmp $maplist{$b}} keys %maplist) { |
my $maptitle = $maplist{$mapid}; |
my $maptitle = $maplist{$mapid}; |
|
|
#----------------------- loop through ids and get all parameter types for map |
#----------------------- loop through ids and get all parameter types for map |
Line 3259 ENDTABLEHEADFOUR
|
Line 2579 ENDTABLEHEADFOUR
|
|
|
if ($map eq $mapid) { |
if ($map eq $mapid) { |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $toolsymb; |
|
if ($uri =~ /ext\.tool$/) { |
|
$toolsymb = $symbp{$rid}; |
|
} |
|
# $r->print("Keys: $keyp{$rid} <br />\n"); |
# $r->print("Keys: $keyp{$rid} <br />\n"); |
|
|
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
Line 3279 ENDTABLEHEADFOUR
|
Line 2595 ENDTABLEHEADFOUR
|
|
|
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name',$toolsymb); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display',$toolsymb); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
if ($allparms{$name{$tempkeyp}} ne '') { |
if ($allparms{$name{$tempkeyp}} ne '') { |
my $identifier; |
my $identifier; |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
Line 3293 ENDTABLEHEADFOUR
|
Line 2609 ENDTABLEHEADFOUR
|
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp,$toolsymb); |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type',$toolsymb); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); |
} |
} |
} # end loop through keys |
} # end loop through keys |
} |
} |
Line 3340 ENDTABLEHEADFOUR
|
Line 2656 ENDTABLEHEADFOUR
|
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default, |
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
$parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp, |
$parmlev,$uname,$udom,$csec,$cgroup); |
$readonly); |
|
} |
} |
$r->print(&Apache::loncommon::end_data_table().'</p>' |
$r->print(&Apache::loncommon::end_data_table().'</p>' |
.'</div>' |
.'</div>' |
Line 3368 ENDTABLEHEADFOUR
|
Line 2683 ENDTABLEHEADFOUR
|
my $rid = $_; |
my $rid = $_; |
|
|
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $toolsymb; |
|
if ($uri =~ /ext\.tool$/) { |
|
$toolsymb = $symbp{$rid}; |
|
} |
|
|
|
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
# @catmarker contains list of all possible parameters including part #s |
# @catmarker contains list of all possible parameters including part #s |
Line 3386 ENDTABLEHEADFOUR
|
Line 2697 ENDTABLEHEADFOUR
|
$tempkeyp =~ s/_\w+_/_0_/; |
$tempkeyp =~ s/_\w+_/_0_/; |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name',$toolsymb); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display',$toolsymb); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
if ($allparms{$name{$tempkeyp}} ne '') { |
if ($allparms{$name{$tempkeyp}} ne '') { |
my $identifier; |
my $identifier; |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
if ($parmdis =~ /(\s*\[Part.*)$/) { |
Line 3400 ENDTABLEHEADFOUR
|
Line 2711 ENDTABLEHEADFOUR
|
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp,$toolsymb); |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type',$toolsymb); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); |
} |
} |
} # end loop through keys |
} # end loop through keys |
} # end loop through ids |
} # end loop through ids |
Line 3435 ENDMAPONE
|
Line 2746 ENDMAPONE
|
foreach (&keysinorder(\%name,\%keyorder)) { |
foreach (&keysinorder(\%name,\%keyorder)) { |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default, |
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
$parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp, |
$parmlev,$uname,$udom,$csec,$cgroup); |
$readonly); |
|
} |
} |
$r->print(&Apache::loncommon::end_data_table() |
$r->print(&Apache::loncommon::end_data_table() |
.'</p>' |
.'</p>' |
.'</center>' |
.'</center>' |
); |
); |
} # end of $parmlev eq general |
} # end of $parmlev eq general |
$r->print('</div>'); |
|
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} # end sub assessparms |
} # end sub assessparms |
|
|
Line 3456 ENDMAPONE
|
Line 2766 ENDMAPONE
|
my $tableopen; |
my $tableopen; |
|
|
sub tablestart { |
sub tablestart { |
my ($readonly) = @_; |
|
if ($tableopen) { |
if ($tableopen) { |
return ''; |
return ''; |
} else { |
} else { |
$tableopen=1; |
$tableopen=1; |
my $output = &Apache::loncommon::start_data_table().'<tr><th>'.&mt('Parameter').'</th>'; |
return &Apache::loncommon::start_data_table().'<tr><th>'.&mt('Parameter').'</th><th>'. |
if ($readonly) { |
&mt('Delete').'</th><th>'.&mt('Set to ...').'</th></tr>'; |
$output .= '<th>'.&mt('Current value').'</th>'; |
|
} else { |
|
$output .= '<th>'.&mt('Delete').'</th><th>'.&mt('Set to ...').'</th>'; |
|
} |
|
$output .= '</tr>'; |
|
return $output; |
|
} |
} |
} |
} |
|
|
Line 3501 sub readdata {
|
Line 2804 sub readdata {
|
} |
} |
} |
} |
} |
} |
if (wantarray) { |
return $resourcedata; |
return ($resourcedata,$classlist); |
|
} else { |
|
return $resourcedata; |
|
} |
|
} |
} |
|
|
|
|
Line 3521 sub storedata {
|
Line 2820 sub storedata {
|
my @deldata=(); |
my @deldata=(); |
undef @deldata; |
undef @deldata; |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my $now = time; |
|
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ($key =~ /^form\.([a-z]+)\_(.+)$/) { |
if ($key =~ /^form\.([a-z]+)\_(.+)$/) { |
my $cmd=$1; |
my $cmd=$1; |
my $thiskey=$2; |
my $thiskey=$2; |
next if ($cmd eq 'setipallow' || $cmd eq 'setipdeny' || $cmd eq 'setdeeplink'); |
|
my ($tuname,$tudom)=&extractuser($thiskey); |
my ($tuname,$tudom)=&extractuser($thiskey); |
my $tkey=$thiskey; |
my $tkey=$thiskey; |
if ($tuname) { |
if ($tuname) { |
$tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./; |
$tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./; |
} |
} |
if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') { |
if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') { |
my ($data, $typeof, $text, $name, $valchk, $valmatch, $namematch); |
my ($data, $typeof, $text, $name); |
if ($cmd eq 'set') { |
if ($cmd eq 'set') { |
$data=$env{$key}; |
$data=$env{$key}; |
$valmatch = ''; |
|
$valchk = $data; |
|
$typeof=$env{'form.typeof_'.$thiskey}; |
$typeof=$env{'form.typeof_'.$thiskey}; |
$text = &mt('Saved modified parameter for'); |
$text = &mt('Saved modified parameter for'); |
if ($typeof eq 'string_questiontype') { |
if ($typeof eq 'string_questiontype') { |
$name = 'type'; |
$name = 'type'; |
} elsif ($typeof eq 'string_deeplink') { |
|
($name) = ($typeof =~ /^string_(deeplink)$/); |
|
my $stringmatch = &standard_string_matches($typeof); |
|
if (ref($stringmatch) eq 'ARRAY') { |
|
foreach my $item (@{$stringmatch}) { |
|
if (ref($item) eq 'ARRAY') { |
|
my ($regexpname,$pattern) = @{$item}; |
|
if ($pattern ne '') { |
|
if ($data =~ /$pattern/) { |
|
$valmatch = $regexpname; |
|
$valchk = ''; |
|
last; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} elsif ($typeof eq 'string_lenient') { |
} elsif ($typeof eq 'string_lenient') { |
$name = 'lenient'; |
$name = 'lenient'; |
} elsif ($typeof eq 'string_discussvote') { |
} elsif ($typeof eq 'string_discussvote') { |
$name = 'discussvote'; |
$name = 'discussvote'; |
} elsif ($typeof eq 'string_examcode') { |
|
$name = 'examcode'; |
|
if (&Apache::lonnet::validCODE($data)) { |
|
$valchk = 'valid'; |
|
} |
|
} elsif ($typeof eq 'string_yesno') { |
} elsif ($typeof eq 'string_yesno') { |
if ($thiskey =~ /\.retrypartial$/) { |
if ($thiskey =~ /\.retrypartial$/) { |
$name = 'retrypartial'; |
$name = 'retrypartial'; |
} |
} |
} |
} |
} elsif ($cmd eq 'datepointer') { |
if ($name ne '') { |
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$key}); |
my ($needsrelease,$needsnewer); |
$typeof=$env{'form.typeof_'.$thiskey}; |
$needsrelease = $Apache::lonnet::needsrelease{"parameter:$name:$data"}; |
$text = &mt('Saved modified date for'); |
if ($needsrelease) { |
if ($typeof eq 'date_start') { |
unless ($got_chostname) { |
if ($thiskey =~ /\.printstartdate$/) { |
($chostname,$cmajor,$cminor)=¶meter_release_vars(); |
$name = 'printstartdate'; |
$got_chostname = 1; |
if (($data) && ($data > $now)) { |
|
$valchk = 'future'; |
|
} |
|
} |
|
} elsif ($typeof eq 'date_end') { |
|
if ($thiskey =~ /\.printenddate$/) { |
|
$name = 'printenddate'; |
|
if (($data) && ($data < $now)) { |
|
$valchk = 'past'; |
|
} |
} |
|
$needsnewer = ¶meter_releasecheck($name,$data, |
|
$needsrelease, |
|
$chostname,$cmajor, |
|
$cminor); |
} |
} |
} |
|
} elsif ($cmd eq 'dateinterval') { |
|
$data=&get_date_interval_from_form($thiskey); |
|
$typeof=$env{'form.typeof_'.$thiskey}; |
|
$text = &mt('Saved modified date for'); |
|
} |
|
if ($name ne '') { |
|
my ($needsrelease,$needsnewer); |
|
$needsrelease = $Apache::lonnet::needsrelease{"parameter:$name:$valchk"}; |
|
if ($needsrelease) { |
|
unless ($got_chostname) { |
|
($chostname,$cmajor,$cminor)=¶meter_release_vars(); |
|
$got_chostname = 1; |
|
} |
|
$needsnewer = ¶meter_releasecheck($name,$valchk, |
|
$needsrelease, |
|
$cmajor,$cminor); |
|
if ($needsnewer) { |
if ($needsnewer) { |
$r->print('<br />'.&oldversion_warning($name,$data, |
$r->print('<br />'.&oldversion_warning($name,$data, |
$chostname,$cmajor, |
$chostname,$cmajor, |
Line 3615 sub storedata {
|
Line 2866 sub storedata {
|
next; |
next; |
} |
} |
} |
} |
|
} elsif ($cmd eq 'datepointer') { |
|
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$key}); |
|
$typeof=$env{'form.typeof_'.$thiskey}; |
|
$text = &mt('Saved modified date for'); |
|
} elsif ($cmd eq 'dateinterval') { |
|
$data=&get_date_interval_from_form($thiskey); |
|
$typeof=$env{'form.typeof_'.$thiskey}; |
|
$text = &mt('Saved modified date for'); |
} |
} |
if (defined($data) and $$olddata{$thiskey} ne $data) { |
if (defined($data) and $$olddata{$thiskey} ne $data) { |
if ($tuname) { |
if ($tuname) { |
Line 3658 sub storedata {
|
Line 2917 sub storedata {
|
if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') { |
if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') { |
my %loghash=map { $_ => '' } @deldata; |
my %loghash=map { $_ => '' } @deldata; |
&log_parmset(\%loghash,1); |
&log_parmset(\%loghash,1); |
$r->print('<h2>'.&mt('Deleted [quant,_1,parameter]',$delentries/2).'</h2>'); |
$r->print('<h2>'.&mt('Deleted [_1] parameter(s)',$delentries).'</h2>'); |
} else { |
} else { |
$r->print('<div class="LC_error">'. |
$r->print('<div class="LC_error">'. |
&mt('Error deleting parameters').'</div>'); |
&mt('Error deleting parameters').'</div>'); |
Line 3668 sub storedata {
|
Line 2927 sub storedata {
|
if ($putentries) { |
if ($putentries) { |
if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') { |
if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') { |
&log_parmset(\%newdata,0); |
&log_parmset(\%newdata,0); |
$r->print('<h3>'.&mt('Saved [quant,_1,parameter]',$putentries/2).'</h3>'); |
$r->print('<h3>'.&mt('Saved [_1] parameter(s)',$putentries/2).'</h3>'); |
} else { |
} else { |
$r->print('<div class="LC_error">'. |
$r->print('<div class="LC_error">'. |
&mt('Error saving parameters').'</div>'); |
&mt('Error saving parameters').'</div>'); |
Line 3703 sub parse_listdata_key {
|
Line 2962 sub parse_listdata_key {
|
} |
} |
|
|
sub listdata { |
sub listdata { |
my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly,$parmlev)=@_; |
my ($r,$resourcedata,$listdata,$sortorder)=@_; |
# Start list output |
# Start list output |
|
|
my $oldsection=''; |
my $oldsection=''; |
Line 3713 sub listdata {
|
Line 2972 sub listdata {
|
$tableopen=0; |
$tableopen=0; |
my $foundkeys=0; |
my $foundkeys=0; |
my %keyorder=&standardkeyorder(); |
my %keyorder=&standardkeyorder(); |
my $readonlyall = $readonly; |
|
|
|
my ($secidx,%grouphash); |
|
if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) { |
|
$secidx = &Apache::loncoursedata::CL_SECTION(); |
|
if (&Apache::lonnet::allowed('mdg',$env{'request.course.id'})) { |
|
%grouphash = &Apache::longroup::coursegroups(); |
|
} elsif ($env{'request.course.groups'} ne '') { |
|
map { $grouphash{$_} = 1; } split(/:/,$env{'request.course.groups'}); |
|
} |
|
} |
|
|
|
foreach my $thiskey (sort { |
foreach my $thiskey (sort { |
my ($astudent,$ares,$apart,$aparm) = &parse_listdata_key($a,$listdata); |
my ($astudent,$ares,$apart,$aparm) = &parse_listdata_key($a,$listdata); |
Line 3767 sub listdata {
|
Line 3015 sub listdata {
|
} keys %{$listdata}) { |
} keys %{$listdata}) { |
|
|
if ($$listdata{$thiskey.'.type'}) { |
if ($$listdata{$thiskey.'.type'}) { |
my $thistype=$$listdata{$thiskey.'.type'}; |
my $thistype=$$listdata{$thiskey.'.type'}; |
if ($$resourcedata{$thiskey.'.type'}) { |
if ($$resourcedata{$thiskey.'.type'}) { |
$thistype=$$resourcedata{$thiskey.'.type'}; |
$thistype=$$resourcedata{$thiskey.'.type'}; |
} |
} |
my ($middle,$part,$name)= |
my ($middle,$part,$name)= |
($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/); |
($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/); |
my $section=&mt('All Students'); |
my $section=&mt('All Students'); |
$readonly = $readonlyall; |
|
my $userscope; |
|
my $showval = $$resourcedata{$thiskey}; |
|
if ($middle=~/^\[(.*)\]/) { |
if ($middle=~/^\[(.*)\]/) { |
my $issection=$1; |
my $issection=$1; |
if ($issection=~/^useropt\:($match_username)\:($match_domain)/) { |
if ($issection=~/^useropt\:($match_username)\:($match_domain)/) { |
my ($stuname,$studom) = ($1,$2); |
$section=&mt('User').": ".&Apache::loncommon::plainname($1,$2); |
if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) { |
} else { |
if (ref($classlist) eq 'HASH') { |
$section=&mt('Group/Section').': '.$issection; |
if (ref($classlist->{$stuname.':'.$studom}) eq 'ARRAY') { |
} |
next unless ($classlist->{$stuname.':'.$studom}->[$secidx] eq $env{'request.course.sec'}); |
$middle=~s/^\[(.*)\]//; |
} |
|
} |
|
} |
|
$section=&mt('User').": ".&Apache::loncommon::plainname($1,$2); |
|
$userscope = 1; |
|
} else { |
|
if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) { |
|
if (exists($grouphash{$issection})) { |
|
$section=&mt('Group').': '.$issection; |
|
} elsif ($issection eq $env{'request.course.sec'}) { |
|
$section = &mt('Section').': '.$issection; |
|
} else { |
|
next; |
|
} |
|
} else { |
|
$section=&mt('Group/Section').': '.$issection; |
|
} |
|
} |
|
$middle=~s/^\[(.*)\]//; |
|
} elsif (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) { |
|
$readonly = 1; |
|
} |
} |
$middle=~s/\.+$//; |
$middle=~s/\.+$//; |
$middle=~s/^\.+//; |
$middle=~s/^\.+//; |
my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>'; |
my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>'; |
|
|
if ($middle=~/^(.+)\_\_\_\(all\)$/) { |
if ($middle=~/^(.+)\_\_\_\(all\)$/) { |
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>'; |
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>'; |
} elsif ($middle) { |
} elsif ($middle) { |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
next if (($url =~ /\.(page|sequence)$/) && ($parmlev eq 'full') && ($caller eq 'newoverview')); |
|
$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>'; |
$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>'; |
} |
} |
if ($sortorder eq 'realmstudent') { |
if ($sortorder eq 'realmstudent') { |
Line 3850 sub listdata {
|
Line 3072 sub listdata {
|
# Ready to print |
# Ready to print |
# |
# |
my $parmitem = &standard_parameter_names($name); |
my $parmitem = &standard_parameter_names($name); |
$r->print(&tablestart($readonly). |
$r->print(&tablestart(). |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td><b>'.&mt($parmitem). |
'<td><b>'.&mt($parmitem). |
'</b></td>'); |
'</b></td><td><input type="checkbox" name="del_'. |
unless ($readonly) { |
$thiskey.'" /></td><td>'); |
my $disabled; |
|
if (($name eq 'availablestudent') && |
|
(($showval eq '') || ($userscope))) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
|
$r->print('<td><input type="checkbox" name="del_'. |
|
$thiskey.'"'.$disabled.' /></td>'); |
|
} |
|
$r->print('<td>'); |
|
$foundkeys++; |
$foundkeys++; |
if (&isdateparm($thistype)) { |
if (&isdateparm($thistype)) { |
my $jskey='key_'.$pointer; |
my $jskey='key_'.$pointer; |
my $state; |
$pointer++; |
$pointer++; |
$r->print( |
if ($readonly) { |
&Apache::lonhtmlcommon::date_setter('parmform', |
$state = 'disabled'; |
$jskey, |
} |
$$resourcedata{$thiskey}, |
$r->print( |
'',1,'',''). |
&Apache::lonhtmlcommon::date_setter('parmform', |
|
$jskey, |
|
$$resourcedata{$thiskey}, |
|
'',1,$state)); |
|
unless ($readonly) { |
|
$r->print( |
|
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
(($$resourcedata{$thiskey}!=0)?'<span class="LC_nobreak"><a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'. |
(($$resourcedata{$thiskey}!=0)?'<span class="LC_nobreak"><a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'. |
&mt('Shift all dates based on this date').'</a></span>':''). |
&mt('Shift all dates based on this date').'</a></span>':''). |
&date_sanity_info($$resourcedata{$thiskey}) |
&date_sanity_info($$resourcedata{$thiskey}) |
); |
); |
} |
|
} elsif ($thistype eq 'date_interval') { |
} elsif ($thistype eq 'date_interval') { |
$r->print(&date_interval_selector($thiskey,$name, |
$r->print(&date_interval_selector($thiskey, |
$$resourcedata{$thiskey},$readonly)); |
$$resourcedata{$thiskey})); |
} elsif ($thistype =~ m/^string/) { |
} elsif ($thistype =~ m/^string/) { |
if ($name eq 'availablestudent') { |
$r->print(&string_selector($thistype,$thiskey, |
$readonly = 1; |
$$resourcedata{$thiskey},$name)); |
} |
|
$r->print(&string_selector($thistype,$thiskey, |
|
$$resourcedata{$thiskey},$name,$readonly)); |
|
} else { |
} else { |
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey},$readonly)); |
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); |
} |
|
unless ($readonly) { |
|
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
|
$thistype.'" />'); |
|
} |
} |
|
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
|
$thistype.'" />'); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
} |
} |
Line 3909 sub listdata {
|
Line 3110 sub listdata {
|
|
|
|
|
sub date_interval_selector { |
sub date_interval_selector { |
my ($thiskey, $pname, $showval, $readonly) = @_; |
my ($thiskey, $showval) = @_; |
my ($result,%skipval); |
my $result; |
my $currval = $showval; |
|
foreach my $which (['days', 86400, 31], |
foreach my $which (['days', 86400, 31], |
['hours', 3600, 23], |
['hours', 3600, 23], |
['minutes', 60, 59], |
['minutes', 60, 59], |
Line 3921 sub date_interval_selector {
|
Line 3121 sub date_interval_selector {
|
$showval %= $factor; |
$showval %= $factor; |
my %select = ((map {$_ => $_} (0..$max)), |
my %select = ((map {$_ => $_} (0..$max)), |
'select_form_order' => [0..$max]); |
'select_form_order' => [0..$max]); |
if ($currval eq '') { |
|
unshift(@{$select{'select_form_order'}},''); |
|
$select{''} = ''; |
|
$amount = ''; |
|
} |
|
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
\%select,'',$readonly); |
\%select); |
$result .= ' '.&mt($name); |
$result .= ' '.&mt($name); |
} |
} |
if ($pname eq 'interval') { |
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
unless ($skipval{'done'}) { |
|
my $checkedon = ''; |
|
my $checkedoff = ''; |
|
my $checkedproc = ''; |
|
my $currproctorkey = ''; |
|
my $currprocdisplay = 'hidden'; |
|
my $currdonetext = &mt('Done'); |
|
my $checkedoff = ' checked="checked"'; |
|
if ($currval =~ /^(?:\d+)_done$/) { |
|
$checkedon = ' checked="checked"'; |
|
} elsif ($currval =~ /^(?:\d+)_done\:([^\:]+)\:$/) { |
|
$currdonetext = $1; |
|
$checkedon = ' checked="checked"'; |
|
} elsif ($currval =~ /^(?:\d+)_done_proctor_(.+)$/) { |
|
$currproctorkey = $1; |
|
$checkedproc = ' checked="checked"'; |
|
$currprocdisplay = 'text'; |
|
} elsif ($currval =~ /^(?:\d+)_done\:([^\:]+)\:_proctor_(.+)$/) { |
|
$currdonetext = $1; |
|
$currproctorkey = $2; |
|
$checkedproc = ' checked="checked"'; |
|
$currprocdisplay = 'text'; |
|
} elsif ($currval ne '') { |
|
$checkedoff = ' checked="checked"'; |
|
} else { |
|
$currdonetext = ''; |
|
} |
|
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
|
my $disabled; |
|
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
|
$result .= '<br /><span class="LC_nobreak">'.&mt('Include "done" button'). |
|
'<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.$disabled.' />'. |
|
&mt('No').'</label>'.(' 'x2). |
|
'<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.$disabled.' />'. |
|
&mt('Yes').'</label>'.(' 'x2). |
|
'<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.$disabled.' />'. |
|
&mt('Yes, with proctor key').'</label>'. |
|
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
|
'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'"'.$disabled.' /></span><br />'. |
|
'<span class="LC_nobreak">'.&mt('Button text').': '. |
|
'<input type="text" name="done_'.$thiskey.'_buttontext" value="'. |
|
&HTML::Entities::encode($currdonetext,'"<>&').'"'.$disabled.' /></span>'; |
|
} |
|
} |
|
unless ($readonly) { |
|
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
|
} |
|
return $result; |
return $result; |
|
|
} |
} |
Line 3987 sub date_interval_selector {
|
Line 3133 sub date_interval_selector {
|
sub get_date_interval_from_form { |
sub get_date_interval_from_form { |
my ($key) = @_; |
my ($key) = @_; |
my $seconds = 0; |
my $seconds = 0; |
my $numnotnull = 0; |
|
foreach my $which (['days', 86400], |
foreach my $which (['days', 86400], |
['hours', 3600], |
['hours', 3600], |
['minutes', 60], |
['minutes', 60], |
['seconds', 1]) { |
['seconds', 1]) { |
my ($name, $factor) = @{ $which }; |
my ($name, $factor) = @{ $which }; |
if (defined($env{'form.'.$name.'_'.$key})) { |
if (defined($env{'form.'.$name.'_'.$key})) { |
unless ($env{'form.'.$name.'_'.$key} eq '') { |
$seconds += $env{'form.'.$name.'_'.$key} * $factor; |
$numnotnull ++; |
|
$seconds += $env{'form.'.$name.'_'.$key} * $factor; |
|
} |
|
} |
} |
} |
} |
if (($key =~ /\.interval$/) && |
|
(($env{'form.done_'.$key} eq '_done') || ($env{'form.done_'.$key} eq '_done_proctor'))) { |
|
if ($env{'form.done_'.$key.'_buttontext'}) { |
|
$env{'form.done_'.$key.'_buttontext'} =~ s/\://g; |
|
$seconds .= '_done:'.$env{'form.done_'.$key.'_buttontext'}.':'; |
|
if ($env{'form.done_'.$key} eq '_done_proctor') { |
|
$seconds .= '_proctor'; |
|
} |
|
} else { |
|
$seconds .= $env{'form.done_'.$key}; |
|
} |
|
if (($env{'form.done_'.$key} eq '_done_proctor') && |
|
($env{'form.done_'.$key.'_proctorkey'})) { |
|
$seconds .= '_'.$env{'form.done_'.$key.'_proctorkey'}; |
|
} |
|
} |
|
return if (!$numnotnull); |
|
return $seconds; |
return $seconds; |
} |
} |
|
|
|
|
sub default_selector { |
sub default_selector { |
my ($thiskey, $showval, $readonly) = @_; |
my ($thiskey, $showval) = @_; |
my $disabled; |
return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'" />'; |
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
|
return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'"'.$disabled.' />'; |
|
} |
|
|
|
sub string_ip_selector { |
|
my ($thiskey, $showval, $readonly) = @_; |
|
my %access = ( |
|
allow => [], |
|
deny => [], |
|
); |
|
if ($showval ne '') { |
|
my @current; |
|
if ($showval =~ /,/) { |
|
@current = split(/,/,$showval); |
|
} else { |
|
@current = ($showval); |
|
} |
|
foreach my $item (@current) { |
|
if ($item =~ /^\!([\[\]a-zA-Z\.\d\*\-]+)$/) { |
|
push(@{$access{'deny'}},$1); |
|
} elsif ($item =~ /^([\[\]a-zA-Z\.\d\*\-]+)$/) { |
|
push(@{$access{'allow'}},$item); |
|
} |
|
} |
|
} |
|
if (!@{$access{'allow'}}) { |
|
@{$access{'allow'}} = (''); |
|
} |
|
if (!@{$access{'deny'}}) { |
|
@{$access{'deny'}} = (''); |
|
} |
|
my ($disabled,$addmore); |
|
if ($readonly) { |
|
$disabled=' disabled="disabled"'; |
|
} else { |
|
$addmore = "\n".'<button class="LC_add_ipacc_button">'.&mt('Add more').'</button>'; |
|
} |
|
my $output = '<input type="hidden" name="set_'.$thiskey.'" /> |
|
<table><tr><th>'.&mt('Allow from').'</th><th>'.&mt('Deny from').'</th></tr><tr>'; |
|
foreach my $acctype ('allow','deny') { |
|
$output .= ' |
|
<td valign="top"> |
|
<div class="LC_string_ipacc_wrap" id="LC_string_ipacc_'.$acctype.'_'.$thiskey.'"> |
|
<div class="LC_string_ipacc_inner">'."\n"; |
|
my $num = 0; |
|
foreach my $curr (@{$access{$acctype}}) { |
|
$output .= '<div><input type="text" name="setip'.$acctype.'_'.$thiskey.'" value="'.$curr.'"'.$disabled.' />'; |
|
if ($num > 0) { |
|
$output .= '<a href="#" class="LC_remove_ipacc">'.&mt('Remove').'</a>'; |
|
} |
|
$output .= '</div>'."\n"; |
|
$num ++; |
|
} |
|
$output .= ' |
|
</div>'.$addmore.' |
|
</div> |
|
</td>'; |
|
} |
|
$output .= ' |
|
</tr> |
|
</table>'."\n"; |
|
return $output; |
|
} |
|
|
|
sub string_deeplink_selector { |
|
my ($thiskey, $showval, $readonly) = @_; |
|
my (@tables,%values,@current,%titles,%options,%optiontext,%defaults, |
|
%selectnull,%domlti,%crslti,@possmenus,%components); |
|
@tables = ('upper','lower'); |
|
%components = ( |
|
upper => ['state','others','listing','scope'], |
|
lower => ['protect','menus','target','exit'], |
|
); |
|
%titles = &Apache::lonlocal::texthash ( |
|
state => 'Access status', |
|
others => 'Hide other resources', |
|
listing => 'In Contents and/or Gradebook', |
|
scope => 'Access scope for link', |
|
protect => 'Link protection', |
|
menus => 'Menu Items Displayed', |
|
target => 'Embedded?', |
|
exit => 'Exit Tool Button?', |
|
); |
|
%options = ( |
|
state => ['only','off','both'], |
|
others => ['hide','unhide'], |
|
listing => ['full','absent','grades','details','datestatus'], |
|
scope => ['res','map','rec'], |
|
protect => ['none','key','ltid','ltic'], |
|
menus => ['std','colls'], |
|
target => ['_self','_top'], |
|
exit => ['no','yes','url'], |
|
); |
|
%optiontext = &Apache::lonlocal::texthash ( |
|
only => 'deep only', |
|
off => 'deeplink off', |
|
both => 'regular + deep', |
|
hide => 'Hidden', |
|
unhide => 'Unhidden', |
|
full => 'Listed (linked) in both', |
|
absent => 'Not listed', |
|
grades => 'Listed in grades only', |
|
details => 'Listed (unlinked) in both', |
|
datestatus => 'Listed (unlinked) inc. status in both', |
|
res => 'resource only', |
|
map => 'enclosing map/folder', |
|
rec => 'recursive map/folder', |
|
none => 'not in use', |
|
key => 'key access', |
|
ltic => 'LTI access (course)', |
|
ltid => 'LTI access (domain)' , |
|
std => 'Standard (all menus)', |
|
colls => 'Numbered collection', |
|
_self => 'Embedded', |
|
_top => 'Not embedded', |
|
no => 'Not in use', |
|
yes => 'In use, no URL redirect', |
|
url => 'In use, redirect to URL', |
|
); |
|
%selectnull = &Apache::lonlocal::texthash ( |
|
ltic => 'Select Launcher', |
|
ltid => 'Select Launcher', |
|
colls => 'Select', |
|
); |
|
if ($showval =~ /,/) { |
|
%values=(); |
|
@current = split(/,/,$showval); |
|
($values{'state'}) = ($current[0] =~ /^(only|off|both)$/); |
|
($values{'others'}) = ($current[1] =~ /^(hide|unhide)$/); |
|
($values{'listing'}) = ($current[2] =~ /^(full|absent|grades|details|datestatus)$/); |
|
($values{'scope'}) = ($current[3] =~ /^(res|map|rec)$/); |
|
($values{'protect'}) = ($current[4] =~ /^(key:[a-zA-Z\d_.!\@#\$%^&*()+=-]+|ltic:\d+|ltid:\d+)$/); |
|
($values{'menus'}) = ($current[5] =~ /^(\d+)$/); |
|
($values{'target'}) = ($current[6] =~ /^(_self|_top)$/); |
|
($values{'exit'}) = ($current[7] =~ /^((?:(?:yes|url)(?:|\:[^:;"',]+))|no)$/); |
|
} else { |
|
$defaults{'state'} = 'off', |
|
$defaults{'others'} = 'unhide', |
|
$defaults{'listing'} = 'full'; |
|
$defaults{'scope'} = 'res'; |
|
$defaults{'protect'} = 'none'; |
|
$defaults{'menus'} = '0'; |
|
$defaults{'target'} = '_top'; |
|
$defaults{'exit'} = 'yes'; |
|
} |
|
my $disabled; |
|
if ($readonly) { |
|
$disabled=' disabled="disabled"'; |
|
} |
|
my %courselti = |
|
&Apache::lonnet::get_course_lti($env{'course.'.$env{'request.course.id'}.'.num'}, |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
'provider'); |
|
foreach my $item (keys(%courselti)) { |
|
if (ref($courselti{$item}) eq 'HASH') { |
|
$crslti{$item} = $courselti{$item}{'name'}; |
|
} |
|
} |
|
my %lti = |
|
&Apache::lonnet::get_domain_lti($env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
'linkprot'); |
|
foreach my $item (keys(%lti)) { |
|
if (($item =~ /^\d+$/) && (ref($lti{$item}) eq 'HASH')) { |
|
$domlti{$item} = $lti{$item}{'name'}; |
|
} |
|
} |
|
if ($env{'course.'.$env{'request.course.id'}.'.menucollections'}) { |
|
foreach my $item (split(/;/,$env{'course.'.$env{'request.course.id'}.'.menucollections'})) { |
|
my ($num,$value) = split(/\%/,$item); |
|
if ($num =~ /^\d+$/) { |
|
push(@possmenus,$num); |
|
} |
|
} |
|
} |
|
|
|
my $output = '<input type="hidden" name="set_'.$thiskey.'" />'; |
|
foreach my $table ('upper','lower') { |
|
next unless (ref($components{$table}) eq 'ARRAY'); |
|
$output .= '<table width="100%"><tr>'; |
|
foreach my $item (@{$components{$table}}) { |
|
$output .= '<th>'.$titles{$item}.'</th>'; |
|
} |
|
$output .= '</tr><tr>'; |
|
foreach my $item (@{$components{$table}}) { |
|
$output .= '<td>'; |
|
if (($item eq 'protect') || ($item eq 'menus') || ($item eq 'exit')) { |
|
my $selected = $values{$item}; |
|
foreach my $option (@{$options{$item}}) { |
|
if ($item eq 'protect') { |
|
if ($option eq 'ltid') { |
|
next unless (keys(%domlti)); |
|
} elsif ($option eq 'ltic') { |
|
next unless (keys(%crslti)); |
|
} |
|
} elsif (($item eq 'menus') && ($option eq 'colls')) { |
|
next unless (@possmenus); |
|
} |
|
my $checked; |
|
if ($item eq 'menus') { |
|
if (($selected =~ /^\d+$/) && (@possmenus) && |
|
(grep(/^\Q$selected\E$/,@possmenus))) { |
|
if ($option eq 'colls') { |
|
$checked = ' checked="checked"'; |
|
} |
|
} elsif (($option eq 'std') && ($selected == 0) && ($selected ne '')) { |
|
$checked = ' checked="checked"'; |
|
} |
|
} elsif ($selected =~ /^\Q$option\E/) { |
|
$checked = ' checked="checked"'; |
|
} |
|
my $onclick; |
|
unless ($readonly) { |
|
my $esc_key = &js_escape($thiskey); |
|
$onclick = ' onclick="toggleDeepLink(this.form,'."'$item','$esc_key'".');"'; |
|
} |
|
$output .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="deeplink_'.$item.'_'.$thiskey.'" value="'.$option.'"'.$onclick.$disabled.$checked.' />'."\n". |
|
$optiontext{$option}.'</label>'; |
|
if (($item eq 'protect') && ($option eq 'key')) { |
|
my $visibility="hidden"; |
|
my $currkey; |
|
if ($checked) { |
|
$visibility = "text"; |
|
$currkey = (split(/\:/,$values{$item}))[1]; |
|
} |
|
$output .= ' '. |
|
'<input type="'.$visibility.'" name="deeplink_'.$option.'_'.$thiskey.'" id="deeplink_'.$option.'_'.$item.'_'.$thiskey.'" value="'.$currkey.'" size="10"'.$disabled.' />'; |
|
} elsif (($option eq 'ltic') || ($option eq 'ltid') || ($option eq 'colls')) { |
|
my $display="none"; |
|
my ($current,$blankcheck,@possibles); |
|
if ($checked) { |
|
$display = 'inline-block'; |
|
if (($option eq 'ltic') || ($option eq 'ltid')) { |
|
$current = (split(/\:/,$selected))[1]; |
|
} else { |
|
$current = $selected; |
|
} |
|
} else { |
|
$blankcheck = ' selected="selected"'; |
|
} |
|
if ($option eq 'ltid') { |
|
@possibles = keys(%domlti); |
|
} elsif ($option eq 'ltic') { |
|
@possibles = keys(%crslti); |
|
} else { |
|
@possibles = @possmenus; |
|
} |
|
$output .= '<div id="deeplinkdiv_'.$option.'_'.$item.'_'.$thiskey.'"'. |
|
' style="display: '.$display.'"> <select name="'. |
|
'deeplink_'.$option.'_'.$thiskey.'"'.$disabled.'>'; |
|
if (@possibles > 1) { |
|
$output .= '<option value=""'.$blankcheck.'>'.$selectnull{$option}. |
|
'</option>'."\n"; |
|
} |
|
foreach my $poss (sort { $a <=> $b } @possibles) { |
|
my $selected; |
|
if (($poss == $current) || (scalar(@possibles) ==1)) { |
|
$selected = ' selected="selected"'; |
|
} |
|
my $shown = $poss; |
|
if ($option eq 'ltid') { |
|
$shown = $domlti{$poss}; |
|
} elsif ($option eq 'ltic') { |
|
$shown = $crslti{$poss}; |
|
} |
|
$output .= '<option value="'.$poss.'"'.$selected.'>'.$shown.'</option>'; |
|
} |
|
$output .= '</select></div>'; |
|
} |
|
$output .= '</span> '; |
|
} |
|
if ($item eq 'exit') { |
|
my $exitsty = 'none'; |
|
my $displayval; |
|
if ($values{$item} =~ /^(yes|url)/) { |
|
$exitsty = 'inline-block'; |
|
my $currval = (split(/\:/,$values{$item}))[1]; |
|
if ($currval eq '') { |
|
$displayval = 'Exit Tool'; |
|
} else { |
|
$displayval = $currval; |
|
} |
|
} |
|
$output .= '<div id="deeplinkdiv_'.$item.'_'.$thiskey.'"'. |
|
' style="display: '.$exitsty.'"><br />'.&mt('Button text').': '. |
|
'<input type="text" name="deeplink_exittext_'.$thiskey.'"'. |
|
' id="deeplink_exittext_'.$thiskey.'" value="'.$displayval.'"'. |
|
' size="10"'.$disabled.' /></div>'; |
|
} |
|
} else { |
|
my $selected = $values{$item}; |
|
my $defsel; |
|
if ($selected eq '') { |
|
$defsel = ' selected="selected"'; |
|
} |
|
$output .= '<select name="deeplink_'.$item.'_'.$thiskey.'"'.$disabled.'>'."\n". |
|
'<option value=""'.$defsel.'>'.&mt('Please select').'</option>'."\n"; |
|
foreach my $option (@{$options{$item}}) { |
|
$output .= '<option value="'.$option.'"'; |
|
if ($option eq $selected) { |
|
$output .= ' selected="selected"'; |
|
} |
|
$output .= '>'.$optiontext{$option}.'</option>'; |
|
} |
|
$output .= '</select>'; |
|
} |
|
$output .= '</td>'; |
|
} |
|
$output .= '</tr></table>'."\n"; |
|
if ($table eq 'upper') { |
|
$output .= '<br />'; |
|
} |
|
} |
|
return $output; |
|
} |
} |
|
|
{ |
|
|
|
my %strings = |
my %strings = |
( |
( |
'string_yesno' |
'string_yesno' |
Line 4358 my %strings =
|
Line 3165 my %strings =
|
=> [[ 'problem', 'Standard Problem'], |
=> [[ 'problem', 'Standard Problem'], |
[ 'survey', 'Survey'], |
[ 'survey', 'Survey'], |
[ 'anonsurveycred', 'Anonymous Survey (credit for submission)'], |
[ 'anonsurveycred', 'Anonymous Survey (credit for submission)'], |
[ 'exam', 'Exam'], |
[ 'exam', 'Bubblesheet Exam'], |
[ 'anonsurvey', 'Anonymous Survey'], |
[ 'anonsurvey', 'Anonymous Survey'], |
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], |
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], |
[ 'practice', 'Practice'], |
[ 'practice', 'Practice'], |
Line 4371 my %strings =
|
Line 3178 my %strings =
|
=> [['yes','Yes'], |
=> [['yes','Yes'], |
['notended','Yes, unless discussion ended'], |
['notended','Yes, unless discussion ended'], |
['no','No']], |
['no','No']], |
'string_ip' |
|
=> [['_allowfrom_','Hostname(s), or IP(s) from which access is allowed'], |
|
['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']], |
|
'string_deeplink' |
|
=> [['on','Set choices for link protection, resource listing, access scope, shown menu items, embedding, and exit link']], |
|
); |
); |
|
|
my %stringmatches = ( |
|
'string_ip' |
|
=> [['_allowfrom_','[^\!]+'], |
|
['_denyfrom_','\!']], |
|
'string_deeplink' |
|
=> [['on','^(only|off|both)\,(hide|unhide)\,(full|absent|grades|details|datestatus)\,(res|map|rec)\,(none|key\:\w+|ltic\:\d+|ltid\:\d+)\,(\d+|)\,_(self|top),(yes|url|no)(|:[^:;\'",]+)$']], |
|
); |
|
|
|
my %stringtypes = ( |
|
type => 'string_questiontype', |
|
lenient => 'string_lenient', |
|
retrypartial => 'string_yesno', |
|
discussvote => 'string_discussvote', |
|
examcode => 'string_examcode', |
|
acc => 'string_ip', |
|
deeplink => 'string_deeplink', |
|
); |
|
|
|
sub standard_string_options { |
sub standard_string_options { |
my ($string_type) = @_; |
my ($string_type) = @_; |
if (ref($strings{$string_type}) eq 'ARRAY') { |
if (ref($strings{$string_type}) eq 'ARRAY') { |
Line 4404 sub standard_string_options {
|
Line 3188 sub standard_string_options {
|
return; |
return; |
} |
} |
|
|
sub standard_string_matches { |
|
my ($string_type) = @_; |
|
if (ref($stringmatches{$string_type}) eq 'ARRAY') { |
|
return $stringmatches{$string_type}; |
|
} |
|
return; |
|
} |
|
|
|
sub string_selector { |
sub string_selector { |
my ($thistype, $thiskey, $showval, $name, $readonly) = @_; |
my ($thistype, $thiskey, $showval, $name) = @_; |
|
|
if (!exists($strings{$thistype})) { |
if (!exists($strings{$thistype})) { |
return &default_selector($thiskey,$showval,$readonly); |
return &default_selector($thiskey,$showval); |
} |
} |
|
|
my %skiptype; |
my %skiptype; |
Line 4435 sub string_selector {
|
Line 3211 sub string_selector {
|
$got_chostname = 1; |
$got_chostname = 1; |
} |
} |
my $needsnewer=¶meter_releasecheck($name,$parmval,$needsrelease, |
my $needsnewer=¶meter_releasecheck($name,$parmval,$needsrelease, |
$cmajor,$cminor); |
$chostname,$cmajor, |
|
$cminor); |
if ($needsnewer) { |
if ($needsnewer) { |
$skiptype{$parmval} = 1; |
$skiptype{$parmval} = 1; |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
|
|
if ($thistype eq 'string_ip') { |
my $result; |
return &string_ip_selector($thiskey,$showval,$readonly); |
|
} elsif ($thistype eq 'string_deeplink') { |
|
return &string_deeplink_selector($thiskey,$showval,$readonly); |
|
} |
|
|
|
my ($result,$disabled); |
|
|
|
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
|
my $numinrow = 3; |
my $numinrow = 3; |
if ($thistype eq 'string_problemstatus') { |
if ($thistype eq 'string_problemstatus') { |
$numinrow = 2; |
$numinrow = 2; |
Line 4479 sub string_selector {
|
Line 3247 sub string_selector {
|
$result .= '<td class="LC_left_item">'. |
$result .= '<td class="LC_left_item">'. |
'<span class="LC_nobreak"><label>'. |
'<span class="LC_nobreak"><label>'. |
'<input type="radio" name="set_'.$thiskey. |
'<input type="radio" name="set_'.$thiskey. |
'" value="'.$name.'"'.$disabled; |
'" value="'.$name.'"'; |
if ($showval eq $name) { |
if ($showval eq $name) { |
$result .= ' checked="checked"'; |
$result .= ' checked="checked"'; |
} |
} |
Line 4502 sub string_selector {
|
Line 3270 sub string_selector {
|
return $result; |
return $result; |
} |
} |
|
|
sub oldversion_warning { |
|
my ($name,$value,$chostname,$cmajor,$cminor,$needsrelease) = @_; |
|
my $desc; |
|
my %stringtypes = ( |
|
type => 'string_questiontype', |
|
lenient => 'string_lenient', |
|
retrypartial => 'string_yesno', |
|
discussvote => 'string_discussvote', |
|
examcode => 'string_examcode', |
|
); |
|
if (exists($stringtypes{$name})) { |
|
if ($name eq 'examcode') { |
|
$desc = $value; |
|
} elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') { |
|
foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) { |
|
next unless (ref($possibilities) eq 'ARRAY'); |
|
my ($parmval, $description) = @{ $possibilities }; |
|
if ($parmval eq $value) { |
|
$desc = $description; |
|
last; |
|
} |
|
} |
|
} |
|
} elsif (($name eq 'printstartdate') || ($name eq 'printenddate')) { |
|
my $now = time; |
|
if ($value =~ /^\d+$/) { |
|
if ($name eq 'printstartdate') { |
|
if ($value > $now) { |
|
$desc = &Apache::lonlocal::locallocaltime($value); |
|
} |
|
} elsif ($name eq 'printenddate') { |
|
if ($value < $now) { |
|
$desc = &Apache::lonlocal::locallocaltime($value); |
|
} |
|
} |
|
} |
|
} |
|
my $standard_name = &standard_parameter_names($name); |
|
return '<p class="LC_warning">'. |
|
&mt('[_1] was [_2]not[_3] set to [_4].', |
|
$standard_name,'<b>','</b>','"'.$desc.'"').'<br />'. |
|
&mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).', |
|
$cmajor.'.'.$cminor,$chostname, |
|
$needsrelease). |
|
'</p>'; |
|
} |
|
|
|
} |
|
|
|
# |
# |
# Shift all start and end dates by $shift |
# Shift all start and end dates by $shift |
# |
# |
|
|
sub dateshift { |
sub dateshift { |
my ($shift,$numchanges)=@_; |
my ($shift)=@_; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $sec = $env{'request.course.sec'}; |
|
my $secgrpregex; |
|
if ($sec ne '') { |
|
my @groups; |
|
if ($env{'request.course.groups'} ne '') { |
|
@groups = split(/:/,$env{'request.course.groups'}); |
|
} |
|
if (@groups) { |
|
$secgrpregex = '(?:'.join('|',($sec,@groups)).')'; |
|
} else { |
|
$secgrpregex = $sec; |
|
} |
|
} |
|
my %data=&Apache::lonnet::dump('resourcedata',$dom,$crs); |
my %data=&Apache::lonnet::dump('resourcedata',$dom,$crs); |
# ugly retro fix for broken version of types |
# ugly retro fix for broken version of types |
foreach my $key (keys %data) { |
foreach my $key (keys %data) { |
Line 4586 sub dateshift {
|
Line 3292 sub dateshift {
|
# go through all parameters and look for dates |
# go through all parameters and look for dates |
foreach my $key (keys %data) { |
foreach my $key (keys %data) { |
if ($data{$key.'.type'}=~/^date_(start|end)$/) { |
if ($data{$key.'.type'}=~/^date_(start|end)$/) { |
if ($sec ne '') { |
|
next unless ($key =~ /^$env{'request.course.id'}\.\[$secgrpregex\]\./); |
|
} |
|
my $newdate=$data{$key}+$shift; |
my $newdate=$data{$key}+$shift; |
$$numchanges ++; |
|
$storecontent{$key}=$newdate; |
$storecontent{$key}=$newdate; |
} |
} |
} |
} |
Line 4604 sub dateshift {
|
Line 3306 sub dateshift {
|
} |
} |
|
|
sub newoverview { |
sub newoverview { |
my ($r,$parm_permission) = @_; |
my ($r) = @_; |
|
|
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $readonly = 1; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
if ($parm_permission->{'edit'}) { |
|
undef($readonly); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
text=>"Overview Mode"}); |
text=>"Overview Mode"}); |
|
|
Line 4624 sub newoverview {
|
Line 3323 sub newoverview {
|
'. |
'. |
&Apache::lonhtmlcommon::resize_scrollbox_js('params')."\n". |
&Apache::lonhtmlcommon::resize_scrollbox_js('params')."\n". |
&showhide_js()."\n". |
&showhide_js()."\n". |
&validateparms_js()."\n". |
|
&ipacc_boxes_js()."\n". |
|
&done_proctor_js()."\n". |
|
&deeplink_js()."\n". |
|
'// ]]> |
'// ]]> |
</script> |
</script> |
'; |
'; |
Line 4635 sub newoverview {
|
Line 3330 sub newoverview {
|
{'add_entries' => \%loaditems,}); |
{'add_entries' => \%loaditems,}); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform" onsubmit="return validateParms();"> |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform"> |
ENDOVER |
ENDOVER |
my @ids=(); |
my @ids=(); |
my %typep=(); |
my %typep=(); |
Line 4663 ENDOVER
|
Line 3359 ENDOVER
|
my $pschp=$env{'form.pschp'}; |
my $pschp=$env{'form.pschp'}; |
|
|
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
if (!@psprt) { $psprt[0]='0'; } |
if (!@psprt) { $psprt[0]='all'; } |
|
|
my @selected_sections = |
my @selected_sections = |
&Apache::loncommon::get_env_multiple('form.Section'); |
&Apache::loncommon::get_env_multiple('form.Section'); |
Line 4673 ENDOVER
|
Line 3369 ENDOVER
|
@selected_sections = ('all'); |
@selected_sections = ('all'); |
} |
} |
} |
} |
if ($env{'request.course.sec'} ne '') { |
|
@selected_sections = ($env{'request.course.sec'}); |
|
} |
|
my @selected_groups = |
my @selected_groups = |
&Apache::loncommon::get_env_multiple('form.Group'); |
&Apache::loncommon::get_env_multiple('form.Group'); |
|
|
Line 4702 ENDOVER
|
Line 3395 ENDOVER
|
$r->print('<div>'); |
$r->print('<div>'); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
if ($parmlev ne 'general') { |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp,$parmlev); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
|
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp); |
|
} |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print('</div></div>'); |
$r->print('</div></div>'); |
Line 4713 ENDOVER
|
Line 3408 ENDOVER
|
&displaymenu($r,\%allparms,\@pscat,\%keyorder); |
&displaymenu($r,\%allparms,\@pscat,\%keyorder); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
my $sectionselector = §ionmenu(\@selected_sections); |
|
my $groupselector = &groupmenu(\@selected_groups); |
|
$r->print('<table>'. |
$r->print('<table>'. |
'<tr><th>'.&mt('Parts').'</th>'); |
'<tr><th>'.&mt('Parts').'</th><th>'.&mt('Section(s)'). |
if ($sectionselector) { |
'</th><th>'.&mt('Group(s)').'</th></tr><tr><td>'); |
$r->print('<th>'.&mt('Section(s)').'</th>'); |
|
} |
|
if ($groupselector) { |
|
$r->print('<th>'.&mt('Group(s)').'</th>'); |
|
} |
|
$r->print('</tr><tr><td>'); |
|
&partmenu($r,\%allparts,\@psprt); |
&partmenu($r,\%allparts,\@psprt); |
$r->print('</td>'); |
$r->print('</td><td>'); |
if ($sectionselector) { |
§ionmenu($r,\@selected_sections); |
$r->print('<td>'.$sectionselector.'</td>'); |
$r->print('</td><td>'); |
} |
&groupmenu($r,\@selected_groups); |
if ($groupselector) { |
$r->print('</td></tr></table>'); |
$r->print('<td>'.$groupselector.'</td>'); |
#$r->print('</td></tr></table>'); |
} |
|
$r->print('</tr></table>'); |
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print('</div></div>'); |
$r->print('</div></div>'); |
Line 4766 ENDOVER
|
Line 3451 ENDOVER
|
|
|
# List data |
# List data |
|
|
&listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly,$parmlev); |
&listdata($r,$resourcedata,$listdata,$sortorder); |
} |
} |
$r->print(&tableend()); |
$r->print(&tableend(). |
unless ($readonly) { |
((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':''). |
$r->print(((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':'')); |
'</form>'); |
} |
&endSettingsScreen($r); |
$r->print('</form>'); |
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 4812 sub secgroup_lister {
|
Line 3496 sub secgroup_lister {
|
} |
} |
|
|
sub overview { |
sub overview { |
my ($r,$parm_permission) = @_; |
my ($r) = @_; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
my $js = '<script type="text/javascript">'."\n". |
|
'// <![CDATA['."\n". |
|
&done_proctor_js()."\n". |
|
&validateparms_js()."\n". |
|
&ipacc_boxes_js()."\n". |
|
&deeplink_js()."\n". |
|
'// ]]>'."\n". |
|
'</script>'."\n"; |
|
my $readonly = 1; |
|
if ($parm_permission->{'edit'}) { |
|
undef($readonly); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
text=>"Overview Mode"}); |
text=>"Overview Mode"}); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters',$js); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
$r->print('<form method="post" action="/adm/parmset?action=setoverview" name="parmform" onsubmit="return validateParms();">'); |
&startSettingsScreen($r,'parmset',$crstype); |
|
$r->print('<form method="post" action="/adm/parmset?action=setoverview" name="parmform">'); |
|
|
# Store modified |
# Store modified |
unless ($readonly) { |
|
&storedata($r,$crs,$dom); |
&storedata($r,$crs,$dom); |
} |
|
|
|
# Read modified data |
# Read modified data |
|
|
my ($resourcedata,$classlist)=&readdata($crs,$dom); |
my $resourcedata=&readdata($crs,$dom); |
|
|
|
|
my $sortorder=$env{'form.sortorder'}; |
my $sortorder=$env{'form.sortorder'}; |
unless ($sortorder) { $sortorder='realmstudent'; } |
unless ($sortorder) { $sortorder='realmstudent'; } |
&sortmenu($r,$sortorder); |
&sortmenu($r,$sortorder); |
|
|
my $submitbutton = '<input type="submit" value="'.&mt('Save').'" />'; |
|
|
|
if ($readonly) { |
|
$r->print('<p>'.$submitbutton.'</p>'); |
|
} |
|
|
|
|
|
# List data |
# List data |
|
|
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder,'overview',$classlist,$readonly); |
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder); |
|
|
$r->print(&tableend().'<p>'); |
$r->print(&tableend().'<p>'. |
if ($foundkeys) { |
($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':'<span class="LC_info">'.&mt('There are no parameters.').'</span>').'</p></form>'. |
unless ($readonly) { |
&Apache::loncommon::end_page()); |
$r->print('<p>'.$submitbutton.'</p>'); |
|
} |
|
} else { |
|
$r->print('<p class="LC_info">'.&mt('There are no parameters.').'</p>'); |
|
} |
|
$r->print('</form>'.&Apache::loncommon::end_page()); |
|
} |
} |
|
|
sub clean_parameters { |
sub clean_parameters { |
Line 4930 ENDOVER
|
Line 3590 ENDOVER
|
$r->print(&mt('All users')); |
$r->print(&mt('All users')); |
} elsif ($data{'scope_type'} eq 'user') { |
} elsif ($data{'scope_type'} eq 'user') { |
$r->print(&mt('User: [_1]',join(':',@{$data{'scope'}}))); |
$r->print(&mt('User: [_1]',join(':',@{$data{'scope'}}))); |
} elsif ($data{'scope_type'} eq 'secgroup') { |
} elsif ($data{'scope_type'} eq 'section') { |
$r->print(&mt('Group/Section: [_1]',$data{'scope'})); |
$r->print(&mt('Section: [_1]',$data{'scope'})); |
|
} elsif ($data{'scope_type'} eq 'group') { |
|
$r->print(&mt('Group: [_1]',$data{'scope'})); |
} |
} |
$r->print('<br />'); |
$r->print('<br />'); |
if ($data{'realm_type'} eq 'all') { |
if ($data{'realm_type'} eq 'all') { |
Line 4942 ENDOVER
|
Line 3604 ENDOVER
|
my ($map,$resid,$url) = |
my ($map,$resid,$url) = |
&Apache::lonnet::decode_symb($data{'realm'}); |
&Apache::lonnet::decode_symb($data{'realm'}); |
$r->print(&mt('Resource: [_1]with ID: [_2]in folder [_3]', |
$r->print(&mt('Resource: [_1]with ID: [_2]in folder [_3]', |
$url.' <br /> ', |
$url.' <br /> ', |
$resid.' <br /> ',$map)); |
$resid.' <br /> ',$map)); |
} |
} |
$r->print(' <br /> '.&mt('Part: [_1]',$data{'parameter_part'})); |
$r->print(' <br /> '.&mt('Part: [_1]',$data{'parameter_part'})); |
$r->print('</td></tr>'); |
$r->print('</td></tr>'); |
Line 4953 ENDOVER
|
Line 3615 ENDOVER
|
$r->print(&Apache::loncommon::end_data_table().'<p>'. |
$r->print(&Apache::loncommon::end_data_table().'<p>'. |
'<input type="submit" value="'.&mt('Delete Selected').'" />'. |
'<input type="submit" value="'.&mt('Delete Selected').'" />'. |
'</p></form>'); |
'</p></form>'); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 4960 sub date_shift_one {
|
Line 3623 sub date_shift_one {
|
my ($r) = @_; |
my ($r) = @_; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $sec = $env{'request.course.sec'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
text=>"Shifting Dates"}); |
text=>"Shifting Dates"}); |
my $submit_text = &mt('Shift all dates accordingly'); |
|
if ($sec ne '') { |
|
my @groups; |
|
if ($env{'request.course.groups'} ne '') { |
|
@groups = split(/:/,$env{'request.course.groups'}); |
|
} |
|
if (@groups) { |
|
$submit_text = &mt("Shift dates set just for your section/group(s), accordingly"); |
|
} else { |
|
$submit_text = &mt("Shift dates set just for your section, accordingly"); |
|
} |
|
} |
|
my $start_page=&Apache::loncommon::start_page('Shift Dates'); |
my $start_page=&Apache::loncommon::start_page('Shift Dates'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
$r->print('<form name="shiftform" method="post" action="">'. |
&startSettingsScreen($r,'parmset',$crstype); |
|
$r->print('<form name="shiftform" method="post">'. |
'<table><tr><td>'.&mt('Currently set date:').'</td><td>'. |
'<table><tr><td>'.&mt('Currently set date:').'</td><td>'. |
&Apache::lonlocal::locallocaltime($env{'form.timebase'}).'</td></tr>'. |
&Apache::lonlocal::locallocaltime($env{'form.timebase'}).'</td></tr>'. |
'<tr><td>'.&mt('Shifted date:').'</td><td>'. |
'<tr><td>'.&mt('Shifted date:').'</td><td>'. |
&Apache::lonhtmlcommon::date_setter('shiftform', |
&Apache::lonhtmlcommon::dshowerfuck.net |
|
ate_setter('shiftform', |
'timeshifted', |
'timeshifted', |
$env{'form.timebase'},, |
$env{'form.timebase'},, |
''). |
''). |
'</td></tr></table>'. |
'</td></tr></table>'. |
'<input type="hidden" name="action" value="dateshift2" />'. |
'<input type="hidden" name="action" value="dateshift2" />'. |
'<input type="hidden" name="timebase" value="'.$env{'form.timebase'}.'" />'. |
'<input type="hidden" name="timebase" value="'.$env{'form.timebase'}.'" />'. |
'<input type="submit" value="'.$submit_text.'" /></form>'); |
'<input type="submit" value="'.&mt('Shift all dates accordingly').'" /></form>'); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 4997 sub date_shift_two {
|
Line 3652 sub date_shift_two {
|
my ($r) = @_; |
my ($r) = @_; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $sec = $env{'request.course.sec'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
text=>"Shifting Dates"}); |
text=>"Shifting Dates"}); |
my $start_page=&Apache::loncommon::start_page('Shift Dates'); |
my $start_page=&Apache::loncommon::start_page('Shift Dates'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted'); |
my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted'); |
$r->print('<h2>'.&mt('Shift Dates').'</h2>'); |
$r->print(&mt('Shifting all dates such that [_1] becomes [_2]', |
if ($sec ne '') { |
&Apache::lonlocal::locallocaltime($env{'form.timebase'}), |
my @groups; |
&Apache::lonlocal::locallocaltime($timeshifted))); |
if ($env{'request.course.groups'} ne '') { |
|
@groups = split(/:/,$env{'request.course.groups'}); |
|
} |
|
if (@groups) { |
|
$r->print('<p>'. |
|
&mt("Shift dates set just for your section/group(s), such that [_1] becomes [_2]", |
|
&Apache::lonlocal::locallocaltime($env{'form.timebase'}), |
|
&Apache::lonlocal::locallocaltime($timeshifted)). |
|
'</p>'); |
|
} else { |
|
$r->print('<p>'. |
|
&mt("Shift dates set just for your section, such that [_1] becomes [_2]", |
|
&Apache::lonlocal::locallocaltime($env{'form.timebase'}), |
|
&Apache::lonlocal::locallocaltime($timeshifted)). |
|
'</p>'); |
|
} |
|
} else { |
|
$r->print('<p>'.&mt('Shifting all dates such that [_1] becomes [_2]', |
|
&Apache::lonlocal::locallocaltime($env{'form.timebase'}), |
|
&Apache::lonlocal::locallocaltime($timeshifted)). |
|
'</p>'); |
|
} |
|
my $delta=$timeshifted-$env{'form.timebase'}; |
my $delta=$timeshifted-$env{'form.timebase'}; |
my $numchanges = 0; |
&dateshift($delta); |
my $result = &dateshift($delta,\$numchanges); |
&endSettingsScreen($r); |
if ($result eq 'ok') { |
|
$r->print( |
|
&Apache::lonhtmlcommon::confirm_success(&mt('Completed shifting of [quant,_1,date setting]', |
|
$numchanges))); |
|
} elsif ($result eq 'con_delayed') { |
|
$r->print( |
|
&Apache::lonhtmlcommon::confirm_success(&mt('Queued shifting of [quant,_1,date setting]', |
|
$numchanges))); |
|
} else { |
|
$r->print( |
|
&Apache::lonhtmlcommon::confirm_success(&mt('An error occurred attempting to shift dates'),1)); |
|
} |
|
$r->print( |
|
'<br /><br />'. |
|
&Apache::lonhtmlcommon::actionbox( |
|
['<a href="/adm/parmset">'.&mt('Content and Problem Settings').'</a>'])); |
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 5063 sub parse_key {
|
Line 3681 sub parse_key {
|
$data{'scope_type'} = 'user'; |
$data{'scope_type'} = 'user'; |
$data{'scope'} = [$1,$2]; |
$data{'scope'} = [$1,$2]; |
} else { |
} else { |
$data{'scope_type'} = 'secgroup'; |
#FIXME check for group scope |
|
$data{'scope_type'} = 'section'; |
} |
} |
$middle=~s/^\[(.*)\]//; |
$middle=~s/^\[(.*)\]//; |
} |
} |
Line 5091 sub parse_key {
|
Line 3710 sub parse_key {
|
|
|
|
|
sub header { |
sub header { |
return &Apache::loncommon::start_page('Content and Problem Settings'); |
return &Apache::loncommon::start_page('Settings'); |
} |
} |
|
|
|
|
Line 5104 sub print_main_menu {
|
Line 3723 sub print_main_menu {
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $lc_crstype = lc($crstype); |
my $lc_crstype = lc($crstype); |
|
|
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print(<<ENDMAINFORMHEAD); |
$r->print(<<ENDMAINFORMHEAD); |
<form method="post" enctype="multipart/form-data" |
<form method="post" enctype="multipart/form-data" |
action="/adm/parmset" name="studentform"> |
action="/adm/parmset" name="studentform"> |
Line 5114 ENDMAINFORMHEAD
|
Line 3734 ENDMAINFORMHEAD
|
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $mgr = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
my $mgr = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
my $dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}); |
my $dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}); |
my $vcb = &Apache::lonnet::allowed('vcb',$env{'request.course.id'}); |
|
my $vpa = &Apache::lonnet::allowed('vpa',$env{'request.course.id'}); |
|
if ((!$dcm) && ($env{'request.course.sec'} ne '')) { |
if ((!$dcm) && ($env{'request.course.sec'} ne '')) { |
$dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}. |
$dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}. |
'/'.$env{'request.course.sec'}); |
'/'.$env{'request.course.sec'}); |
} |
} |
if ((!$vcb) && ($env{'request.course.sec'} ne '')) { |
|
$vcb = &Apache::lonnet::allowed('vcb',$env{'request.course.id'}. |
|
'/'.$env{'request.course.sec'}); |
|
} |
|
my (%linktext,%linktitle,%url); |
|
if ($parm_permission->{'edit'}) { |
|
%linktext = ( |
|
newoverview => 'Edit Resource Parameters - Overview Mode', |
|
settable => 'Edit Resource Parameters - Table Mode', |
|
setoverview => 'Modify Resource Parameters - Overview Mode', |
|
); |
|
%linktitle = ( |
|
newoverview => 'Set/Modify resource parameters in overview mode.', |
|
settable => 'Set/Modify resource parameters in table mode.', |
|
setoverview => 'Set/Modify existing resource parameters in overview mode.', |
|
); |
|
} else { |
|
%linktext = ( |
|
newoverview => 'View Resource Parameters - Overview Mode', |
|
settable => 'View Resource Parameters - Table Mode', |
|
setoverview => 'View Resource Parameters - Overview Mode', |
|
); |
|
%linktitle = ( |
|
newoverview => 'Display resource parameters in overview mode.', |
|
settable => 'Display resource parameters in table mode.', |
|
setoverview => 'Display existing resource parameters in overview mode.', |
|
); |
|
} |
|
if ($mgr) { |
|
$linktext{'resettimes'} = 'Reset Student Access Times'; |
|
$linktitle{'resettimes'} = "Reset access times for folders/maps, resources or the $lc_crstype."; |
|
$url{'resettimes'} = '/adm/helper/resettimes.helper'; |
|
} elsif ($vgr) { |
|
$linktext{'resettimes'} = 'Display Student Access Times', |
|
$linktitle{'resettimes'} = "Display access times for folders/maps, resources or the $lc_crstype.", |
|
$url{'resettimes'} = '/adm/accesstimes'; |
|
} |
|
my @menu = |
my @menu = |
( { categorytitle=>"Content Settings for this $crstype", |
( { categorytitle=>"Content Settings for this $crstype", |
items => [ |
items => [ |
{ linktext => 'Portfolio Metadata', |
{ linktext => 'Portfolio Metadata', |
url => '/adm/parmset?action=setrestrictmeta', |
url => '/adm/parmset?action=setrestrictmeta', |
permission => $parm_permission->{'setrestrictmeta'}, |
permission => $parm_permission, |
linktitle => "Restrict metadata for this $lc_crstype." , |
linktitle => "Restrict metadata for this $lc_crstype." , |
icon =>'contact-new.png' , |
icon =>'contact-new.png' , |
}, |
}, |
{ linktext => $linktext{'resettimes'}, |
{ linktext => 'Reset Student Access Times', |
url => $url{'resettimes'}, |
url => '/adm/helper/resettimes.helper', |
permission => ($vgr || $mgr), |
permission => $mgr, |
linktitle => $linktitle{'resettimes'}, |
linktitle => "Reset access times for folders/maps, resources or the $lc_crstype." , |
icon => 'start-here.png', |
icon => 'start-here.png' , |
}, |
}, |
{ linktext => 'Blocking Communication/Resource Access', |
{ linktext => 'Blocking Communication/Resource Access', |
url => '/adm/setblock', |
url => '/adm/setblock', |
permission => ($vcb || $dcm), |
permission => $dcm, |
linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam', |
linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam', |
icon => 'comblock.png', |
icon => 'comblock.png', |
}, |
}, |
{ linktext => 'Set Parameter Setting Default Actions', |
{ linktext => 'Set Parameter Setting Default Actions', |
url => '/adm/parmset?action=setdefaults', |
url => '/adm/parmset?action=setdefaults', |
permission => $parm_permission->{'setdefaults'}, |
permission => $parm_permission, |
linktitle =>'Set default actions for parameters.' , |
linktitle =>'Set default actions for parameters.' , |
icon => 'folder-new.png' , |
icon => 'folder-new.png' , |
}]}, |
}]}, |
Line 5188 ENDMAINFORMHEAD
|
Line 3770 ENDMAINFORMHEAD
|
items => [ |
items => [ |
{ linktext => 'Edit Resource Parameters - Helper Mode', |
{ linktext => 'Edit Resource Parameters - Helper Mode', |
url => '/adm/helper/parameter.helper', |
url => '/adm/helper/parameter.helper', |
permission => $parm_permission->{'helper'}, |
permission => $parm_permission, |
linktitle =>'Set/Modify resource parameters in helper mode.' , |
linktitle =>'Set/Modify resource parameters in helper mode.' , |
icon => 'dialog-information.png' , |
icon => 'dialog-information.png' , |
#help => 'Parameter_Helper', |
#help => 'Parameter_Helper', |
}, |
}, |
{ linktext => $linktext{'newoverview'}, |
{ linktext => 'Edit Resource Parameters - Overview Mode', |
url => '/adm/parmset?action=newoverview', |
url => '/adm/parmset?action=newoverview', |
permission => $parm_permission->{'newoverview'}, |
permission => $parm_permission, |
linktitle => $linktitle{'newoverview'}, |
linktitle =>'Set/Modify resource parameters in overview mode.' , |
icon => 'edit-find.png', |
icon => 'edit-find.png' , |
#help => 'Parameter_Overview', |
#help => 'Parameter_Overview', |
}, |
}, |
{ linktext => $linktext{'settable'}, |
{ linktext => 'Edit Resource Parameters - Table Mode', |
url => '/adm/parmset?action=settable', |
url => '/adm/parmset?action=settable', |
permission => $parm_permission->{'settable'}, |
permission => $parm_permission, |
linktitle => $linktitle{'settable'}, |
linktitle =>'Set/Modify resource parameters in table mode.' , |
icon => 'edit-copy.png', |
icon => 'edit-copy.png' , |
#help => 'Table_Mode', |
#help => 'Table_Mode', |
}]}, |
}]}, |
{ categorytitle => 'Existing Parameter Settings for Resources', |
{ categorytitle => 'Existing Parameter Settings for Resources', |
items => [ |
items => [ |
{ linktext => $linktext{'setoverview'}, |
{ linktext => 'Modify Resource Parameters - Overview Mode', |
url => '/adm/parmset?action=setoverview', |
url => '/adm/parmset?action=setoverview', |
permission => $parm_permission->{'setoverview'}, |
permission => $parm_permission, |
linktitle => $linktitle{'setoverview'}, |
linktitle =>'Set/Modify existing resource parameters in overview mode.' , |
icon => 'preferences-desktop-wallpaper.png', |
icon => 'preferences-desktop-wallpaper.png' , |
#help => 'Parameter_Overview', |
#help => 'Parameter_Overview', |
}, |
}, |
{ linktext => 'Change Log', |
{ linktext => 'Change Log', |
url => '/adm/parmset?action=parameterchangelog', |
url => '/adm/parmset?action=parameterchangelog', |
permission => $parm_permission->{'parameterchangelog'}, |
permission => $parm_permission, |
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , |
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , |
icon => 'document-properties.png', |
icon => 'document-properties.png', |
}]} |
}]} |
); |
); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
$r->print('</form>'.&Apache::loncommon::end_page()); |
&endSettingsScreen($r); |
return; |
return; |
} |
} |
|
|
Line 5292 sub order_meta_fields {
|
Line 3874 sub order_meta_fields {
|
my $idx = 1; |
my $idx = 1; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};; |
$r->print(&Apache::loncommon::start_page('Order Metadata Fields')); |
$r->print(&Apache::loncommon::start_page('Order Metadata Fields')); |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
text=>"Add Metadata Field"}); |
text=>"Add Metadata Field"}); |
Line 5300 sub order_meta_fields {
|
Line 3883 sub order_meta_fields {
|
text=>"Restrict Metadata"}, |
text=>"Restrict Metadata"}, |
{text=>"Order Metadata"}); |
{text=>"Order Metadata"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Order Metadata')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Order Metadata')); |
|
&startSettingsScreen($r,'parmset',$crstype); |
if ($env{'form.storeorder'}) { |
if ($env{'form.storeorder'}) { |
my $newpos = $env{'form.newpos'} - 1; |
my $newpos = $env{'form.newpos'} - 1; |
my $currentpos = $env{'form.currentpos'} - 1; |
my $currentpos = $env{'form.currentpos'} - 1; |
Line 5353 sub order_meta_fields {
|
Line 3937 sub order_meta_fields {
|
foreach my $key (@fields_in_order) { |
foreach my $key (@fields_in_order) { |
$r->print('<tr><td>'); |
$r->print('<tr><td>'); |
$r->print('<form method="post" action="">'); |
$r->print('<form method="post" action="">'); |
$r->print('<select name="newpos" onchange="this.form.submit()">'); |
$r->print('<select name="newpos" onChange="this.form.submit()">'); |
for (my $i = 1;$i le $num_fields;$i ++) { |
for (my $i = 1;$i le $num_fields;$i ++) { |
if ($i eq $idx) { |
if ($i eq $idx) { |
$r->print('<option value="'.$i.'" SELECTED>('.$i.')</option>'); |
$r->print('<option value="'.$i.'" SELECTED>('.$i.')</option>'); |
Line 5369 sub order_meta_fields {
|
Line 3953 sub order_meta_fields {
|
$idx ++; |
$idx ++; |
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |
|
&endSettingsScreen($r); |
return 'ok'; |
return 'ok'; |
} |
} |
|
|
Line 5377 sub continue {
|
Line 3962 sub continue {
|
my $output; |
my $output; |
$output .= '<form action="" method="post">'; |
$output .= '<form action="" method="post">'; |
$output .= '<input type="hidden" name="action" value="setrestrictmeta" />'; |
$output .= '<input type="hidden" name="action" value="setrestrictmeta" />'; |
$output .= '<input type="submit" value="'.&mt('Continue').'" />'; |
$output .= '<input type="submit" value="Continue" />'; |
return ($output); |
return ($output); |
} |
} |
|
|
Line 5390 sub addmetafield {
|
Line 3975 sub addmetafield {
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Add Metadata Field')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Add Metadata Field')); |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
|
&startSettingsScreen($r,'parmset',$crstype); |
if (exists($env{'form.undelete'})) { |
if (exists($env{'form.undelete'})) { |
my @meta_fields = &Apache::loncommon::get_env_multiple('form.undeletefield'); |
my @meta_fields = &Apache::loncommon::get_env_multiple('form.undeletefield'); |
foreach my $meta_field(@meta_fields) { |
foreach my $meta_field(@meta_fields) { |
Line 5399 sub addmetafield {
|
Line 3986 sub addmetafield {
|
my $put_result = &Apache::lonnet::put('environment', |
my $put_result = &Apache::lonnet::put('environment', |
{'metadata.'.$meta_field.'.options'=>$options},$dom,$crs); |
{'metadata.'.$meta_field.'.options'=>$options},$dom,$crs); |
|
|
$r->print(&mt('Undeleted Metadata Field [_1] with result [_2]', |
$r->print('Undeleted Metadata Field <strong>'.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}."</strong> with result ".$put_result.'<br />'); |
'<strong>'.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}. |
|
'</strong>',$put_result). |
|
'<br />'); |
|
} |
} |
$r->print(&continue()); |
$r->print(&continue()); |
} elsif (exists($env{'form.fieldname'})) { |
} elsif (exists($env{'form.fieldname'})) { |
Line 5414 sub addmetafield {
|
Line 3998 sub addmetafield {
|
{'metadata.'.$meta_field.'.values'=>"", |
{'metadata.'.$meta_field.'.values'=>"", |
'metadata.'.$meta_field.'.added'=>"$display_field", |
'metadata.'.$meta_field.'.added'=>"$display_field", |
'metadata.'.$meta_field.'.options'=>""},$dom,$crs); |
'metadata.'.$meta_field.'.options'=>""},$dom,$crs); |
$r->print(&mt('Added new Metadata Field [_1] with result [_2]', |
$r->print('Added new Metadata Field <strong>'.$env{'form.fieldname'}."</strong> with result ".$put_result.'<br />'); |
'<strong>'.$env{'form.fieldname'}.'</strong>',$put_result). |
|
'<br />'); |
|
$r->print(&continue()); |
$r->print(&continue()); |
} else { |
} else { |
my $fields = &get_deleted_meta_fieldnames($env{'request.course.id'}); |
my $fields = &get_deleted_meta_fieldnames($env{'request.course.id'}); |
if ($fields) { |
if ($fields) { |
$r->print(&mt('You may undelete previously deleted fields.'). |
$r->print('You may undelete previously deleted fields.<br />Check those you wish to undelete and click Undelete.<br />'); |
'<br />'. |
|
&mt('Check those you wish to undelete and click Undelete.'). |
|
'<br />'); |
|
$r->print('<form method="post" action="">'); |
$r->print('<form method="post" action="">'); |
foreach my $key(keys(%$fields)) { |
foreach my $key(keys(%$fields)) { |
$r->print('<input type="checkbox" name="undeletefield" value="'.$key.'" />'.$$fields{$key}.'<br /'); |
$r->print('<input type="checkbox" name="undeletefield" value="'.$key.'" />'.$$fields{$key}.'<br /'); |
Line 5432 sub addmetafield {
|
Line 4011 sub addmetafield {
|
$r->print('<input type="submit" name="undelete" value="Undelete" />'); |
$r->print('<input type="submit" name="undelete" value="Undelete" />'); |
$r->print('</form>'); |
$r->print('</form>'); |
} |
} |
$r->print('<hr />'. |
$r->print('<hr /><strong>Or</strong> you may enter a new metadata field name.<form method="post" action="/adm/parmset?action=addmetadata"'); |
&mt('[_1]Or[_2] you may enter a new metadata field name.', |
|
'<strong>','</strong>'). |
|
'<form method="post" action="/adm/parmset?action=addmetadata">'); |
|
$r->print('<input type="text" name="fieldname" /><br />'); |
$r->print('<input type="text" name="fieldname" /><br />'); |
$r->print('<input type="submit" value="'.&mt('Add Metadata Field').'" />'); |
$r->print('<input type="submit" value="Add Metadata Field" />'); |
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
|
&endSettingsScreen($r); |
} |
} |
|
|
|
|
Line 5456 sub setrestrictmeta {
|
Line 4033 sub setrestrictmeta {
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata')); |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
|
&startSettingsScreen($r,'parmset',$crstype); |
my $key_base = $env{'course.'.$env{'request.course.id'}.'.'}; |
my $key_base = $env{'course.'.$env{'request.course.id'}.'.'}; |
my $save_field = ''; |
my $save_field = ''; |
my %lt = &Apache::lonlocal::texthash( |
|
addm => 'Add Metadata Field', |
|
ordm => 'Order Metadata Fields', |
|
save => 'Save', |
|
); |
|
if ($env{'form.restrictmeta'}) { |
if ($env{'form.restrictmeta'}) { |
foreach my $field (sort(keys(%env))) { |
foreach my $field (sort(keys(%env))) { |
if ($field=~m/^form.(.+)_(.+)$/) { |
if ($field=~m/^form.(.+)_(.+)$/) { |
Line 5501 sub setrestrictmeta {
|
Line 4075 sub setrestrictmeta {
|
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio'); |
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio'); |
# Now get possible added metadata fields |
# Now get possible added metadata fields |
my $added_metadata_fields = &get_added_meta_fieldnames($env{'request.course.id'}); |
my $added_metadata_fields = &get_added_meta_fieldnames($env{'request.course.id'}); |
|
my $row_alt = 1; |
$output .= &Apache::loncommon::start_data_table(); |
$output .= &Apache::loncommon::start_data_table(); |
foreach my $field (sort(keys(%metadata_fields))) { |
foreach my $field (sort(keys(%metadata_fields))) { |
if ($field ne 'courserestricted') { |
if ($field ne 'courserestricted') { |
|
$row_alt = $row_alt ? 0 : 1; |
$output.= &output_row($r, $field, $metadata_fields{$field}); |
$output.= &output_row($r, $field, $metadata_fields{$field}); |
} |
} |
} |
} |
my $buttons = (<<ENDButtons); |
my $buttons = (<<ENDButtons); |
<input type="submit" name="restrictmeta" value="$lt{'save'}" /> |
<input type="submit" name="restrictmeta" value="Save" /> |
</form><br /> |
</form><br /> |
<form method="post" action="/adm/parmset?action=addmetadata" name="form1"> |
<form method="post" action="/adm/parmset?action=addmetadata" name="form1"> |
<input type="submit" name="restrictmeta" value="$lt{'addm'}" /> |
<input type="submit" name="restrictmeta" value="Add a Metadata Field" /> |
</form> |
</form> |
<br /> |
<br /> |
<form method="post" action="/adm/parmset?action=ordermetadata" name="form2"> |
<form method="post" action="/adm/parmset?action=ordermetadata" name="form2"> |
<input type="submit" name="restrictmeta" value="$lt{'ordm'}" /> |
<input type="submit" name="restrictmeta" value="Order Metadata Fields" /> |
ENDButtons |
ENDButtons |
my $added_flag = 1; |
my $added_flag = 1; |
foreach my $field (sort(keys(%$added_metadata_fields))) { |
foreach my $field (sort(keys(%$added_metadata_fields))) { |
$output.= &output_row($r,$field,$$added_metadata_fields{$field},$added_flag); |
$row_alt = $row_alt ? 0 : 1; |
|
$output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt); |
} |
} |
$output .= &Apache::loncommon::end_data_table(); |
$output .= &Apache::loncommon::end_data_table(); |
$r->print(<<ENDenv); |
$r->print(<<ENDenv); |
Line 5528 ENDButtons
|
Line 4105 ENDButtons
|
$buttons |
$buttons |
</form> |
</form> |
ENDenv |
ENDenv |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return 'ok'; |
return 'ok'; |
} |
} |
Line 5568 sub defaultsetter {
|
Line 4146 sub defaultsetter {
|
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults', |
text=>"Set Defaults"}); |
text=>"Set Defaults"}); |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Parameter Setting Default Actions'); |
&Apache::loncommon::start_page('Parameter Setting Default Actions'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print('<form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">'); |
$r->print('<form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">'); |
|
|
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my @ids=(); |
my @ids=(); |
my %typep=(); |
my %typep=(); |
my %keyp=(); |
my %keyp=(); |
Line 5629 sub defaultsetter {
|
Line 4209 sub defaultsetter {
|
foreach my $key (keys %allparms) { |
foreach my $key (keys %allparms) { |
$newrules{$key.'_triggers'}=$triggers{$key}; |
$newrules{$key.'_triggers'}=$triggers{$key}; |
} |
} |
&Apache::lonnet::put('parmdefactions',\%newrules,$dom,$crs); |
&Apache::lonnet::put('parmdefactions',\%newrules,$cdom,$cnum); |
&Apache::lonnet::del('parmdefactions',\@delrules,$dom,$crs); |
&Apache::lonnet::del('parmdefactions',\@delrules,$cdom,$cnum); |
&resetrulescache(); |
&resetrulescache(); |
} |
} |
my %lt=&Apache::lonlocal::texthash('days' => 'Days', |
my %lt=&Apache::lonlocal::texthash('days' => 'Days', |
Line 5718 ENDYESNO
|
Line 4298 ENDYESNO
|
$r->print(&Apache::loncommon::end_data_table(). |
$r->print(&Apache::loncommon::end_data_table(). |
"\n".'<input type="submit" name="storerules" value="'. |
"\n".'<input type="submit" name="storerules" value="'. |
&mt('Save').'" /></form>'."\n"); |
&mt('Save').'" /></form>'."\n"); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
Line 5764 my %standard_parms;
|
Line 4345 my %standard_parms;
|
my %standard_parms_types; |
my %standard_parms_types; |
|
|
sub load_parameter_names { |
sub load_parameter_names { |
open(my $config,"<","$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab"); |
open(my $config,"<$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab"); |
while (my $configline=<$config>) { |
while (my $configline=<$config>) { |
if ($configline !~ /\S/ || $configline=~/^\#/) { next; } |
if ($configline !~ /\S/ || $configline=~/^\#/) { next; } |
chomp($configline); |
chomp($configline); |
Line 5779 sub load_parameter_names {
|
Line 4360 sub load_parameter_names {
|
close($config); |
close($config); |
$standard_parms{'int_pos'} = 'Positive Integer'; |
$standard_parms{'int_pos'} = 'Positive Integer'; |
$standard_parms{'int_zero_pos'} = 'Positive Integer or Zero'; |
$standard_parms{'int_zero_pos'} = 'Positive Integer or Zero'; |
$standard_parms{'scoreformat'} = 'Format for display of score'; |
|
} |
} |
|
|
sub standard_parameter_names { |
sub standard_parameter_names { |
Line 5806 sub standard_parameter_types {
|
Line 4386 sub standard_parameter_types {
|
} |
} |
|
|
sub parm_change_log { |
sub parm_change_log { |
my ($r,$parm_permission)=@_; |
my ($r)=@_; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'} |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
text=>"Parameter Change Log"}); |
text=>"Parameter Change Log"}); |
my $js = '<script type="text/javascript">'."\n". |
my $js = '<script type="text/javascript">'."\n". |
Line 5816 sub parm_change_log {
|
Line 4399 sub parm_change_log {
|
'</script>'."\n"; |
'</script>'."\n"; |
$r->print(&Apache::loncommon::start_page('Parameter Change Log',$js)); |
$r->print(&Apache::loncommon::start_page('Parameter Change Log',$js)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); |
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog', |
&startSettingsScreen($r,'parmset',$crstype); |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog',$cdom,$cnum); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
|
|
|
if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); } |
if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); } |
|
|
Line 5835 sub parm_change_log {
|
Line 4417 sub parm_change_log {
|
$r->print(&Apache::loncommon::display_filter('parmslog').' '."\n". |
$r->print(&Apache::loncommon::display_filter('parmslog').' '."\n". |
'<input type="submit" value="'.&mt('Display').'" />'. |
'<input type="submit" value="'.&mt('Display').'" />'. |
'</form></fieldset></div><br clear="all" />'); |
'</form></fieldset></div><br clear="all" />'); |
my $readonly = 1; |
|
if ($parm_permission->{'edit'}) { |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
undef($readonly); |
|
} |
|
my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'}, |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
|
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). |
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). |
'<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'. |
'<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'. |
&mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th>'); |
&mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'. |
unless ($readonly) { |
&Apache::loncommon::end_data_table_header_row()); |
$r->print('<th>'.&mt('Announce').'</th>'); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
my $shown=0; |
my $shown=0; |
my $folder=''; |
my $folder=''; |
if ($env{'form.displayfilter'} eq 'currentfolder') { |
if ($env{'form.displayfilter'} eq 'currentfolder') { |
Line 5859 sub parm_change_log {
|
Line 4434 sub parm_change_log {
|
} |
} |
if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); } |
if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); } |
} |
} |
my $numgroups = 0; |
|
my @groups; |
|
if ($env{'request.course.groups'} ne '') { |
|
@groups = split(/:/,$env{'request.course.groups'}); |
|
$numgroups = scalar(@groups); |
|
} |
|
foreach my $id (sort |
foreach my $id (sort |
{ |
{ |
if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) { |
if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) { |
Line 5886 sub parm_change_log {
|
Line 4455 sub parm_change_log {
|
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_udom'}); |
$parmlog{$id}{'exe_udom'}); |
my $send_msg_link=''; |
my $send_msg_link=''; |
if ((!$readonly) && |
if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) |
(($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) |
|
|| ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) { |
|| ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) { |
$send_msg_link ='<br />'. |
$send_msg_link ='<br />'. |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
Line 5904 sub parm_change_log {
|
Line 4472 sub parm_change_log {
|
!exists($parmlog{$id}{'logentry'}{$changed.'.type'})); |
!exists($parmlog{$id}{'logentry'}{$changed.'.type'})); |
my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)= |
my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)= |
&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag); |
&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag); |
if ($env{'request.course.sec'} ne '') { |
|
next if (($issection ne '') && (!(($issection eq $env{'request.course.sec'}) || |
|
($numgroups && (grep(/^\Q$issection\E$/,@groups)))))); |
|
if ($uname ne '') { |
|
my $stusection = &Apache::lonnet::getsection($uname,$udom,$env{'request.course.id'}); |
|
next if (($stusection ne '-1') && ($stusection ne $env{'request.course.sec'})); |
|
} |
|
} |
|
if ($env{'form.displayfilter'} eq 'currentfolder') { |
if ($env{'form.displayfilter'} eq 'currentfolder') { |
if ($folder) { |
if ($folder) { |
if ($middle!~/^\Q$folder\E/) { next; } |
if ($middle!~/^\Q$folder\E/) { next; } |
Line 5940 sub parm_change_log {
|
Line 4500 sub parm_change_log {
|
$parmitem = &mt($parmitem); |
$parmitem = &mt($parmitem); |
$output .= &mt('Type: [_1]',$parmitem); |
$output .= &mt('Type: [_1]',$parmitem); |
} else { |
} else { |
my $toolsymb; |
my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what), |
if ($middle =~ /ext\.tool$/) { |
|
$toolsymb = $middle; |
|
} |
|
my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what,$toolsymb), |
|
$uname,$udom,$issection,$issection,$courseopt); |
$uname,$udom,$issection,$issection,$courseopt); |
my $showvalue = $value; |
my $showvalue = $value; |
if ($istype{$parmname} eq '') { |
if ($istype{$parmname} eq '') { |
Line 5969 sub parm_change_log {
|
Line 4525 sub parm_change_log {
|
} |
} |
} |
} |
} |
} |
$output .= '</td>'; |
$output .= '</td><td>'; |
|
|
unless ($readonly) { |
if ($stillactive) { |
$output .= '<td>'; |
my $parmitem = &standard_parameter_names($parmname); |
if ($stillactive) { |
$parmitem = &mt($parmitem); |
my $parmitem = &standard_parameter_names($parmname); |
my $title=&mt('Changed [_1]',$parmitem); |
$parmitem = &mt($parmitem); |
my $description=&mt('Changed [_1] for [_2] to [_3]', |
my $title=&mt('Changed [_1]',$parmitem); |
$parmitem,$realmdescription, |
my $description=&mt('Changed [_1] for [_2] to [_3]', |
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
$parmitem,$realmdescription, |
if (($uname) && ($udom)) { |
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
$output .= |
if (($uname) && ($udom)) { |
&Apache::loncommon::messagewrapper('Notify User', |
$output .= |
$uname,$udom,$title, |
&Apache::loncommon::messagewrapper('Notify User', |
$description); |
$uname,$udom,$title, |
} else { |
$description); |
$output .= |
} else { |
&Apache::lonrss::course_blog_link($id,$title, |
$output .= |
$description); |
&Apache::lonrss::course_blog_link($id,$title, |
} |
$description); |
} |
} |
$output .= '</td>'.&Apache::loncommon::end_data_table_row(); |
} |
|
$output .= '</td>'; |
|
} |
|
$output .= &Apache::loncommon::end_data_table_row(); |
|
} |
} |
if ($env{'form.displayfilter'} eq 'containing') { |
if ($env{'form.displayfilter'} eq 'containing') { |
my $wholeentry=$about_me_link.':'. |
my $wholeentry=$about_me_link.':'. |
Line 6013 sub parm_change_log {
|
Line 4565 sub parm_change_log {
|
|| $shown<=$env{'form.show'})) { last; } |
|| $shown<=$env{'form.show'})) { last; } |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 6061 sub update_slots {
|
Line 4614 sub update_slots {
|
context => 'parameter', |
context => 'parameter', |
); |
); |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
'',$uname,$udom,$cnum,$cdom); |
'',$uname,$udom,$cnum,$cdom); |
|
|
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
'',$uname,$udom,$uname,$udom); |
'',$uname,$udom,$uname,$udom); |
} |
} |
return $success; |
return $success; |
} |
} |
Line 6095 sub delete_slots {
|
Line 4648 sub delete_slots {
|
context => 'parameter', |
context => 'parameter', |
); |
); |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
1,$uname,$udom,$cnum,$cdom); |
1,$uname,$udom,$cnum,$cdom); |
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
1,$uname,$udom,$uname,$udom); |
1,$uname,$udom,$uname,$udom); |
} |
} |
} |
} |
} |
} |
Line 6120 sub parameter_release_vars {
|
Line 4673 sub parameter_release_vars {
|
} |
} |
|
|
sub parameter_releasecheck { |
sub parameter_releasecheck { |
my ($name,$value,$needsrelease,$cmajor,$cminor) = @_; |
my ($name,$value,$needsrelease,$chostname,$cmajor,$cminor) = @_; |
my $needsnewer; |
my $needsnewer; |
my ($needsmajor,$needsminor) = split(/\./,$needsrelease); |
my ($needsmajor,$needsminor) = split(/\./,$needsrelease); |
if (($cmajor < $needsmajor) || |
if (($cmajor < $needsmajor) || |
Line 6132 sub parameter_releasecheck {
|
Line 4685 sub parameter_releasecheck {
|
return $needsnewer; |
return $needsnewer; |
} |
} |
|
|
sub get_permission { |
sub oldversion_warning { |
my %permission; |
my ($name,$value,$chostname,$cmajor,$cminor,$needsrelease) = @_; |
my $allowed = 0; |
my $desc; |
return (\%permission,$allowed) unless ($env{'request.course.id'}); |
my %stringtypes = ( |
if ((&Apache::lonnet::allowed('opa',$env{'request.course.id'})) || |
type => 'string_questiontype', |
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
lenient => 'string_lenient', |
$env{'request.course.sec'}))) { |
retrypartial => 'string_yesno', |
%permission= ( |
discussvote => 'string_discussvote', |
'edit' => 1, |
|
'set' => 1, |
|
'setoverview' => 1, |
|
'addmetadata' => 1, |
|
'ordermetadata' => 1, |
|
'setrestrictmeta' => 1, |
|
'newoverview' => 1, |
|
'setdefaults' => 1, |
|
'settable' => 1, |
|
'parameterchangelog' => 1, |
|
'cleanparameters' => 1, |
|
'dateshift1' => 1, |
|
'dateshift2' => 1, |
|
'helper' => 1, |
|
); |
|
} elsif ((&Apache::lonnet::allowed('vpa',$env{'request.course.id'})) || |
|
(&Apache::lonnet::allowed('vpa',$env{'request.course.id'}.'/'. |
|
$env{'request.course.sec'}))) { |
|
%permission = ( |
|
'set' => 1, |
|
'settable' => 1, |
|
'newoverview' => 1, |
|
'setoverview' => 1, |
|
'parameterchangelog' => 1, |
|
); |
); |
|
if (exists($stringtypes{$name})) { |
|
if (ref($strings{$stringtypes{$name}}) eq 'ARRAY') { |
|
foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) { |
|
next unless (ref($possibilities) eq 'ARRAY'); |
|
my ($parmval, $description) = @{ $possibilities }; |
|
if ($parmval eq $value) { |
|
$desc = $description; |
|
last; |
|
} |
|
} |
|
} |
} |
} |
foreach my $perm (values(%permission)) { |
my $standard_name = &standard_parameter_names($name); |
if ($perm) { $allowed=1; last; } |
return '<p class="LC_warning">'. |
} |
&mt('[_1] was [_2]not[_3] set to [_4].', |
return (\%permission,$allowed); |
$standard_name,'<b>','</b>','"'.$desc.'"').'<br />'. |
|
&mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).', |
|
$cmajor.'.'.$cminor,$chostname, |
|
$needsrelease). |
|
'</p>'; |
} |
} |
|
|
sub handler { |
sub handler { |
Line 6199 sub handler {
|
Line 4743 sub handler {
|
'Parameter_Manager,Course_Environment,Parameter_Helper,Parameter_Overview,Table_Mode'}); |
'Parameter_Manager,Course_Environment,Parameter_Helper,Parameter_Overview,Table_Mode'}); |
|
|
# ----------------------------------------------------- Needs to be in a course |
# ----------------------------------------------------- Needs to be in a course |
my ($parm_permission,$allowed) = &get_permission(); |
my $parm_permission = |
|
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) || |
|
&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
|
$env{'request.course.sec'})); |
my $exists = &check_for_course_info(); |
my $exists = &check_for_course_info(); |
|
|
if ($env{'request.course.id'} && $allowed && $exists) { |
if ($env{'request.course.id'} && $parm_permission && $exists) { |
# |
# |
# Main switch on form.action and form.state, as appropriate |
# Main switch on form.action and form.state, as appropriate |
# |
# |
# Check first if coming from someone else headed directly for |
# Check first if coming from someone else headed directly for |
# the table mode |
# the table mode |
if (($parm_permission->{'set'}) && |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
&& (!$env{'form.dis'})) || ($env{'form.symb'}))) { |
&assessparms($r); |
&assessparms($r,$parm_permission); |
|
} elsif (! exists($env{'form.action'})) { |
} elsif (! exists($env{'form.action'})) { |
&print_main_menu($r,$parm_permission); |
&print_main_menu($r,$parm_permission); |
} elsif (!$parm_permission->{$env{'form.action'}}) { |
|
&print_main_menu($r,$parm_permission); |
|
} elsif ($env{'form.action'} eq 'setoverview') { |
} elsif ($env{'form.action'} eq 'setoverview') { |
&overview($r,$parm_permission); |
&overview($r); |
} elsif ($env{'form.action'} eq 'addmetadata') { |
} elsif ($env{'form.action'} eq 'addmetadata') { |
&addmetafield($r); |
&addmetafield($r); |
} elsif ($env{'form.action'} eq 'ordermetadata') { |
} elsif ($env{'form.action'} eq 'ordermetadata') { |
&order_meta_fields($r); |
&order_meta_fields($r); |
} elsif ($env{'form.action'} eq 'setrestrictmeta') { |
} elsif ($env{'form.action'} eq 'setrestrictmeta') { |
&setrestrictmeta($r); |
&setrestrictmeta($r); |
} elsif ($env{'form.action'} eq 'newoverview') { |
} elsif ($env{'form.action'} eq 'newoverview') { |
&newoverview($r,$parm_permission); |
&newoverview($r); |
} elsif ($env{'form.action'} eq 'setdefaults') { |
} elsif ($env{'form.action'} eq 'setdefaults') { |
&defaultsetter($r); |
&defaultsetter($r); |
} elsif ($env{'form.action'} eq 'settable') { |
} elsif ($env{'form.action'} eq 'settable') { |
&assessparms($r,$parm_permission); |
&assessparms($r); |
} elsif ($env{'form.action'} eq 'parameterchangelog') { |
} elsif ($env{'form.action'} eq 'parameterchangelog') { |
&parm_change_log($r,$parm_permission); |
&parm_change_log($r); |
} elsif ($env{'form.action'} eq 'cleanparameters') { |
} elsif ($env{'form.action'} eq 'cleanparameters') { |
&clean_parameters($r); |
&clean_parameters($r); |
} elsif ($env{'form.action'} eq 'dateshift1') { |
} elsif ($env{'form.action'} eq 'dateshift1') { |
&date_shift_one($r); |
&date_shift_one($r); |
} elsif ($env{'form.action'} eq 'dateshift2') { |
} elsif ($env{'form.action'} eq 'dateshift2') { |