version 1.492, 2010/01/30 17:35:10
|
version 1.522.2.17, 2015/03/12 02:44:51
|
Line 46 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 137 javascript function 'pjump'.
|
Line 135 javascript function 'pjump'.
|
|
|
=item extractResourceInformation() : |
=item extractResourceInformation() : |
|
|
Given the course data hash, extractResourceInformation extracts lots of information about 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 |
|
|
|
=over 4 |
|
|
Input: See list below: |
=item * B<env{'user.name'}> : Current username |
|
|
=item * B<ids> : An array that will contain all of the ids in the course. |
=item * B<env{'user.domain'}> : Domain of current user. |
|
|
=item * B<typep> : hash, id->type, where "type" contains the extension of the file, thus, I<problem exam quiz assess survey form>. |
=item * B<env{"request.course.fn"}> : Course |
|
|
|
=back |
|
|
=item * B<keyp> : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id |
Outputs: See list below |
|
|
=item * B<allparms> : hash, name of parameter->display value (what is the display value?) |
=over 4 |
|
|
=item * B<allparts> : hash, part identification->text representation of part, where the text representation is "[Part $part]" |
=item * B<ids> (out) : An array that will contain all of the ids in the course. |
|
|
=item * B<allkeys> : hash, full key to part->display value (what's display value?) |
=item * B<typep>(out) : hash, id->type, where "type" contains the extension of the file, thus, I<problem exam quiz assess survey form>. |
|
|
=item * B<allmaps> : hash, ??? |
=item * B<keyp> (out) : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id |
|
|
=item * B<fcat> : ??? |
=item * B<allparms> (out) : hash, name of parameter->display value (what is the display value?) |
|
|
=item * B<defp> : hash, ??? |
=item * B<allparts> (out) : hash, part identification->text representation of part, where the text representation is "[Part $part]" |
|
|
|
=item * B<allmaps> (out) : hash, ??? |
|
|
=item * B<mapp> : ?? |
=item * B<mapp> : ?? |
|
|
=item * B<symbp> : hash, id->full sym? |
=item * B<symbp> : hash, id->full sym? |
|
|
|
=item * B<maptitles> |
|
|
|
=item * B<uris> |
|
|
|
=item * B<keyorder> |
|
|
|
=item * B<defkeytype> |
|
|
|
=back |
|
|
=item isdateparm() |
=item isdateparm() |
|
|
Line 196 Input: See list below:
|
Line 210 Input: See list below:
|
Show assessment data and parameters. This is a large routine that should |
Show assessment data and parameters. This is a large routine that should |
be simplified and shortened... someday. |
be simplified and shortened... someday. |
|
|
Inputs: $r |
Inputs: $r - the Apache request object. |
|
|
Returns: nothing |
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 214 Variables used (guessed by Jeremy):
|
Line 230 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 248 Variables used (guessed by Jeremy):
|
Line 266 Variables used (guessed by Jeremy):
|
|
|
=item parse_key() |
=item parse_key() |
|
|
=item check_cloners() : |
|
|
|
Checks if new users included in list of allowed cloners |
|
are valid users. Replaces supplied list with |
|
cleaned list containing only users with valid usernames |
|
and domains. |
|
|
|
Inputs: $clonelist, $oldcloner |
|
where $clonelist is ref to array of requested cloners, |
|
and $oldcloner is ref to array of currently allowed |
|
cloners. |
|
|
|
Returns: string - comma separated list of requested |
|
cloners (username:domain) who do not exist in system. |
|
|
|
=item change_clone() : |
|
|
|
Modifies the list of courses a user can clone (stored |
|
in the user's environment.db file), called when a |
|
change is made to the list of users allowed to clone |
|
a course. |
|
|
|
Inputs: $action,$cloner |
|
where $action is add or drop, and $cloner is identity of |
|
user for whom cloning ability is to be changed in course. |
|
|
|
|
|
=item check_cloners() |
|
|
|
=item change_clone() |
|
|
|
=item header() |
=item header() |
|
|
Output html header for page |
Output html header for page |
Line 311 Set portfolio metadata
|
Line 298 Set portfolio metadata
|
|
|
Main handler. Calls &assessparms subroutine. |
Main handler. Calls &assessparms subroutine. |
|
|
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 333 use Apache::lonlocal;
|
Line 319 use Apache::lonlocal;
|
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
use Apache::longroup; |
use Apache::longroup; |
use Apache::lonrss; |
use Apache::lonrss; |
|
use HTML::Entities; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
|
Line 662 sub storeparm_by_symb {
|
Line 649 sub storeparm_by_symb {
|
} |
} |
|
|
sub log_parmset { |
sub log_parmset { |
return &Apache::lonnet::instructor_log('parameterlog',@_); |
return &Apache::lonnet::write_log('course','parameterlog',@_); |
} |
} |
|
|
sub storeparm_by_symb_inner { |
sub storeparm_by_symb_inner { |
Line 769 sub valout {
|
Line 756 sub valout {
|
my $result = ''; |
my $result = ''; |
# Values of zero are valid. |
# Values of zero are valid. |
if (! $value && $value ne '0') { |
if (! $value && $value ne '0') { |
if ($editable) { |
if ($editable) { |
$result = '<span class="LC_clickhere">*</span>'; |
$result = |
} else { |
'<img src="/res/adm/pages/editmap.png"' |
$result=' '; |
.' alt="'.&mt('Change').'"' |
} |
.' title="'.&mt('Change').'" style="border:0;" />'; |
|
} else { |
|
$result=' '; |
|
} |
} else { |
} else { |
if ($type eq 'date_interval') { |
if ($type eq 'date_interval') { |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
Line 814 sub valout {
|
Line 804 sub valout {
|
&date_sanity_info($value); |
&date_sanity_info($value); |
} else { |
} else { |
$result = $value; |
$result = $value; |
|
$result=~s/\,/\, /gs; |
$result = &HTML::Entities::encode($result,'"<>&'); |
$result = &HTML::Entities::encode($result,'"<>&'); |
} |
} |
} |
} |
Line 855 sub page_js {
|
Line 846 sub page_js {
|
return(<<ENDJS); |
return(<<ENDJS); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
function pclose() { |
|
parmwin=window.open("/adm/rat/empty.html","LONCAPAparms", |
|
"height=350,width=350,scrollbars=no,menubar=no"); |
|
parmwin.close(); |
|
} |
|
|
|
$pjump_def |
$pjump_def |
|
|
function psub() { |
function psub() { |
pclose(); |
|
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(); |
Line 899 $selscript
|
Line 884 $selscript
|
ENDJS |
ENDJS |
|
|
} |
} |
|
|
|
sub showhide_js { |
|
return <<"COURSECONTENTSCRIPT"; |
|
|
|
function showHide_courseContent() { |
|
var parmlevValue=document.getElementById("parmlev").value; |
|
if (parmlevValue == 'general') { |
|
document.getElementById('mapmenu').style.display="none"; |
|
} else { |
|
if ((parmlevValue == "full") || (parmlevValue == "map")) { |
|
document.getElementById('mapmenu').style.display =""; |
|
} else { |
|
document.getElementById('mapmenu').style.display="none"; |
|
} |
|
} |
|
return; |
|
} |
|
|
|
COURSECONTENTSCRIPT |
|
} |
|
|
sub startpage { |
sub startpage { |
my ($r) = @_; |
my ($r,$psymb) = @_; |
|
|
my %loaditems = ('onunload' => "pclose()", |
my %loaditems = ( |
'onload' => "showHide_courseContent(); group_or_section('cgroup')", |
'onload' => "group_or_section('cgroup')", |
); |
); |
|
if (!$psymb) { |
|
$loaditems{'onload'} = "showHide_courseContent(); group_or_section('cgroup'); resize_scrollbox('mapmenuscroll','1','1');"; |
|
} |
|
|
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
Line 915 sub startpage {
|
Line 924 sub startpage {
|
text=>"Table Mode", |
text=>"Table Mode", |
help => 'Course_Setting_Parameters'}); |
help => 'Course_Setting_Parameters'}); |
} |
} |
|
my $js = &page_js().' |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
'. |
|
&Apache::lonhtmlcommon::resize_scrollbox_js('params').' |
|
// ]]> |
|
</script> |
|
'; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Set/Modify Course Parameters', |
&Apache::loncommon::start_page('Set/Modify Course Parameters',$js, |
&page_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 $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'}); |
|
$r->print($start_page.$breadcrumbs); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
$start_page |
|
$breadcrumbs |
|
<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" /> |
<input type="hidden" value="" name="pres_type" /> |
<input type="hidden" value="" name="pres_type" /> |
<input type="hidden" value="" name="pres_marker" /> |
<input type="hidden" value="" name="pres_marker" /> |
<input type="hidden" value="1" name="prevvisit" /> |
<input type="hidden" value="1" name="prevvisit" /> |
|
<input type="hidden" value="$escfilter" name="filter" /> |
|
<input type="hidden" value="$escpart" name="part" /> |
ENDHEAD |
ENDHEAD |
} |
} |
|
|
Line 961 sub print_row {
|
Line 980 sub print_row {
|
|
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
$r->print('<td style="background-color:'.$defbgtwo.';" align="center">' |
$r->print('<td style="background-color:'.$defbgtwo.';" align="center">' |
.$$part{$which}.'</td>'); |
.($$part{$which} eq '0'?'0 ('.&mt('default').')':$$part{$which}).'</td>'); |
} else { |
} else { |
$parm=~s|\[.*\]\s||g; |
$parm=~s|\[.*\]\s||g; |
} |
} |
Line 1072 sub print_td {
|
Line 1091 sub print_td {
|
if ($which > 3) { |
if ($which > 3) { |
$nolink = 1; |
$nolink = 1; |
} |
} |
|
} elsif ($mprefix =~ /examcode\&$/) { |
|
unless ($which == 2) { |
|
$nolink = 1; |
|
} |
} |
} |
if ($nolink) { |
if ($nolink) { |
$r->print(&valout($$outpar[$which],$$typeoutpar[$which])); |
$r->print(&valout($$outpar[$which],$$typeoutpar[$which])); |
Line 1169 sub extractResourceInformation {
|
Line 1192 sub extractResourceInformation {
|
$$typep{$id}=$1; |
$$typep{$id}=$1; |
$$keyp{$id}=''; |
$$keyp{$id}=''; |
$$uris{$id}=$srcf; |
$$uris{$id}=$srcf; |
|
|
foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { |
foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { |
next if ($key!~/^parameter_/); |
next if ($key!~/^parameter_/); |
|
|
Line 1224 sub extractResourceInformation {
|
Line 1248 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 Course Documents'); |
$$maptitles{$mapid}=&mt('Main Content'); |
} else { |
} else { |
$$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id}); |
$$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id}); |
} |
} |
Line 1245 sub isdateparm {
|
Line 1269 sub isdateparm {
|
} |
} |
|
|
# |
# |
# This function prints a list of parameters, which were selected. It also display a link from which you can |
# parmmenu displays a list of the selected parameters. |
# hide or show the complete parameter list, from which you can choose your parameters. |
# It also offers a link to show/hide the complete parameter list |
|
# from which you can select all desired parameters. |
# |
# |
sub parmmenu { |
sub parmmenu { |
my ($r,$allparms,$pscat,$keyorder)=@_; |
my ($r,$allparms,$pscat,$keyorder)=@_; |
Line 1267 sub parmmenu {
|
Line 1292 sub parmmenu {
|
ele = document.forms.parmform.elements[i]; |
ele = document.forms.parmform.elements[i]; |
if (ele.name == checkName) { |
if (ele.name == checkName) { |
document.forms.parmform.elements[i].checked=value; |
document.forms.parmform.elements[i].checked=value; |
document.getElementById(document.forms.parmform.elements[i].value.concat(li)).style.display = displayOverview; |
|
} |
} |
} |
} |
} |
} |
|
|
function checkthis(thisvalue, checkName) { |
function checkthis(thisvalue, checkName) { |
|
|
document.getElementById(thisvalue.concat("_li")).style.display = ""; |
|
|
|
for (i=0; i<document.forms.parmform.elements.length; i++) { |
for (i=0; i<document.forms.parmform.elements.length; i++) { |
ele = document.forms.parmform.elements[i]; |
ele = document.forms.parmform.elements[i]; |
Line 1293 sub parmmenu {
|
Line 1316 sub parmmenu {
|
} |
} |
|
|
function checkdisset() { |
function checkdisset() { |
checkthis('discussend','pscat'); |
checkthis('discussend','pscat'); |
checkthis('discusshide','pscat'); |
checkthis('discusshide','pscat'); |
|
checkthis('discussvote','pscat'); |
} |
} |
|
|
function checkcontdates() { |
function checkcontdates() { |
Line 1321 sub parmmenu {
|
Line 1345 sub parmmenu {
|
checkdates(); |
checkdates(); |
checkthis('weight','pscat'); |
checkthis('weight','pscat'); |
checkthis('maxtries','pscat'); |
checkthis('maxtries','pscat'); |
|
checkthis('type','pscat'); |
|
checkthis('problemstatus','pscat'); |
} |
} |
|
|
function hideParms() { |
|
document.getElementById('LC_parm_overview_parm_menu').style.display = "none"; |
|
} |
|
|
|
function showParms() { |
|
document.getElementById('LC_parm_overview_parm_menu').style.display = ""; |
|
} |
|
|
|
function checkboxChecked(id) { |
|
var li = "_li"; |
|
var id_li = id.concat(li); |
|
if (document.getElementById(id_li).style.display == "none") { |
|
document.getElementById(id_li).style.display = ""; |
|
} |
|
else { |
|
document.getElementById(id_li).style.display = "none"; |
|
} |
|
} |
|
// ]]> |
// ]]> |
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); |
|
|
|
#part to print selected parms overview |
|
$r->print(&mt('Selected Parameters:').'<br />'); |
|
|
|
#print out all possible parms and hide them by default |
|
$r->print('<ul>'); |
|
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
|
$r->print('<li id="'.$tempkey.'_li" value="'.$tempkey.'_li" name="pscat_li"'); |
|
if (!($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat})) { |
|
$r->print(' style="display:none"'); |
|
} |
|
$r->print('>' |
|
.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey) |
|
.'</li>' |
|
); |
|
} |
|
$r->print('</ul>'); |
|
|
|
$r->print('<hr />'); |
$r->print('<hr />'); |
&shortCuts($r,$allparms,$pscat,$keyorder); |
&shortCuts($r,$allparms,$pscat,$keyorder); |
$r->print('<hr />'); |
$r->print('<hr />'); |
|
|
$r->print( |
|
'<p><a href="javascript:showParms()">' |
|
.&mt('Show detailed Parameter Selection') |
|
.'</a></p>' |
|
); |
|
|
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
|
} |
} |
# return a hash |
# return a hash |
sub categories { |
sub categories { |
Line 1400 sub lookUpTableParameter {
|
Line 1382 sub lookUpTableParameter {
|
'contentopen' => 'time_settings', |
'contentopen' => 'time_settings', |
'contentclose' => 'time_settings', |
'contentclose' => 'time_settings', |
'discussend' => 'time_settings', |
'discussend' => 'time_settings', |
|
'printstartdate' => 'time_settings', |
|
'printenddate' => 'time_settings', |
'weight' => 'grading', |
'weight' => 'grading', |
'handgrade' => 'grading', |
'handgrade' => 'grading', |
'maxtries' => 'tries', |
'maxtries' => 'tries', |
'hinttries' => 'tries', |
'hinttries' => 'tries', |
|
'randomizeontries' => 'tries', |
'type' => 'problem_appearance', |
'type' => 'problem_appearance', |
'problemstatus' => 'problem_appearance', |
'problemstatus' => 'problem_appearance', |
'display' => 'problem_appearance', |
'display' => 'problem_appearance', |
Line 1430 sub lookUpTableParameter {
|
Line 1415 sub lookUpTableParameter {
|
'acc' => 'misc', |
'acc' => 'misc', |
'maxcollaborators' => 'misc', |
'maxcollaborators' => 'misc', |
'scoreformat' => 'misc', |
'scoreformat' => 'misc', |
|
'lenient' => 'grading', |
|
'retrypartial' => 'tries', |
|
'discussvote' => 'misc', |
|
'examcode' => 'high_level_randomization', |
); |
); |
} |
} |
|
|
Line 1498 sub parmboxes {
|
Line 1486 sub parmboxes {
|
'file_submission' => [], |
'file_submission' => [], |
'misc' => [], |
'misc' => [], |
); |
); |
my $hidelink = |
|
'<p>' |
|
.'<a href="javascript:hideParms()">' |
|
.&mt('Hide detailed Parameter Selection') |
|
.'</a>' |
|
.'</p>' |
|
."\n"; |
|
; |
|
foreach $tempparameter (keys %$allparms) { |
foreach $tempparameter (keys %$allparms) { |
&whatIsMyCategory($tempparameter, \%categoryList); |
&whatIsMyCategory($tempparameter, \%categoryList); |
} |
} |
#part to print the parm-list |
#part to print the parm-list |
$r->print( |
$r->print('<div class="LC_columnSection">'."\n"); |
'<div id="LC_parm_overview_parm_menu" class="LC_Box" style="display:none">'."\n" |
|
.'<h3>'.&mt('Parameter').'</h3>'."\n" |
|
.$hidelink |
|
.'<div class="LC_columnSection">'."\n" |
|
); |
|
|
|
#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) { |
if(@{$categoryList{$key}} == 0) { |
next if(@{$categoryList{$key}} == 0); |
next; |
$r->print('<div class="LC_Box LC_400Box">' |
} else { |
.'<h4 class="LC_hcell">' |
$r->print('<div class="LC_Box LC_400Box">' |
.&mt($categories{$key}) |
.'<h4 class="LC_hcell">' |
.'</h4>'."\n"); |
.&mt($categories{$key}) |
foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { |
.'</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"'); |
$r->print('onclick="checkboxChecked(\''.$tempkey.'\')"'); |
|
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
|
$r->print(' checked="checked"'); |
|
} |
|
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
|
: $tempkey) |
|
.'</label></span><br />'."\n"); |
|
} |
} |
$r->print("</div>\n"); |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
|
: $tempkey) |
|
.'</label></span><br />'."\n"); |
} |
} |
|
$r->print("</div>\n"); |
} |
} |
|
|
#&shortCuts($r,$allparms,$pscat,$keyorder); |
$r->print("</div>\n"); |
$r->print( |
|
"</div>\n" |
|
.$hidelink |
|
."</div>\n" |
|
); |
|
} |
} |
# |
# |
# 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 |
Line 1586 sub shortCuts {
|
Line 1553 sub shortCuts {
|
|
|
sub partmenu { |
sub partmenu { |
my ($r,$allparts,$psprt)=@_; |
my ($r,$allparts,$psprt)=@_; |
|
my $selsize = 1+scalar(keys(%{$allparts})); |
|
if ($selsize > 8) { |
|
$selsize = 8; |
|
} |
|
|
$r->print('<select multiple="multiple" name="psprt" size="8">'); |
$r->print('<select multiple="multiple" name="psprt" size="'.$selsize.'">'); |
$r->print('<option value="all"'); |
$r->print('<option value="all"'); |
$r->print(' selected="selected"') unless (@{$psprt}); |
$r->print(' selected="selected"') unless (@{$psprt}); |
$r->print('>'.&mt('All Parts').'</option>'); |
$r->print('>'.&mt('All Parts').'</option>'); |
Line 1708 function group_or_section(caller) {
|
Line 1679 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,$allparts,$pscat,$psprt,$keyorder)=@_; |
my ($r,$allparms,$pscat,$psprt,$keyorder,$divid)=@_; |
|
|
$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'))); |
|
|
&parmmenu($r,$allparms,$pscat,$keyorder); |
&parmmenu($r,$allparms,$pscat,$keyorder); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid)); |
&parmboxes($r,$allparms,$pscat,$keyorder); |
&parmboxes($r,$allparms,$pscat,$keyorder); |
|
$r->print(&Apache::loncommon::end_scrollbox()); |
|
|
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
|
} |
} |
|
|
sub mapmenu { |
sub mapmenu { |
my ($r,$allmaps,$pschp,$maptitles, $symbp)=@_; |
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=[]; |
my $treeinfo={}; |
my $treeinfo={}; |
if (defined($navmap)) { |
if (defined($navmap)) { |
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); |
my $it=$navmap->getIterator(undef,undef,undef,1,1,undef); |
my $curRes; |
my $curRes; |
my $depth = 0; |
my $depth = 0; |
my %parent = (); |
my %parent = (); |
Line 1767 sub mapmenu {
|
Line 1746 sub mapmenu {
|
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"')); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"')); |
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="" />'; |
$r->print(&Apache::loncommon::start_data_table() |
my $whitespace = |
.&Apache::loncommon::start_data_table_row() |
'<img src="' |
.'<td>'.$icon |
.&Apache::loncommon::lonhttpdurl('/adm/lonIcons/whitespace_21.gif') |
.'<label> ' |
.'" alt="" />'; |
.'<input type="radio" name="pschp" checked="checked" value="all" />' |
|
.&mt('All Maps or Folders') |
# Info about selectable folders/maps |
.'</label></td>' |
$r->print( |
.&Apache::loncommon::end_data_table_row() |
'<div class="LC_info">' |
|
.&mt('You can only select maps and folders which have modifiable settings.') |
|
.' '.&Apache::loncommon::help_open_topic('Parameter_Set_Folder') |
|
.'</div>' |
|
); |
|
|
|
$r->print(&Apache::loncommon::start_scrollbox('700px','680px','400px','mapmenuscroll')); |
|
$r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner')); |
|
|
|
# Display row: "All Maps or Folders" |
|
$r->print( |
|
&Apache::loncommon::start_data_table_row(undef,'picklevel') |
|
.'<td>' |
|
.'<label>' |
|
.'<input type="radio" name="pschp"' |
|
); |
|
$r->print(' checked="checked"') if ($pschp eq 'all' || !$pschp); |
|
$r->print( |
|
' value="all" /> '.$icon.' ' |
|
.&mt('All Maps or Folders') |
|
.'</label>' |
|
.'<hr /></td>' |
|
.&Apache::loncommon::end_data_table_row() |
); |
); |
my $whitespace = '<img src="' |
|
.&Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif") |
# Display row: "Main Content" |
.'" alt="" />'; |
|
if (exists($$allmaps{1})) { |
if (exists($$allmaps{1})) { |
$r->print(&Apache::loncommon::start_data_table_row() |
$r->print( |
.'<td>'.$icon |
&Apache::loncommon::start_data_table_row() |
.'<label> ' |
.'<td>' |
.'<input type="radio" name="pschp" value="1"' |
.'<label>' |
|
.'<input type="radio" name="pschp" value="1"' |
); |
); |
if ($pschp eq 1) { |
$r->print(' checked="checked"') if ($pschp eq '1'); |
$r->print(' checked="checked"'); |
$r->print( |
} |
'/> '.$icon.' ' |
$r->print('/>' |
.$$maptitles{1} |
.$$maptitles{1} |
.($$allmaps{1} !~/^uploaded/?' ['.$$allmaps{1}.']':'') |
.($$allmaps{1} !~/^uploaded/?' ['.$$allmaps{1}.']':'') |
.'</label>' |
.'</label>' |
.'</td>' |
.'</td>' |
.&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table_row() |
|
); |
); |
} |
} |
|
|
|
# Display rows for all course maps and folders |
foreach my $id (@{$tree}) { |
foreach my $id (@{$tree}) { |
my ($mapid,$resid)=split(/\./,$id); |
my ($mapid,$resid)=split(/\./,$id); |
# Indentation |
# Indentation |
Line 1811 sub mapmenu {
|
Line 1813 sub mapmenu {
|
my $symb_name = $$symbp{$id}; |
my $symb_name = $$symbp{$id}; |
my ($front, $tail) = split (/___${resid}___/, $symb_name); |
my ($front, $tail) = split (/___${resid}___/, $symb_name); |
$symb_name = $tail; |
$symb_name = $tail; |
$r->print(&Apache::loncommon::start_data_table_row() |
$r->print( |
.'<td>'.$indent.$icon |
&Apache::loncommon::start_data_table_row() |
.'<label> ' |
.'<td>' |
.'<input type ="radio" name="pschp" value="'.$allmaps_inverted{$symb_name}.'"' |
.'<label>' |
); |
); |
if ($pschp eq $allmaps_inverted{$symb_name}) { |
# Only offer radio button for folders/maps which can be parameterized |
$r->print(' checked="checked"'); |
if ($allmaps_inverted{$symb_name}) { |
|
$r->print( |
|
'<input type ="radio" name="pschp"' |
|
.' value="'.$allmaps_inverted{$symb_name}.'"' |
|
); |
|
$r->print(' checked="checked"') if ($allmaps_inverted{$symb_name} eq $pschp); |
|
$r->print('/>'); |
|
} else { |
|
$r->print($whitespace); |
} |
} |
$r->print('/>' |
$r->print( |
.$treeinfo->{$id}->{name} |
$indent.$icon.' ' |
.($$allmaps{$mapid}!~/^uploaded/?' ['.$$allmaps{$mapid}.']':'') |
.$treeinfo->{$id}->{name} |
.'</label>' |
.($$allmaps{$mapid}!~/^uploaded/?' ['.$$allmaps{$mapid}.']':'') |
.'</td>' |
.'</label>' |
.&Apache::loncommon::end_data_table_row() |
.'</td>' |
|
.&Apache::loncommon::end_data_table_row() |
); |
); |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
|
|
$r->print(&Apache::loncommon::end_data_table(). |
|
'<br style="line-height:2px;" />'. |
|
&Apache::loncommon::end_scrollbox()); |
} |
} |
} |
} |
|
|
Line 1953 sub standardkeyorder {
|
Line 1967 sub standardkeyorder {
|
'parameter_0_tol' => 16, |
'parameter_0_tol' => 16, |
'parameter_0_sig' => 17, |
'parameter_0_sig' => 17, |
'parameter_0_turnoffunit' => 18, |
'parameter_0_turnoffunit' => 18, |
'parameter_0_discussend' => 19, |
'parameter_0_discussend' => 19, |
'parameter_0_discusshide' => 20); |
'parameter_0_discusshide' => 20, |
|
'parameter_0_discussvote' => 21, |
|
'parameter_0_printstartdate' => 22, |
|
'parameter_0_printenddate' => 23); |
} |
} |
|
|
|
|
Line 1962 sub assessparms {
|
Line 1979 sub assessparms {
|
|
|
my $r=shift; |
my $r=shift; |
|
|
|
|
|
|
|
# -------------------------------------------------------- Variable declaration |
my @ids=(); |
my @ids=(); |
my %symbp=(); |
my %symbp=(); |
my %mapp=(); |
my %mapp=(); |
Line 1969 sub assessparms {
|
Line 1989 sub assessparms {
|
my %keyp=(); |
my %keyp=(); |
my %uris=(); |
my %uris=(); |
my %maptitles=(); |
my %maptitles=(); |
|
|
# -------------------------------------------------------- Variable declaration |
|
|
|
my %allmaps=(); |
my %allmaps=(); |
my %alllevs=(); |
my %alllevs=(); |
|
|
Line 1990 sub assessparms {
|
Line 2007 sub assessparms {
|
|
|
my %allparms; |
my %allparms; |
my %allparts; |
my %allparts; |
|
# ------------------------------------------------------------------------------ |
|
|
# |
# |
# Order in which these parameters will be displayed |
# Order in which these parameters will be displayed |
# |
# |
my %keyorder=&standardkeyorder(); |
my %keyorder=&standardkeyorder(); |
|
|
@ids=(); |
# @ids=(); |
%symbp=(); |
# %symbp=(); # These seem defined above already. |
%typep=(); |
# %typep=(); |
|
|
my $message=''; |
my $message=''; |
|
|
Line 2014 sub assessparms {
|
Line 2033 sub assessparms {
|
|
|
my @pscat=&Apache::loncommon::get_env_multiple('form.pscat'); |
my @pscat=&Apache::loncommon::get_env_multiple('form.pscat'); |
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]='0'; } |
|
if (($env{'form.part'}) && ($psprt[0] ne 'all')) { $psprt[0]=$env{'form.part'}; } |
|
|
my $pssymb=''; |
my $pssymb=''; |
my $parmlev=''; |
my $parmlev=''; |
Line 2083 sub assessparms {
|
Line 2105 sub assessparms {
|
$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('ID').": ".$name{'id'}.'<p>'; |
"<br />\n".&mt('Student/Employee ID').": ".$name{'id'}.'<p>'; |
} |
} |
@usersgroups = &Apache::lonnet::get_users_groups( |
@usersgroups = &Apache::lonnet::get_users_groups( |
$udom,$uname,$env{'request.course.id'}); |
$udom,$uname,$env{'request.course.id'}); |
Line 2111 sub assessparms {
|
Line 2133 sub assessparms {
|
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'}); |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
|
my ($got_chostname,$chostname,$cmajor,$cminor); |
|
my $totalstored = 0; |
|
my $now = time; |
|
|
for (my $i=0;$i<=$#markers;$i++) { |
for (my $i=0;$i<=$#markers;$i++) { |
|
my ($needsrelease,$needsnewer,$name); |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
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); |
my ($level,@all) = |
my ($level,@all) = |
Line 2144 sub assessparms {
|
Line 2172 sub assessparms {
|
} |
} |
} |
} |
} |
} |
|
} elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote|examcode|printstartdate|printenddate)\&\d+$/) { |
|
$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 = |
|
$Apache::lonnet::needsrelease{"parameter:$name:$val"}; |
|
if ($needsrelease) { |
|
unless ($got_chostname) { |
|
($chostname,$cmajor,$cminor) = ¶meter_release_vars(); |
|
$got_chostname = 1; |
|
} |
|
$needsnewer = ¶meter_releasecheck($name,$val, |
|
$needsrelease, |
|
$cmajor,$cminor); |
|
} |
|
} |
|
if ($needsnewer) { |
|
$message .= &oldversion_warning($name,$values[$i],$chostname,$cmajor, |
|
$cminor,$needsrelease); |
|
} else { |
|
$message.=&storeparm(split(/\&/,$markers[$i]), |
|
$values[$i], |
|
$types[$i], |
|
$uname,$udom,$csec,$cgroup); |
|
$totalstored ++; |
} |
} |
$message.=&storeparm(split(/\&/,$markers[$i]), |
|
$values[$i], |
|
$types[$i], |
|
$uname,$udom,$csec,$cgroup); |
|
} |
} |
# ---------------------------------------------------------------- Done storing |
# ---------------------------------------------------------------- Done storing |
$message.='<p class="LC_warning">' |
if ($totalstored) { |
.&mt('Changes can take up to 10 minutes before being active for all students.') |
$message.='<p class="LC_warning">' |
.&Apache::loncommon::help_open_topic('Caching') |
.&mt('Changes can take up to 10 minutes before being active for all students.') |
.'</p>'; |
.&Apache::loncommon::help_open_topic('Caching') |
|
.'</p>'; |
|
} |
} |
} |
#----------------------------------------------- if all selected, fill in array |
#----------------------------------------------- if all selected, fill in array |
if ($pscat[0] eq "all") {@pscat = (keys %allparms);} |
if ($pscat[0] eq "all") {@pscat = (keys %allparms);} |
if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') }; |
if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries','type','problemstatus') }; |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
# ------------------------------------------------------------------ Start page |
# ------------------------------------------------------------------ Start page |
|
|
&startpage($r); |
&startpage($r,$pssymb); |
|
|
foreach ('tolerance','date_default','date_start','date_end', |
foreach ('tolerance','date_default','date_start','date_end', |
'date_interval','int','float','string') { |
'date_interval','int','float','string') { |
Line 2194 ENDPARMSELSCRIPT
|
Line 2261 ENDPARMSELSCRIPT
|
} |
} |
|
|
# Step 1 |
# Step 1 |
$r->print(&Apache::lonhtmlcommon::topic_bar(1,&mt('Resource Specification'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar(1,&mt('Resource Specification'),'parmstep1')); |
$r->print(<<COURSECONTENTSCRIPT); |
$r->print(' |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA['. |
function showHide_courseContent(){ |
&showhide_js().' |
var parmlevValue=document.getElementById("parmlev").value; |
|
if (parmlevValue == 'general') { |
|
document.getElementById('mapmenu').style.display="none"; |
|
} else { |
|
if ((parmlevValue == "full") || (parmlevValue == "map")) { |
|
document.getElementById('mapmenu').style.display =""; |
|
} else { |
|
document.getElementById('mapmenu').style.display="none"; |
|
} |
|
} |
|
} |
|
// ]]> |
// ]]> |
</script> |
</script> |
COURSECONTENTSCRIPT |
'); |
|
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
|
&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); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp); |
Line 2225 COURSECONTENTSCRIPT
|
Line 2280 COURSECONTENTSCRIPT
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
|
# Step 2 |
# Step 2 |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2')); |
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); |
&displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder,'parmmenuscroll'); |
|
|
# Step 3 |
# Step 3 |
$r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'))); |
$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); |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
Line 2238 COURSECONTENTSCRIPT
|
Line 2293 COURSECONTENTSCRIPT
|
# Update Display Button |
# Update Display Button |
$r->print('<p>' |
$r->print('<p>' |
.'<input type="submit" name="dis"' |
.'<input type="submit" name="dis"' |
.' value="'.&mt('Update Parameter Display').'" />' |
.' value="'.&mt('Update Display').'" />' |
.'<input type="hidden" name="hideparmsel" value="hidden" />' |
.'<input type="hidden" name="hideparmsel" value="hidden" />' |
.'</p>'); |
.'</p>'); |
$r->print('</div>'); |
$r->print('</div>'); |
Line 2254 COURSECONTENTSCRIPT
|
Line 2309 COURSECONTENTSCRIPT
|
.'</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); |
$r->print(&mt('Specific Resource: [_1] ([_2])',$title,$resource). |
$r->print(&mt('Specific Resource: [_1] ([_2])', |
|
$title,'<span class="LC_filename">'.$resource.'</span>'). |
'<input type="hidden" value="'.$pssymb.'" name="symb" />'. |
'<input type="hidden" value="'.$pssymb.'" name="symb" />'. |
'<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')). |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')). |
'<label>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'. |
'<label>'. |
($env{'form.psprt'}?' checked="checked"':'').' /></label></td></tr>'); |
'<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); |
&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()); |
$r->print('<p>' |
$r->print('<p>' |
.'<input type="submit" name="dis"' |
.'<input type="submit" name="dis"' |
.' value="'.&mt('Update Parameter Display').'" />' |
.' value="'.&mt('Update Display').'" />' |
.'<input type="hidden" name="hideparmsel" value="hidden" />' |
.'<input type="hidden" name="hideparmsel" value="hidden" />' |
.'</p>'); |
.'</p>'); |
} |
} |
Line 2296 COURSECONTENTSCRIPT
|
Line 2356 COURSECONTENTSCRIPT
|
my $csudom=$env{'user.domain'}; |
my $csudom=$env{'user.domain'}; |
|
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
|
# |
|
# This produces the cascading table output of parameters |
|
# |
my $coursespan=$csec?8:5; |
my $coursespan=$csec?8:5; |
my $userspan=3; |
my $userspan=3; |
if ($cgroup ne '') { |
if ($cgroup ne '') { |
$coursespan += 3; |
$coursespan += 3; |
} |
} |
|
|
$r->print('<p><table border="2">'); |
$r->print(&Apache::loncommon::start_data_table()); |
|
# |
|
# This produces the headers |
|
# |
$r->print('<tr><td colspan="5"></td>'); |
$r->print('<tr><td colspan="5"></td>'); |
$r->print('<th colspan="'.($coursespan).'">'.&mt('Any User').'</th>'); |
$r->print('<th colspan="'.($coursespan).'">'.&mt('Any User').'</th>'); |
if ($uname) { |
if ($uname) { |
Line 2315 COURSECONTENTSCRIPT
|
Line 2381 COURSECONTENTSCRIPT
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'pie' => "Parameter in Effect", |
'pie' => "Parameter in Effect", |
'csv' => "Current Session Value", |
'csv' => "Current Session Value", |
'at' => 'at', |
|
'rl' => "Resource Level", |
'rl' => "Resource Level", |
'ic' => 'in Course', |
'ic' => 'in Course', |
'aut' => "Assessment URL and Title", |
'aut' => "Assessment URL and Title", |
Line 2331 COURSECONTENTSCRIPT
|
Line 2396 COURSECONTENTSCRIPT
|
); |
); |
$r->print(<<ENDTABLETWO); |
$r->print(<<ENDTABLETWO); |
<th rowspan="3">$lt{'pie'}</th> |
<th rowspan="3">$lt{'pie'}</th> |
<th rowspan="3">$lt{'csv'}<br />($csuname $lt{'at'} $csudom)</th> |
<th rowspan="3">$lt{'csv'}<br />($csuname:$csudom)</th> |
</tr><tr><td colspan="5"></td><th colspan="2">$lt{'ic'}</th><th colspan="2">$lt{'rl'}</th> |
</tr><tr><td colspan="5"></td><th colspan="2">$lt{'ic'}</th><th colspan="2">$lt{'rl'}</th> |
<th colspan="1">$lt{'ic'}</th> |
<th colspan="1">$lt{'ic'}</th> |
|
|
Line 2367 ENDTABLEHEADFOUR
|
Line 2432 ENDTABLEHEADFOUR
|
} |
} |
|
|
$r->print('</tr>'); |
$r->print('</tr>'); |
|
# |
|
# Done with the headers |
|
# |
my $defbgone=''; |
my $defbgone=''; |
my $defbgtwo=''; |
my $defbgtwo=''; |
my $defbgthree = ''; |
my $defbgthree = ''; |
Line 2407 ENDTABLEHEADFOUR
|
Line 2474 ENDTABLEHEADFOUR
|
my %default=(); |
my %default=(); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
|
|
|
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'); |
|
# We may only want certain parameters listed |
|
if ($filter) { |
|
unless ($filter=~/\Q$parmname\E/) { next; } |
|
} |
|
$name{$_}=$parmname; |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part'); |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part'); |
$name{$_}=&Apache::lonnet::metadata($uri,$_.'.name'); |
|
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display'); |
if ($allparms{$name{$_}} ne '') { |
if ($allparms{$name{$_}} ne '') { |
my $identifier; |
my $identifier; |
Line 2455 ENDTABLEHEADFOUR
|
Line 2529 ENDTABLEHEADFOUR
|
$r->print('<td style="background-color:'.$defbgone.';"'. |
$r->print('<td style="background-color:'.$defbgone.';"'. |
' rowspan='.$totalparms. |
' rowspan='.$totalparms. |
'>'.$maptitles{$mapp{$rid}}.'</td>'); |
'>'.$maptitles{$mapp{$rid}}.'</td>'); |
|
|
foreach (&keysinorder_bytype(\%name,\%keyorder)) { |
foreach (&keysinorder_bytype(\%name,\%keyorder)) { |
|
|
unless ($firstrow) { |
unless ($firstrow) { |
$r->print('<tr>'); |
$r->print('<tr>'); |
} else { |
} else { |
Line 2471 ENDTABLEHEADFOUR
|
Line 2545 ENDTABLEHEADFOUR
|
} |
} |
} # end foreach ids |
} # end foreach ids |
# -------------------------------------------------- End entry for one resource |
# -------------------------------------------------- End entry for one resource |
$r->print('</table>'); |
$r->print(&Apache::loncommon::end_data_table); |
} # end of full |
} # end of full |
#--------------------------------------------------- Entry for parm level map |
#--------------------------------------------------- Entry for parm level map |
if ($parmlev eq 'map') { |
if ($parmlev eq 'map') { |
Line 2687 ENDMAPONE
|
Line 2761 ENDMAPONE
|
); |
); |
} # end of $parmlev eq general |
} # end of $parmlev eq general |
} |
} |
$r->print('</form>'.&Apache::loncommon::end_page()); |
$r->print('</form>'); |
|
$r->print(&Apache::loncommon::end_page()); |
} # end sub assessparms |
} # end sub assessparms |
|
|
################################################## |
################################################## |
Line 2749 sub storedata {
|
Line 2824 sub storedata {
|
undef %newdata; |
undef %newdata; |
my @deldata=(); |
my @deldata=(); |
undef @deldata; |
undef @deldata; |
foreach (keys %env) { |
my ($got_chostname,$chostname,$cmajor,$cminor); |
if ($_=~/^form\.([a-z]+)\_(.+)$/) { |
my $now = time; |
|
foreach my $key (keys(%env)) { |
|
if ($key =~ /^form\.([a-z]+)\_(.+)$/) { |
my $cmd=$1; |
my $cmd=$1; |
my $thiskey=$2; |
my $thiskey=$2; |
my ($tuname,$tudom)=&extractuser($thiskey); |
my ($tuname,$tudom)=&extractuser($thiskey); |
Line 2759 sub storedata {
|
Line 2836 sub storedata {
|
$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); |
my ($data, $typeof, $text, $name, $valchk); |
if ($cmd eq 'set') { |
if ($cmd eq 'set') { |
$data=$env{$_}; |
$data=$env{$key}; |
|
$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') { |
|
$name = 'type'; |
|
} elsif ($typeof eq 'string_lenient') { |
|
$name = 'lenient'; |
|
} elsif ($typeof eq 'string_discussvote') { |
|
$name = 'discussvote'; |
|
} elsif ($typeof eq 'string_examcode') { |
|
$name = 'examcode'; |
|
if (&Apache::lonnet::validCODE($data)) { |
|
$valchk = 'valid'; |
|
} |
|
} elsif ($typeof eq 'string_yesno') { |
|
if ($thiskey =~ /\.retrypartial$/) { |
|
$name = 'retrypartial'; |
|
} |
|
} |
} elsif ($cmd eq 'datepointer') { |
} elsif ($cmd eq 'datepointer') { |
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$_}); |
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$key}); |
$typeof=$env{'form.typeof_'.$thiskey}; |
$typeof=$env{'form.typeof_'.$thiskey}; |
$text = &mt('Saved modified date for'); |
$text = &mt('Saved modified date for'); |
|
if ($typeof eq 'date_start') { |
|
if ($thiskey =~ /\.printstartdate$/) { |
|
$name = 'printstartdate'; |
|
if (($data) && ($data > $now)) { |
|
$valchk = 'future'; |
|
} |
|
} |
|
} elsif ($typeof eq 'date_end') { |
|
if ($thiskey =~ /\.printenddate$/) { |
|
$name = 'printenddate'; |
|
if (($data) && ($data < $now)) { |
|
$valchk = 'past'; |
|
} |
|
} |
|
} |
} elsif ($cmd eq 'dateinterval') { |
} elsif ($cmd eq 'dateinterval') { |
$data=&get_date_interval_from_form($thiskey); |
$data=&get_date_interval_from_form($thiskey); |
$typeof=$env{'form.typeof_'.$thiskey}; |
$typeof=$env{'form.typeof_'.$thiskey}; |
$text = &mt('Saved modified date for'); |
$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) { |
|
$r->print('<br />'.&oldversion_warning($name,$data, |
|
$chostname,$cmajor, |
|
$cminor,$needsrelease)); |
|
next; |
|
} |
|
} |
|
} |
if (defined($data) and $$olddata{$thiskey} ne $data) { |
if (defined($data) and $$olddata{$thiskey} ne $data) { |
if ($tuname) { |
if ($tuname) { |
if (&Apache::lonnet::put('resourcedata',{$tkey=>$data, |
if (&Apache::lonnet::put('resourcedata',{$tkey=>$data, |
Line 2815 sub storedata {
|
Line 2943 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 [_1] parameter(s)</h2>',$delentries)); |
$r->print('<h2>'.&mt('Deleted quant,_1,parameter]',$delentries/2).'</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 2825 sub storedata {
|
Line 2953 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 [_1] parameter(s)',$putentries/2).'</h3>'); |
$r->print('<h3>'.&mt('Saved [quant,_1,parameter]',$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 2994 sub listdata {
|
Line 3122 sub listdata {
|
$$resourcedata{$thiskey})); |
$$resourcedata{$thiskey})); |
} elsif ($thistype =~ m/^string/) { |
} elsif ($thistype =~ m/^string/) { |
$r->print(&string_selector($thistype,$thiskey, |
$r->print(&string_selector($thistype,$thiskey, |
$$resourcedata{$thiskey})); |
$$resourcedata{$thiskey},$name)); |
} else { |
} else { |
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); |
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); |
} |
} |
Line 3020 sub date_interval_selector {
|
Line 3148 sub date_interval_selector {
|
my %select = ((map {$_ => $_} (0..$max)), |
my %select = ((map {$_ => $_} (0..$max)), |
'select_form_order' => [0..$max]); |
'select_form_order' => [0..$max]); |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
%select); |
\%select); |
$result .= ' '.&mt($name); |
$result .= ' '.&mt($name); |
} |
} |
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
Line 3059 my %strings =
|
Line 3187 my %strings =
|
[ 'answer', 'Yes, and show correct answer if they exceed the maximum number of tries.' ], |
[ 'answer', 'Yes, and show correct answer if they exceed the maximum number of tries.' ], |
[ 'no', 'No, don\'t show correct/incorrect feedback.' ], |
[ 'no', 'No, don\'t show correct/incorrect feedback.' ], |
[ 'no_feedback_ever', 'No, show no feedback at all.' ]], |
[ 'no_feedback_ever', 'No, show no feedback at all.' ]], |
|
'string_questiontype' |
|
=> [[ 'problem', 'Standard Problem'], |
|
[ 'survey', 'Survey'], |
|
[ 'anonsurveycred', 'Anonymous Survey (credit for submission)'], |
|
[ 'exam', 'Exam'], |
|
[ 'anonsurvey', 'Anonymous Survey'], |
|
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], |
|
[ 'practice', 'Practice'], |
|
[ 'surveycred', 'Survey (credit for submission)']], |
|
'string_lenient' |
|
=> [['yes', 'Yes' ], |
|
[ 'no', 'No' ], |
|
[ 'default', 'Default - only bubblesheet grading is lenient' ]], |
|
'string_discussvote' |
|
=> [['yes','Yes'], |
|
['notended','Yes, unless discussion ended'], |
|
['no','No']], |
); |
); |
|
|
|
sub standard_string_options { |
|
my ($string_type) = @_; |
|
if (ref($strings{$string_type}) eq 'ARRAY') { |
|
return $strings{$string_type}; |
|
} |
|
return; |
|
} |
|
|
sub string_selector { |
sub string_selector { |
my ($thistype, $thiskey, $showval) = @_; |
my ($thistype, $thiskey, $showval, $name) = @_; |
|
|
if (!exists($strings{$thistype})) { |
if (!exists($strings{$thistype})) { |
return &default_selector($thiskey,$showval); |
return &default_selector($thiskey,$showval); |
} |
} |
|
|
|
my %skiptype; |
|
if (($thistype eq 'string_questiontype') || |
|
($thistype eq 'string_lenient') || |
|
($thistype eq 'string_discussvote') || |
|
($name eq 'retrypartial')) { |
|
my ($got_chostname,$chostname,$cmajor,$cminor); |
|
foreach my $possibilities (@{ $strings{$thistype} }) { |
|
next unless (ref($possibilities) eq 'ARRAY'); |
|
my ($parmval, $description) = @{ $possibilities }; |
|
my $needsrelease=$Apache::lonnet::needsrelease{"parameter:$name:$parmval"}; |
|
if ($needsrelease) { |
|
unless ($got_chostname) { |
|
($chostname,$cmajor,$cminor)=¶meter_release_vars(); |
|
$got_chostname = 1; |
|
} |
|
my $needsnewer=¶meter_releasecheck($name,$parmval,$needsrelease, |
|
$cmajor,$cminor); |
|
if ($needsnewer) { |
|
$skiptype{$parmval} = 1; |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
my $result; |
my $result; |
foreach my $possibilities (@{ $strings{$thistype} }) { |
my $numinrow = 3; |
my ($name, $description) = @{ $possibilities }; |
if ($thistype eq 'string_problemstatus') { |
$result .= '<label><input type="radio" name="set_'.$thiskey. |
$numinrow = 2; |
'" value="'.$name.'"'; |
} elsif ($thistype eq 'string_questiontype') { |
if ($showval eq $name) { |
if (keys(%skiptype) > 0) { |
$result .= ' checked="checked"'; |
$numinrow = 4; |
|
} |
|
} |
|
my $rem; |
|
if (ref($strings{$thistype}) eq 'ARRAY') { |
|
my $i=0; |
|
foreach my $possibilities (@{ $strings{$thistype} }) { |
|
next unless (ref($possibilities) eq 'ARRAY'); |
|
my ($name, $description) = @{ $possibilities }; |
|
next if ($skiptype{$name}); |
|
$rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$result .= '</tr>'; |
|
} |
|
$result .= '<tr>'; |
|
} |
|
$result .= '<td class="LC_left_item">'. |
|
'<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="set_'.$thiskey. |
|
'" value="'.$name.'"'; |
|
if ($showval eq $name) { |
|
$result .= ' checked="checked"'; |
|
} |
|
$result .= ' />'.&mt($description).'</label></span></td>'; |
|
$i++; |
|
} |
|
$rem = @{ $strings{$thistype} }%($numinrow); |
|
my $colsleft = $numinrow - $rem; |
|
if ($colsleft > 1 ) { |
|
$result .= '<td colspan="'.$colsleft.'" class="LC_left_item">'. |
|
' </td>'; |
|
} elsif ($colsleft == 1) { |
|
$result .= '<td class="LC_left_item"> </td>'; |
|
} |
|
$result .= '</tr>'; |
} |
} |
$result .= ' />'.&mt($description).'</label> '; |
if ($result) { |
|
$result = '<table border="0">'.$result.'</table>'; |
} |
} |
return $result; |
return $result; |
} |
} |
Line 3124 sub newoverview {
|
Line 3337 sub newoverview {
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
&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('Set Parameters'); |
|
|
my %loaditems = ( |
|
'onload' => "showHide_courseContent(); resize_scrollbox('mapmenuscroll','1','1');", |
|
); |
|
my $js = ' |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
'. |
|
&Apache::lonhtmlcommon::resize_scrollbox_js('params')."\n". |
|
&showhide_js()."\n". |
|
'// ]]> |
|
</script> |
|
'; |
|
my $start_page = &Apache::loncommon::start_page('Set Parameters',$js, |
|
{'add_entries' => \%loaditems,}); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
|
$r->print($start_page.$breadcrumbs); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
$start_page |
|
$breadcrumbs |
|
<form method="post" action="/adm/parmset?action=newoverview" name="parmform"> |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform"> |
ENDOVER |
ENDOVER |
my @ids=(); |
my @ids=(); |
Line 3154 ENDOVER
|
Line 3380 ENDOVER
|
|
|
my @pscat=&Apache::loncommon::get_env_multiple('form.pscat'); |
my @pscat=&Apache::loncommon::get_env_multiple('form.pscat'); |
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]='0'; } |
|
|
Line 3189 ENDOVER
|
Line 3416 ENDOVER
|
$r->print('<div class="LC_Box">'); |
$r->print('<div class="LC_Box">'); |
#$r->print('<h2 class="LC_hcell">Step 1</h2>'); |
#$r->print('<h2 class="LC_hcell">Step 1</h2>'); |
$r->print('<div>'); |
$r->print('<div>'); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
if ($parmlev ne 'general') { |
if ($parmlev ne 'general') { |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
Line 3201 ENDOVER
|
Line 3428 ENDOVER
|
|
|
$r->print('<div class="LC_Box">'); |
$r->print('<div class="LC_Box">'); |
$r->print('<div>'); |
$r->print('<div>'); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
&displaymenu($r,\%allparms,\@pscat,\%keyorder); |
&parmmenu($r,\%allparms,\@pscat,\%keyorder); |
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
&parmboxes($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'))); |
$r->print('<table>'. |
$r->print('<table>'. |
Line 3254 ENDOVER
|
Line 3478 ENDOVER
|
} |
} |
$r->print(&tableend(). |
$r->print(&tableend(). |
((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':''). |
((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':''). |
'</form>'.&Apache::loncommon::end_page()); |
'</form>'); |
|
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
sub secgroup_lister { |
sub secgroup_lister { |
Line 3301 sub overview {
|
Line 3526 sub overview {
|
text=>"Overview Mode"}); |
text=>"Overview Mode"}); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters'); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print(<<ENDOVER); |
$r->print($start_page.$breadcrumbs); |
$start_page |
$r->print('<form method="post" action="/adm/parmset?action=setoverview" name="parmform">'); |
$breadcrumbs |
|
<form method="post" action="/adm/parmset?action=setoverview" name="parmform"> |
|
ENDOVER |
|
# Store modified |
# Store modified |
|
|
&storedata($r,$crs,$dom); |
&storedata($r,$crs,$dom); |
Line 3324 ENDOVER
|
Line 3547 ENDOVER
|
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder); |
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder); |
|
|
$r->print(&tableend().'<p>'. |
$r->print(&tableend().'<p>'. |
($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':&mt('There are no parameters.')).'</p></form>'. |
($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':'<span class="LC_info">'.&mt('There are no parameters.').'</span>').'</p></form>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3400 ENDOVER
|
Line 3623 ENDOVER
|
} elsif ($data{'realm_type'} eq 'symb') { |
} elsif ($data{'realm_type'} eq 'symb') { |
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] <br /> with ID: [_2] <br /> in folder [_3]', |
$r->print(&mt('Resource: [_1]with ID: [_2]in folder [_3]', |
$url,$resid,$map)); |
$url.' <br /> ', |
|
$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 3410 ENDOVER
|
Line 3634 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>'); |
&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
sub date_shift_one { |
sub date_shift_one { |
Line 3423 sub date_shift_one {
|
Line 3647 sub date_shift_one {
|
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(<<ENDOVER); |
$r->print($start_page.$breadcrumbs); |
$start_page |
$r->print('<form name="shiftform" method="post" action="">'. |
$breadcrumbs |
|
ENDOVER |
|
$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>'. |
Line 3450 sub date_shift_two {
|
Line 3671 sub date_shift_two {
|
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(<<ENDOVER); |
$r->print($start_page.$breadcrumbs); |
$start_page |
|
$breadcrumbs |
|
ENDOVER |
|
my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted'); |
my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted'); |
$r->print(&mt('Shifting all dates such that [_1] becomes [_2]', |
$r->print('<h2>'.&mt('Shift Dates').'</h2>'. |
|
'<p>'.&mt('Shifting all dates such that [_1] becomes [_2]', |
&Apache::lonlocal::locallocaltime($env{'form.timebase'}), |
&Apache::lonlocal::locallocaltime($env{'form.timebase'}), |
&Apache::lonlocal::locallocaltime($timeshifted))); |
&Apache::lonlocal::locallocaltime($timeshifted)).'</p>'); |
my $delta=$timeshifted-$env{'form.timebase'}; |
my $delta=$timeshifted-$env{'form.timebase'}; |
&dateshift($delta); |
&dateshift($delta); |
|
$r->print( |
|
&Apache::lonhtmlcommon::confirm_success(&mt('Done')). |
|
'<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 3503 sub parse_key {
|
Line 3727 sub parse_key {
|
} |
} |
|
|
|
|
|
|
sub extract_cloners { |
|
my ($clonelist,$allowclone) = @_; |
|
if ($clonelist =~ /,/) { |
|
@{$allowclone} = split(/,/,$clonelist); |
|
} else { |
|
$$allowclone[0] = $clonelist; |
|
} |
|
} |
|
|
|
sub check_cloners { |
|
my ($clonelist,$oldcloner) = @_; |
|
my ($clean_clonelist,%disallowed); |
|
my @allowclone = (); |
|
&extract_cloners($$clonelist,\@allowclone); |
|
foreach my $currclone (@allowclone) { |
|
if (!grep(/^\Q$currclone\E$/,@$oldcloner)) { |
|
if ($currclone eq '*') { |
|
$clean_clonelist .= $currclone.','; |
|
} else { |
|
my ($uname,$udom) = split(/:/,$currclone); |
|
if ($uname eq '*') { |
|
if ($udom =~ /^$match_domain$/) { |
|
if (!&Apache::lonnet::domain($udom)) { |
|
$disallowed{'domain'} .= $currclone.','; |
|
} else { |
|
$clean_clonelist .= $currclone.','; |
|
} |
|
} else { |
|
$disallowed{'format'} .= $currclone.','; |
|
} |
|
} elsif ($currclone !~/^($match_username)\:($match_domain)$/) { |
|
$disallowed{'format'} .= $currclone.','; |
|
} else { |
|
if (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { |
|
$disallowed{'newuser'} .= $currclone.','; |
|
} else { |
|
$clean_clonelist .= $currclone.','; |
|
} |
|
} |
|
} |
|
} else { |
|
$clean_clonelist .= $currclone.','; |
|
} |
|
} |
|
foreach my $key (keys(%disallowed)) { |
|
$disallowed{$key} =~ s/,$//; |
|
} |
|
if ($clean_clonelist) { |
|
$clean_clonelist =~ s/,$//; |
|
} |
|
$$clonelist = $clean_clonelist; |
|
return %disallowed; |
|
} |
|
|
|
sub change_clone { |
|
my ($clonelist,$oldcloner) = @_; |
|
my ($uname,$udom); |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $clone_crs = $cnum.':'.$cdom; |
|
|
|
if ($cnum && $cdom) { |
|
my @allowclone; |
|
&extract_cloners($clonelist,\@allowclone); |
|
foreach my $currclone (@allowclone) { |
|
if (!grep(/^$currclone$/,@$oldcloner)) { |
|
if ($currclone ne '*') { |
|
($uname,$udom) = split(/:/,$currclone); |
|
if ($uname && $udom && $uname ne '*') { |
|
if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') { |
|
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
|
if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) { |
|
if ($currclonecrs{'cloneable'} eq '') { |
|
$currclonecrs{'cloneable'} = $clone_crs; |
|
} else { |
|
$currclonecrs{'cloneable'} .= ','.$clone_crs; |
|
} |
|
&Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
foreach my $oldclone (@$oldcloner) { |
|
if (!grep(/^\Q$oldclone\E$/,@allowclone)) { |
|
if ($oldclone ne '*') { |
|
($uname,$udom) = split(/:/,$oldclone); |
|
if ($uname && $udom && $uname ne '*' ) { |
|
if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') { |
|
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
|
my %newclonecrs = (); |
|
if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) { |
|
if ($currclonecrs{'cloneable'} =~ /,/) { |
|
my @currclonecrs = split/,/,$currclonecrs{'cloneable'}; |
|
foreach my $crs (@currclonecrs) { |
|
if ($crs ne $clone_crs) { |
|
$newclonecrs{'cloneable'} .= $crs.','; |
|
} |
|
} |
|
$newclonecrs{'cloneable'} =~ s/,$//; |
|
} else { |
|
$newclonecrs{'cloneable'} = ''; |
|
} |
|
&Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
|
|
sub header { |
sub header { |
return &Apache::loncommon::start_page('Parameter Manager'); |
return &Apache::loncommon::start_page('Content and Problem Settings'); |
} |
} |
|
|
|
|
Line 3630 sub print_main_menu {
|
Line 3737 sub print_main_menu {
|
my ($r,$parm_permission)=@_; |
my ($r,$parm_permission)=@_; |
# |
# |
$r->print(&header()); |
$r->print(&header()); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Manager')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Content and Problem Settings')); |
$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 3640 ENDMAINFORMHEAD
|
Line 3747 ENDMAINFORMHEAD
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
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'}); |
|
if ((!$dcm) && ($env{'request.course.sec'} ne '')) { |
|
$dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}. |
|
'/'.$env{'request.course.sec'}); |
|
} |
|
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $lc_crstype = lc($crstype); |
my $lc_crstype = lc($crstype); |
|
|
my @menu = |
my @menu = |
( { categorytitle=>"Settings for this $crstype", |
( { categorytitle=>"Content Settings for this $crstype", |
items => [ |
items => [ |
{ linktext => "$crstype Configuration", |
|
url => '/adm/courseprefs?origin=params', |
|
permission => $parm_permission, |
|
linktitle => "Edit $lc_crstype configuration." , |
|
icon => 'preferences-desktop-remote-desktop.png' , |
|
#help => 'Course_Environment', |
|
}, |
|
{ linktext => 'Portfolio Metadata', |
{ linktext => 'Portfolio Metadata', |
url => '/adm/parmset?action=setrestrictmeta', |
url => '/adm/parmset?action=setrestrictmeta', |
permission => $parm_permission, |
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 => "Manage $crstype Slots", |
|
url => '/adm/slotrequest?command=showslots', |
|
permission => $vgr, |
|
linktitle => "Manage slots for this $lc_crstype." , |
|
icon => 'rsrv.png' , |
|
}, |
|
{ linktext => 'Reset Student Access Times', |
{ linktext => 'Reset Student Access Times', |
url => '/adm/helper/resettimes.helper', |
url => '/adm/helper/resettimes.helper', |
permission => $mgr, |
permission => $mgr, |
linktitle => "Reset access times for folders/maps, resources or the $lc_crstype." , |
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', |
|
url => '/adm/setblock', |
|
permission => $dcm, |
|
linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam', |
|
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, |
permission => $parm_permission, |
Line 3719 ENDMAINFORMHEAD
|
Line 3823 ENDMAINFORMHEAD
|
}]} |
}]} |
); |
); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
|
$r->print('</form>'.&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
|
|
Line 3847 sub order_meta_fields {
|
Line 3952 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 4052 sub defaultsetter {
|
Line 4157 sub defaultsetter {
|
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(<<ENDDEFHEAD); |
$r->print($start_page.$breadcrumbs); |
$start_page |
$r->print('<form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">'); |
$breadcrumbs |
|
<form method="post" action="/adm/parmset?action=setdefaults" name="defaultform"> |
|
ENDDEFHEAD |
|
|
|
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'}; |
Line 4201 ENDYESNO
|
Line 4303 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"); |
&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
|
|
Line 4292 sub parm_change_log {
|
Line 4394 sub parm_change_log {
|
my ($r)=@_; |
my ($r)=@_; |
&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"}); |
$r->print(&Apache::loncommon::start_page('Parameter Change Log')); |
my $js = '<script type="text/javascript">'."\n". |
|
'// <![CDATA['."\n". |
|
&Apache::loncommon::display_filter_js('parmslog')."\n". |
|
'// ]]>'."\n". |
|
'</script>'."\n"; |
|
$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', |
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog', |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
|
|
if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); } |
if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); } |
|
|
$r->print('<form action="/adm/parmset?action=parameterchangelog" |
$r->print('<div class="LC_left_float">'. |
|
'<fieldset><legend>'.&mt('Display of Changes').'</legend>'. |
|
'<form action="/adm/parmset?action=parameterchangelog" |
method="post" name="parameterlog">'); |
method="post" name="parameterlog">'); |
|
|
my %saveable_parameters = ('show' => 'scalar',); |
my %saveable_parameters = ('show' => 'scalar',); |
Line 4309 sub parm_change_log {
|
Line 4417 sub parm_change_log {
|
\%saveable_parameters); |
\%saveable_parameters); |
&Apache::loncommon::restore_course_settings('parameter_log', |
&Apache::loncommon::restore_course_settings('parameter_log', |
\%saveable_parameters); |
\%saveable_parameters); |
$r->print(&Apache::loncommon::display_filter(). |
$r->print(&Apache::loncommon::display_filter('parmslog').' '."\n". |
'<label>'.&Apache::lonhtmlcommon::checkbox('includetypes',$env{'form.includetypes'},'1'). |
'<input type="submit" value="'.&mt('Display').'" />'. |
' '.&mt('Include parameter types').'</label>'. |
'</form></fieldset></div><br clear="all" />'); |
'<input type="submit" value="'.&mt('Display').'" /></form>'); |
|
|
|
my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'}, |
my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
Line 4509 sub update_slots {
|
Line 4616 sub update_slots {
|
action => 'reserve', |
action => 'reserve', |
context => 'parameter', |
context => 'parameter', |
); |
); |
&Apache::lonnet::instructor_log('slotreservationslog',\%storehash, |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
'',$uname,$udom,$cnum,$cdom); |
'',$uname,$udom,$cnum,$cdom); |
|
|
&Apache::lonnet::instructor_log($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 4543 sub delete_slots {
|
Line 4650 sub delete_slots {
|
action => 'release', |
action => 'release', |
context => 'parameter', |
context => 'parameter', |
); |
); |
&Apache::lonnet::instructor_log('slotreservationslog',\%storehash, |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
1,$uname,$udom,$cnum,$cdom); |
1,$uname,$udom,$cnum,$cdom); |
&Apache::lonnet::instructor_log($cdom.'_'.$cnum.'_slotlog',\%storehash, |
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
1,$uname,$udom,$uname,$udom); |
1,$uname,$udom,$uname,$udom); |
} |
} |
} |
} |
Line 4559 sub check_for_course_info {
|
Line 4666 sub check_for_course_info {
|
return 0; |
return 0; |
} |
} |
|
|
|
sub parameter_release_vars { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
|
my $chostname = &Apache::lonnet::hostname($chome); |
|
my ($cmajor,$cminor) = |
|
split(/\./,&Apache::lonnet::get_server_loncaparev($cdom,$chome)); |
|
return ($chostname,$cmajor,$cminor); |
|
} |
|
|
|
sub parameter_releasecheck { |
|
my ($name,$value,$needsrelease,$cmajor,$cminor) = @_; |
|
my $needsnewer; |
|
my ($needsmajor,$needsminor) = split(/\./,$needsrelease); |
|
if (($cmajor < $needsmajor) || |
|
($cmajor == $needsmajor && $cminor < $needsminor)) { |
|
$needsnewer = 1; |
|
} else { |
|
&Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:'.$name.':'.$value}); |
|
} |
|
return $needsnewer; |
|
} |
|
|
|
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>'; |
|
} |
|
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
Line 4574 sub handler {
|
Line 4749 sub handler {
|
'pres_marker', |
'pres_marker', |
'pres_value', |
'pres_value', |
'pres_type', |
'pres_type', |
|
'filter','part', |
'udom','uname','symb','serial','timebase']); |
'udom','uname','symb','serial','timebase']); |
|
|
|
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset", |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset", |
text=>"Parameter Manager", |
text=>"Content and Problem Settings", |
faq=>10, |
faq=>10, |
bug=>'Instructor Interface', |
bug=>'Instructor Interface', |
help => |
help => |