version 1.504, 2010/12/21 14:14:55
|
version 1.520, 2011/12/28 21:49:54
|
Line 137 javascript function 'pjump'.
|
Line 137 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: |
Input: See list below: |
|
|
=item * B<ids> : An array that will contain all of the ids in the course. |
=item * B<env{'user.name'}> : Current username |
|
|
=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{'user.domain'}> : Domain of current user. |
|
|
=item * B<keyp> : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id |
=item * b<env{"request.course.fn"} : Course |
|
|
=item * B<allparms> : hash, name of parameter->display value (what is the display value?) |
Outputs: See list below: |
|
|
=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> |
|
|
=item isdateparm() |
=item isdateparm() |
|
|
Line 196 Input: See list below:
|
Line 204 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): |
Line 302 use Apache::lonlocal;
|
Line 310 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); |
|
|
|
|
|
sub startSettingsScreen { |
|
my ($r,$mode)=@_; |
|
|
|
$r->print("\n".'<ul class="LC_TabContentBigger" id="main">'); |
|
$r->print("\n".'<li'.($mode eq 'coursepref'?' class="active"':'').'><a href="/adm/courseprefs"><b> '. |
|
&mt('Course Settings'). |
|
' </b></a></li>'); |
|
|
|
$r->print("\n".'<li'.($mode eq 'parmset'?' class="active"':'').'><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;"><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 783 sub valout {
|
Line 813 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 824 sub page_js {
|
Line 855 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 868 $selscript
|
Line 893 $selscript
|
ENDJS |
ENDJS |
|
|
} |
} |
|
|
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')"; |
|
} |
|
|
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 890 sub startpage {
|
Line 919 sub startpage {
|
{'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); |
|
&startSettingsScreen($r,'parmset'); |
$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 930 sub print_row {
|
Line 963 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 1138 sub extractResourceInformation {
|
Line 1171 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 1237 sub parmmenu {
|
Line 1271 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 1295 sub parmmenu {
|
Line 1327 sub parmmenu {
|
checkthis('problemstatus','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 class="LC_parm_parmlist">'); |
|
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 1372 sub lookUpTableParameter {
|
Line 1360 sub lookUpTableParameter {
|
'contentopen' => 'time_settings', |
'contentopen' => 'time_settings', |
'contentclose' => 'time_settings', |
'contentclose' => 'time_settings', |
'discussend' => 'time_settings', |
'discussend' => 'time_settings', |
|
'printopendate' => 'time_settings', |
|
'printclosedate' => 'time_settings', |
'weight' => 'grading', |
'weight' => 'grading', |
'handgrade' => 'grading', |
'handgrade' => 'grading', |
'maxtries' => 'tries', |
'maxtries' => 'tries', |
Line 1403 sub lookUpTableParameter {
|
Line 1393 sub lookUpTableParameter {
|
'acc' => 'misc', |
'acc' => 'misc', |
'maxcollaborators' => 'misc', |
'maxcollaborators' => 'misc', |
'scoreformat' => 'misc', |
'scoreformat' => 'misc', |
|
'lenient' => 'grading', |
|
'retrypartial' => 'tries', |
|
|
); |
); |
} |
} |
Line 1471 sub parmboxes {
|
Line 1463 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) { |
Line 1503 sub parmboxes {
|
Line 1483 sub parmboxes {
|
$r->print('<span class="LC_nobreak">' |
$r->print('<span class="LC_nobreak">' |
.'<label><input type="checkbox" name="pscat" '); |
.'<label><input type="checkbox" name="pscat" '); |
$r->print('value="'.$tempkey.'" '); |
$r->print('value="'.$tempkey.'" '); |
$r->print('onclick="checkboxChecked(\''.$tempkey.'\')"'); |
|
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
$r->print(' checked="checked"'); |
$r->print(' checked="checked"'); |
} |
} |
Line 1515 sub parmboxes {
|
Line 1494 sub parmboxes {
|
} |
} |
} |
} |
|
|
#&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 1681 function group_or_section(caller) {
|
Line 1655 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)=@_; |
|
|
$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()); |
&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 { |
Line 1748 sub mapmenu {
|
Line 1730 sub mapmenu {
|
# Info about selectable folders/maps |
# Info about selectable folders/maps |
$r->print( |
$r->print( |
'<div class="LC_info">' |
'<div class="LC_info">' |
.&mt('You can only select those maps and folders which can be currently parameterized.') |
.&mt('You can only select maps and folders which have modifiable settings.') |
# .' '.&Apache::loncommon::help_open_topic('...') # Later: Add further help |
.' '.&Apache::loncommon::help_open_topic('Parameter_Set_Folder') |
.'</div>' |
.'</div>' |
); |
); |
|
|
|
$r->print(&Apache::loncommon::start_scrollbox()); |
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(&Apache::loncommon::start_data_table()); |
|
|
# Display row: "All Maps or Folders" |
# Display row: "All Maps or Folders" |
Line 1834 sub mapmenu {
|
Line 1816 sub mapmenu {
|
} |
} |
|
|
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
|
$r->print(&Apache::loncommon::end_scrollbox()); |
} |
} |
} |
} |
|
|
Line 1960 sub standardkeyorder {
|
Line 1943 sub standardkeyorder {
|
'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_printopendate' => 21, |
|
'parameter_0_printclosedate' => 22); |
} |
} |
|
|
|
|
Line 1968 sub assessparms {
|
Line 1953 sub assessparms {
|
|
|
my $r=shift; |
my $r=shift; |
|
|
|
|
|
|
|
# -------------------------------------------------------- Variable declaration |
my @ids=(); |
my @ids=(); |
my %symbp=(); |
my %symbp=(); |
my %mapp=(); |
my %mapp=(); |
Line 1975 sub assessparms {
|
Line 1963 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 1996 sub assessparms {
|
Line 1981 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 2020 sub assessparms {
|
Line 2007 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]='all'; } |
|
if (($env{'form.part'}) && ($psprt[0] ne 'all')) { $psprt[0]=$env{'form.part'}; } |
|
|
my $pssymb=''; |
my $pssymb=''; |
my $parmlev=''; |
my $parmlev=''; |
Line 2122 sub assessparms {
|
Line 2112 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; |
|
|
|
|
for (my $i=0;$i<=$#markers;$i++) { |
for (my $i=0;$i<=$#markers;$i++) { |
my ($needsrelease,$needsnewer); |
my ($needsrelease,$needsnewer,$name); |
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 2154 sub assessparms {
|
Line 2146 sub assessparms {
|
} |
} |
} |
} |
} |
} |
} elsif ($markers[$i] =~ /_type\&\d+$/) { |
} elsif ($markers[$i] =~ /_(type|lenient|retrypartial)\&\d+$/) { |
|
$name = $1; |
$needsrelease = |
$needsrelease = |
$Apache::lonnet::needsrelease{'parameter:type:'.$values[$i]}; |
$Apache::lonnet::needsrelease{"parameter:$name:$values[$i]"}; |
if ($needsrelease) { |
if ($needsrelease) { |
unless ($got_chostname) { |
unless ($got_chostname) { |
($chostname,$cmajor,$cminor) = &questiontype_release_vars(); |
($chostname,$cmajor,$cminor) = ¶meter_release_vars(); |
$got_chostname = 1; |
$got_chostname = 1; |
} |
} |
$needsnewer = &questiontype_releasecheck($values[$i], |
$needsnewer = ¶meter_releasecheck($name,$values[$i], |
$needsrelease, |
$needsrelease, |
$chostname, |
$chostname, |
$cmajor,$cminor); |
$cmajor,$cminor); |
} |
} |
} |
} |
if ($needsnewer) { |
if ($needsnewer) { |
$message .= &oldversion_warning($values[$i],$chostname,$cmajor, |
$message .= &oldversion_warning($name,$values[$i],$chostname,$cmajor, |
$cminor,$needsrelease); |
$cminor,$needsrelease); |
} else { |
} else { |
$message.=&storeparm(split(/\&/,$markers[$i]), |
$message.=&storeparm(split(/\&/,$markers[$i]), |
Line 2193 sub assessparms {
|
Line 2186 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); |
&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 2257 COURSECONTENTSCRIPT
|
Line 2250 COURSECONTENTSCRIPT
|
|
|
# Step 2 |
# Step 2 |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'))); |
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); |
&displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder); |
|
|
# 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)'))); |
Line 2269 COURSECONTENTSCRIPT
|
Line 2262 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 2285 COURSECONTENTSCRIPT
|
Line 2278 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); |
Line 2294 COURSECONTENTSCRIPT
|
Line 2288 COURSECONTENTSCRIPT
|
'<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')). |
|
'<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); |
&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 2331 COURSECONTENTSCRIPT
|
Line 2319 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 2401 ENDTABLEHEADFOUR
|
Line 2395 ENDTABLEHEADFOUR
|
} |
} |
|
|
$r->print('</tr>'); |
$r->print('</tr>'); |
|
# |
|
# Done with the headers |
|
# |
my $defbgone=''; |
my $defbgone=''; |
my $defbgtwo=''; |
my $defbgtwo=''; |
my $defbgthree = ''; |
my $defbgthree = ''; |
Line 2441 ENDTABLEHEADFOUR
|
Line 2437 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 2489 ENDTABLEHEADFOUR
|
Line 2492 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 2505 ENDTABLEHEADFOUR
|
Line 2508 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 2721 ENDMAPONE
|
Line 2724 ENDMAPONE
|
); |
); |
} # end of $parmlev eq general |
} # end of $parmlev eq general |
} |
} |
$r->print('</form>'.&Apache::loncommon::end_page()); |
$r->print('</form>'); |
|
&endSettingsScreen($r); |
|
$r->print(&Apache::loncommon::end_page()); |
} # end sub assessparms |
} # end sub assessparms |
|
|
################################################## |
################################################## |
Line 2794 sub storedata {
|
Line 2799 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); |
if ($cmd eq 'set') { |
if ($cmd eq 'set') { |
$data=$env{$key}; |
$data=$env{$key}; |
$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'; |
|
} elsif ($typeof eq 'string_lenient') { |
|
$name = 'lenient'; |
|
} elsif ($typeof eq 'string_yesno') { |
|
if ($thiskey =~ /\.retrypartial$/) { |
|
$name = 'retrypartial'; |
|
} |
|
} |
|
if ($name ne '') { |
my ($needsrelease,$needsnewer); |
my ($needsrelease,$needsnewer); |
$needsrelease = $Apache::lonnet::needsrelease{'parameter:type:'.$data}; |
$needsrelease = $Apache::lonnet::needsrelease{"parameter:$name:$data"}; |
if ($needsrelease) { |
if ($needsrelease) { |
unless ($got_chostname) { |
unless ($got_chostname) { |
($chostname,$cmajor,$cminor)=&questiontype_release_vars(); |
($chostname,$cmajor,$cminor)=¶meter_release_vars(); |
$got_chostname = 1; |
$got_chostname = 1; |
} |
} |
$needsnewer = &questiontype_releasecheck($data,$needsrelease, |
$needsnewer = ¶meter_releasecheck($name,$data, |
$chostname,$cmajor, |
$needsrelease, |
$cminor); |
$chostname,$cmajor, |
|
$cminor); |
} |
} |
if ($needsnewer) { |
if ($needsnewer) { |
$r->print('<br />'.&oldversion_warning($data,$chostname,$cmajor, |
$r->print('<br />'.&oldversion_warning($name,$data, |
|
$chostname,$cmajor, |
$cminor,$needsrelease)); |
$cminor,$needsrelease)); |
next; |
next; |
} |
} |
Line 3047 sub listdata {
|
Line 3063 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 3121 my %strings =
|
Line 3137 my %strings =
|
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], |
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], |
[ 'practice', 'Practice'], |
[ 'practice', 'Practice'], |
[ 'surveycred', 'Survey (credit for submission)']], |
[ 'surveycred', 'Survey (credit for submission)']], |
|
'string_lenient' |
|
=> [['yes', 'Yes' ], |
|
[ 'no', 'No' ], |
|
[ 'default', 'Default - only bubblesheet grading is lenient' ]] |
); |
); |
|
|
|
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; |
my %skiptype; |
if ($thistype eq 'string_questiontype') { |
if (($thistype eq 'string_questiontype') || |
|
($thistype eq 'string_lenient') || |
|
($name eq 'retrypartial')) { |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my ($got_chostname,$chostname,$cmajor,$cminor); |
foreach my $possibilities (@{ $strings{$thistype} }) { |
foreach my $possibilities (@{ $strings{$thistype} }) { |
next unless (ref($possibilities) eq 'ARRAY'); |
next unless (ref($possibilities) eq 'ARRAY'); |
my ($name, $description) = @{ $possibilities }; |
my ($parmval, $description) = @{ $possibilities }; |
my $needsrelease=$Apache::lonnet::needsrelease{'parameter:type:'.$name}; |
my $needsrelease=$Apache::lonnet::needsrelease{"parameter:$name:$parmval"}; |
if ($needsrelease) { |
if ($needsrelease) { |
unless ($got_chostname) { |
unless ($got_chostname) { |
($chostname,$cmajor,$cminor)=&questiontype_release_vars(); |
($chostname,$cmajor,$cminor)=¶meter_release_vars(); |
$got_chostname = 1; |
$got_chostname = 1; |
} |
} |
my $needsnewer=&questiontype_releasecheck($name,$needsrelease, |
my $needsnewer=¶meter_releasecheck($name,$parmval,$needsrelease, |
$chostname,$cmajor, |
$chostname,$cmajor, |
$cminor); |
$cminor); |
if ($needsnewer) { |
if ($needsnewer) { |
$skiptype{$name} = 1; |
$skiptype{$parmval} = 1; |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
|
|
my $result; |
my $result; |
my $numinrow = 3; |
my $numinrow = 3; |
Line 3246 sub newoverview {
|
Line 3276 sub newoverview {
|
text=>"Overview Mode"}); |
text=>"Overview Mode"}); |
my $start_page = &Apache::loncommon::start_page('Set Parameters'); |
my $start_page = &Apache::loncommon::start_page('Set Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
|
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset'); |
$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 3274 ENDOVER
|
Line 3304 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]='all'; } |
|
|
my @selected_sections = |
my @selected_sections = |
&Apache::loncommon::get_env_multiple('form.Section'); |
&Apache::loncommon::get_env_multiple('form.Section'); |
Line 3321 ENDOVER
|
Line 3352 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 3374 ENDOVER
|
Line 3402 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>'); |
|
&endSettingsScreen($r); |
|
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
sub secgroup_lister { |
sub secgroup_lister { |
Line 3421 sub overview {
|
Line 3451 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 |
&startSettingsScreen($r,'parmset'); |
$breadcrumbs |
$r->print('<form method="post" action="/adm/parmset?action=setoverview" name="parmform">'); |
<form method="post" action="/adm/parmset?action=setoverview" name="parmform"> |
|
ENDOVER |
|
# Store modified |
# Store modified |
|
|
&storedata($r,$crs,$dom); |
&storedata($r,$crs,$dom); |
Line 3530 ENDOVER
|
Line 3559 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()); |
&endSettingsScreen($r); |
|
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
sub date_shift_one { |
sub date_shift_one { |
Line 3543 sub date_shift_one {
|
Line 3573 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 |
&startSettingsScreen($r,'parmset'); |
$breadcrumbs |
|
ENDOVER |
|
$r->print('<form name="shiftform" method="post">'. |
$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'},, |
''). |
''). |
Line 3559 ENDOVER
|
Line 3588 ENDOVER
|
'<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="'.&mt('Shift all dates accordingly').'" /></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 3570 sub date_shift_two {
|
Line 3600 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 |
&startSettingsScreen($r,'parmset'); |
$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(&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))); |
my $delta=$timeshifted-$env{'form.timebase'}; |
my $delta=$timeshifted-$env{'form.timebase'}; |
&dateshift($delta); |
&dateshift($delta); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3624 sub parse_key {
|
Line 3653 sub parse_key {
|
|
|
|
|
sub header { |
sub header { |
return &Apache::loncommon::start_page('Parameter Manager'); |
return &Apache::loncommon::start_page('Settings'); |
} |
} |
|
|
|
|
Line 3633 sub print_main_menu {
|
Line 3662 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')); |
|
&startSettingsScreen($r,'parmset'); |
$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 3643 ENDMAINFORMHEAD
|
Line 3673 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 => 'Portfolio Metadata', |
{ linktext => 'Portfolio Metadata', |
url => '/adm/parmset?action=setrestrictmeta', |
url => '/adm/parmset?action=setrestrictmeta', |
Line 3662 ENDMAINFORMHEAD
|
Line 3697 ENDMAINFORMHEAD
|
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 3709 ENDMAINFORMHEAD
|
Line 3749 ENDMAINFORMHEAD
|
}]} |
}]} |
); |
); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
|
&endSettingsScreen($r); |
return; |
return; |
} |
} |
|
|
Line 3784 sub order_meta_fields {
|
Line 3825 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'); |
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 3853 sub order_meta_fields {
|
Line 3895 sub order_meta_fields {
|
$idx ++; |
$idx ++; |
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |
|
&endSettingsScreen($r); |
return 'ok'; |
return 'ok'; |
} |
} |
|
|
Line 3872 sub addmetafield {
|
Line 3915 sub addmetafield {
|
text=>"Add Metadata Field"}); |
text=>"Add Metadata Field"}); |
$r->print(&Apache::loncommon::start_page('Add Metadata Field')); |
$r->print(&Apache::loncommon::start_page('Add Metadata Field')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Add Metadata Field')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Add Metadata Field')); |
|
&startSettingsScreen($r,'parmset'); |
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'}; |
if (exists($env{'form.undelete'})) { |
if (exists($env{'form.undelete'})) { |
Line 3913 sub addmetafield {
|
Line 3957 sub addmetafield {
|
$r->print('<input type="submit" value="Add Metadata Field" />'); |
$r->print('<input type="submit" value="Add Metadata Field" />'); |
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
|
&endSettingsScreen($r); |
} |
} |
|
|
|
|
Line 3927 sub setrestrictmeta {
|
Line 3972 sub setrestrictmeta {
|
text=>"Restrict Metadata"}); |
text=>"Restrict Metadata"}); |
$r->print(&Apache::loncommon::start_page('Restrict Metadata')); |
$r->print(&Apache::loncommon::start_page('Restrict Metadata')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata')); |
|
&startSettingsScreen($r,'parmset'); |
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 $key_base = $env{'course.'.$env{'request.course.id'}.'.'}; |
my $key_base = $env{'course.'.$env{'request.course.id'}.'.'}; |
Line 3999 ENDButtons
|
Line 4045 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 4042 sub defaultsetter {
|
Line 4089 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 |
&startSettingsScreen($r,'parmset'); |
$breadcrumbs |
$r->print('<form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">'); |
<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 4191 ENDYESNO
|
Line 4236 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()); |
&endSettingsScreen($r); |
|
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
|
|
Line 4284 sub parm_change_log {
|
Line 4330 sub parm_change_log {
|
text=>"Parameter Change Log"}); |
text=>"Parameter Change Log"}); |
$r->print(&Apache::loncommon::start_page('Parameter Change Log')); |
$r->print(&Apache::loncommon::start_page('Parameter Change Log')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); |
|
&startSettingsScreen($r,'parmset'); |
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'}); |
Line 4452 sub parm_change_log {
|
Line 4498 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 4549 sub check_for_course_info {
|
Line 4596 sub check_for_course_info {
|
return 0; |
return 0; |
} |
} |
|
|
sub questiontype_release_vars { |
sub parameter_release_vars { |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
my $chostname = &Apache::lonnet::hostname($chome); |
my $chostname = &Apache::lonnet::hostname($chome); |
Line 4558 sub questiontype_release_vars {
|
Line 4605 sub questiontype_release_vars {
|
return ($chostname,$cmajor,$cminor); |
return ($chostname,$cmajor,$cminor); |
} |
} |
|
|
sub questiontype_releasecheck { |
sub parameter_releasecheck { |
my ($questiontype,$needsrelease,$chostname,$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) || |
($cmajor == $needsmajor && $cminor < $needsminor)) { |
($cmajor == $needsmajor && $cminor < $needsminor)) { |
$needsnewer = 1; |
$needsnewer = 1; |
} else { |
} else { |
&Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:type:'.$questiontype}); |
&Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:'.$name.':'.$value}); |
} |
} |
return $needsnewer; |
return $needsnewer; |
} |
} |
|
|
sub oldversion_warning { |
sub oldversion_warning { |
my ($questiontype,$chostname,$cmajor,$cminor,$needsrelease) = @_; |
my ($name,$value,$chostname,$cmajor,$cminor,$needsrelease) = @_; |
my $desc; |
my $desc; |
if (ref($strings{'string_questiontype'}) eq 'ARRAY') { |
my %stringtypes = ( |
foreach my $possibilities (@{ $strings{'string_questiontype'} }) { |
type => 'string_questiontype', |
next unless (ref($possibilities) eq 'ARRAY'); |
lenient => 'string_lenient', |
my ($name, $description) = @{ $possibilities }; |
retrypartial => 'string_yesno', |
if ($name eq $questiontype) { |
); |
$desc = $description; |
if (exists($stringtypes{$name})) { |
last; |
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; |
|
} |
} |
} |
} |
} |
} |
} |
|
my $standard_name = &standard_parameter_names($name); |
return '<p class="LC_warning">'. |
return '<p class="LC_warning">'. |
&mt('Question Type was [_1]not[_2] set to [_3].', |
&mt('[_1] was [_2]not[_3] set to [_4].', |
'<b>','</b>','"'.$desc.'"').'<br />'. |
$standard_name,'<b>','</b>','"'.$desc.'"').'<br />'. |
&mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).', |
&mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).', |
$cmajor.'.'.$cminor,$chostname, |
$cmajor.'.'.$cminor,$chostname, |
$needsrelease). |
$needsrelease). |
Line 4607 sub handler {
|
Line 4662 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 => |