version 1.84, 2003/03/13 20:52:47
|
version 1.109, 2003/06/23 21:42:07
|
Line 56 package Apache::lonparmset;
|
Line 56 package Apache::lonparmset;
|
use strict; |
use strict; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::Constants qw(:common :http REDIRECT); |
use Apache::Constants qw(:common :http REDIRECT); |
|
use Apache::lonhtmlcommon(); |
use Apache::loncommon; |
use Apache::loncommon; |
use GDBM_File; |
use GDBM_File; |
use Apache::lonhomework; |
use Apache::lonhomework; |
Line 284 sub plink {
|
Line 285 sub plink {
|
|
|
|
|
sub startpage { |
sub startpage { |
my ($r,$id,$udom,$csec,$uname)=@_; |
my ($r,$id,$udom,$csec,$uname,$have_assesments)=@_; |
$r->content_type('text/html'); |
|
$r->send_http_header; |
|
|
|
my $bodytag=&Apache::loncommon::bodytag('Set Course Parameters','', |
my $bodytag=&Apache::loncommon::bodytag('Set Course Parameters','', |
'onUnload="pclose()"'); |
'onUnload="pclose()"'); |
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
|
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<html> |
<html> |
<head> |
<head> |
Line 306 sub startpage {
|
Line 305 sub startpage {
|
parmwin.close(); |
parmwin.close(); |
} |
} |
|
|
function pjump(type,dis,value,marker,ret,call) { |
$pjump_def |
document.parmform.pres_marker.value=''; |
|
parmwin=window.open("/adm/rat/parameter.html?type="+escape(type) |
|
+"&value="+escape(value)+"&marker="+escape(marker) |
|
+"&return="+escape(ret) |
|
+"&call="+escape(call)+"&name="+escape(dis),"LONCAPAparms", |
|
"height=350,width=350,scrollbars=no,menubar=no"); |
|
|
|
} |
|
|
|
function psub() { |
function psub() { |
pclose(); |
pclose(); |
Line 350 sub startpage {
|
Line 341 sub startpage {
|
$selscript |
$selscript |
</head> |
</head> |
$bodytag |
$bodytag |
|
|
<form method="post" action="/adm/parmset" name="envform"> |
<form method="post" action="/adm/parmset" name="envform"> |
<h3>Course Environment</h3> |
<h3>Course Environment</h3> |
<input type="submit" name="crsenv" value="Set Course Environment"> |
<input type="submit" name="crsenv" value="Set Course Environment"> |
</form> |
</form> |
|
<hr /> |
<form method="post" action="/adm/parmset" name="parmform"> |
<form method="post" action="/adm/parmset" name="parmform"> |
<h3>Course Assessments</h3> |
<h3>Course Assessments</h3> |
|
|
|
<a href="/adm/helper/parameter.helper">Use Assignment Parameter Helper</a>, a |
|
simpler interface to set open, due, or answer open dates for problems or |
|
sequences.<br /> <br /> |
|
ENDHEAD |
|
|
|
if (!$have_assesments) { |
|
$r->print('<font color="red">There are no assesment parameters in this course to set.</font><br />'); |
|
} else { |
|
$r->print(<<ENDHEAD); |
<b> |
<b> |
Section/Group: |
Section/Group: |
<input type="text" value="$csec" size="6" name="csec"> |
<input type="text" value="$csec" size="6" name="csec"> |
Line 371 $chooseopt
|
Line 374 $chooseopt
|
<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"> |
ENDHEAD |
ENDHEAD |
|
} |
} |
} |
|
|
sub print_row { |
sub print_row { |
Line 692 sub assessparms {
|
Line 695 sub assessparms {
|
my $url=$ENV{'form.url'}; |
my $url=$ENV{'form.url'}; |
$url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; |
$url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; |
$pssymb=&Apache::lonnet::symbread($url); |
$pssymb=&Apache::lonnet::symbread($url); |
@pscat='all'; |
if (!@pscat) { @pscat=('all'); } |
$pschp=''; |
$pschp=''; |
$parmlev = 'full'; |
$parmlev = 'full'; |
} elsif ($ENV{'form.symb'}) { |
} elsif ($ENV{'form.symb'}) { |
$pssymb=$ENV{'form.symb'}; |
$pssymb=$ENV{'form.symb'}; |
@pscat='all'; |
if (!@pscat) { @pscat=('all'); } |
$pschp=''; |
$pschp=''; |
$parmlev = 'full'; |
$parmlev = 'full'; |
} else { |
} else { |
Line 725 sub assessparms {
|
Line 728 sub assessparms {
|
"<font color=red>Unknown user '$uname' at domain '$udom'</font>"; |
"<font color=red>Unknown user '$uname' at domain '$udom'</font>"; |
$uname=''; |
$uname=''; |
} else { |
} else { |
$csec=&Apache::lonnet::usection($udom,$uname, |
$csec=&Apache::lonnet::getsection($udom,$uname, |
$ENV{'request.course.id'}); |
$ENV{'request.course.id'}); |
if ($csec eq '-1') { |
if ($csec eq '-1') { |
$message="<font color=red>". |
$message="<font color=red>". |
"User '$uname' at domain '$udom' not ". |
"User '$uname' at domain '$udom' not ". |
Line 766 sub assessparms {
|
Line 769 sub assessparms {
|
|
|
$mapp{'0.0'} = ''; |
$mapp{'0.0'} = ''; |
$symbp{'0.0'} = ''; |
$symbp{'0.0'} = ''; |
|
|
# ---------------------------------------------------------- Anything to store? |
# ---------------------------------------------------------- Anything to store? |
if ($ENV{'form.pres_marker'}) { |
if ($ENV{'form.pres_marker'}) { |
my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'}); |
my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'}); |
Line 851 sub assessparms {
|
Line 855 sub assessparms {
|
$message.='<h3>Changes can take up to 10 minutes before being active for all students</h3>'; |
$message.='<h3>Changes can take up to 10 minutes before being active for all students</h3>'; |
} |
} |
# --------------------------------------------- Devalidate cache for this child |
# --------------------------------------------- Devalidate cache for this child |
&Apache::lonnet::devalidatecourseresdata( |
&Apache::lonnet::devalidatecourseresdata( |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}); |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}); |
|
&Apache::lonnet::clear_EXT_cache_status(); |
# -------------------------------------------------------------- Get coursedata |
# -------------------------------------------------------------- Get coursedata |
%courseopt = &Apache::lonnet::dump |
%courseopt = &Apache::lonnet::dump |
('resourcedata', |
('resourcedata', |
Line 882 sub assessparms {
|
Line 887 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,$id,$udom,$csec,$uname); |
my $have_assesments=1; |
|
if (scalar(keys(%allkeys)) eq 0) { $have_assesments=0; } |
|
|
|
&startpage($r,$id,$udom,$csec,$uname,$have_assesments); |
|
|
|
if (!$have_assesments) { return ''; } |
# if ($ENV{'form.url'}) { |
# if ($ENV{'form.url'}) { |
# $r->print('<input type="hidden" value="'.$ENV{'form.url'}. |
# $r->print('<input type="hidden" value="'.$ENV{'form.url'}. |
# '" name="url"><input type="hidden" name="command" value="set">'); |
# '" name="url"><input type="hidden" name="command" value="set">'); |
Line 897 sub assessparms {
|
Line 907 sub assessparms {
|
|
|
$r->print('<h2>'.$message.'</h2><table>'); |
$r->print('<h2>'.$message.'</h2><table>'); |
|
|
$r->print('<tr><td><hr /></td></tr>'); |
|
|
|
my $submitmessage; |
my $submitmessage; |
if (($prevvisit) || ($pschp) || ($pssymb)) { |
|
$submitmessage = "Update Display"; |
|
} else { |
|
$submitmessage = "Display"; |
|
} |
|
if (!$pssymb) { |
if (!$pssymb) { |
$r->print('<tr><td>Select Parameter Level</td><td>'); |
$r->print('<tr><td>Select Parameter Level</td><td colspan="2">'); |
$r->print('<select name="parmlev">'); |
$r->print('<select name="parmlev">'); |
foreach (reverse sort keys %alllevs) { |
foreach (reverse sort keys %alllevs) { |
$r->print('<option value="'.$alllevs{$_}.'"'); |
$r->print('<option value="'.$alllevs{$_}.'"'); |
Line 916 sub assessparms {
|
Line 919 sub assessparms {
|
$r->print('>'.$_.'</option>'); |
$r->print('>'.$_.'</option>'); |
} |
} |
$r->print("</select></td>\n"); |
$r->print("</select></td>\n"); |
|
|
$r->print('<td><input type="submit" name="dis" value="'.$submitmessage.'"></td>'); |
|
|
|
$r->print('</tr><tr><td><hr /></td>'); |
$r->print('</tr>'); |
|
|
$r->print('<tr><td>Select Enclosing Map or Folder</td>'); |
$r->print('<tr><td>Select Enclosing Map or Folder</td>'); |
$r->print('<td colspan="2"><select name="pschp">'); |
$r->print('<td colspan="2"><select name="pschp">'); |
Line 940 sub assessparms {
|
Line 941 sub assessparms {
|
|
|
$r->print('<tr><td colspan="3"><hr /><input type="checkbox"'); |
$r->print('<tr><td colspan="3"><hr /><input type="checkbox"'); |
if ($showoptions eq 'show') {$r->print(" checked ");} |
if ($showoptions eq 'show') {$r->print(" checked ");} |
$r->print(' name="showoptions" value="show" onclick="form.submit();">Show More Options<hr /></td></tr>'); |
$r->print(' name="showoptions" value="show">Show More Options<hr /></td></tr>'); |
# $r->print("<tr><td>Show: $showoptions</td></tr>"); |
# $r->print("<tr><td>Show: $showoptions</td></tr>"); |
# $r->print("<tr><td>pscat: @pscat</td></tr>"); |
# $r->print("<tr><td>pscat: @pscat</td></tr>"); |
# $r->print("<tr><td>psprt: @psprt</td></tr>"); |
# $r->print("<tr><td>psprt: @psprt</td></tr>"); |
Line 1025 sub assessparms {
|
Line 1026 sub assessparms {
|
} |
} |
|
|
} |
} |
$r->print('</table>'); |
$r->print('</table><br />'); |
|
if (($prevvisit) || ($pschp) || ($pssymb)) { |
|
$submitmessage = "Update Course Assessment Parameter Display"; |
|
} else { |
|
$submitmessage = "Set Course Assessment Parameters"; |
|
} |
|
$r->print('<input type="submit" name="dis" value="'.$submitmessage.'">'); |
|
|
# my @temp_psprt; |
# my @temp_psprt; |
# foreach my $t (@psprt) { |
# foreach my $t (@psprt) { |
Line 1048 sub assessparms {
|
Line 1055 sub assessparms {
|
my $csuname=$ENV{'user.name'}; |
my $csuname=$ENV{'user.name'}; |
my $csudom=$ENV{'user.domain'}; |
my $csudom=$ENV{'user.domain'}; |
|
|
|
|
if ($parmlev eq 'full' || $parmlev eq 'brief') { |
if ($parmlev eq 'full' || $parmlev eq 'brief') { |
|
|
my $coursespan=$csec?8:5; |
my $coursespan=$csec?8:5; |
$r->print('<p><table border=2>'); |
$r->print('<p><table border=2>'); |
$r->print('<tr><td colspan=5></td>'); |
$r->print('<tr><td colspan=5></td>'); |
Line 1070 ENDTABLETWO
|
Line 1075 ENDTABLETWO
|
} |
} |
$r->print(<<ENDTABLEHEADFOUR); |
$r->print(<<ENDTABLEHEADFOUR); |
</tr><tr><th>Assessment URL and Title</th><th>Type</th> |
</tr><tr><th>Assessment URL and Title</th><th>Type</th> |
<th>Enclosing Map or Folder</th><th>Part No.</th><th>Parameter Name</th> |
<th>Enclosing Map or Folder</th><th>Part</th><th>Parameter Name</th> |
<th>default</th><th>from Enclosing Map or Folder</th> |
<th>default</th><th>from Enclosing Map or Folder</th> |
<th>general</th><th>for Enclosing Map or Folder</th><th>for Resource</th> |
<th>general</th><th>for Enclosing Map or Folder</th><th>for Resource</th> |
ENDTABLEHEADFOUR |
ENDTABLEHEADFOUR |
Line 1367 ENDMAPONE
|
Line 1372 ENDMAPONE
|
|
|
=item crsenv |
=item crsenv |
|
|
Show course data and parameters. This is a large routine that should |
Show and set course data and parameters. This is a large routine that should |
be simplified and shortened... someday. |
be simplified and shortened... someday. |
|
|
Inputs: $r |
Inputs: $r |
Line 1385 sub crsenv {
|
Line 1390 sub crsenv {
|
'Set Course Environment Parameters'); |
'Set Course Environment Parameters'); |
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'}; |
# -------------------------------------------------- Go through list of changes |
|
|
# |
|
# Go through list of changes |
foreach (keys %ENV) { |
foreach (keys %ENV) { |
if ($_=~/^form\.(.+)\_setparmval$/) { |
next if ($_!~/^form\.(.+)\_setparmval$/); |
my $name=$1; |
my $name = $1; |
my $value=$ENV{'form.'.$name.'_value'}; |
my $value = $ENV{'form.'.$name.'_value'}; |
if ($name eq 'newp') { |
if ($name eq 'newp') { |
$name=$ENV{'form.newp_name'}; |
$name = $ENV{'form.newp_name'}; |
} |
} |
if ($name eq 'url') { |
if ($name eq 'url') { |
$value=~s/^\/res\///; |
$value=~s/^\/res\///; |
my $bkuptime=time; |
my $bkuptime=time; |
my @tmp = &Apache::lonnet::get |
my @tmp = &Apache::lonnet::get |
('environment',['url'],$dom,$crs); |
('environment',['url'],$dom,$crs); |
$setoutput.='Backing up previous URL: '. |
$setoutput.='Backing up previous URL: '. |
&Apache::lonnet::put |
&Apache::lonnet::put |
('environment', |
('environment', |
{'top level map backup '.$bkuptime => $tmp[1] }, |
{'top level map backup '.$bkuptime => $tmp[1] }, |
$dom,$crs). |
$dom,$crs). |
'<br>'; |
'<br>'; |
|
} |
|
# |
|
# Deal with modified default spreadsheets |
|
if ($name =~ /^spreadsheet_default_(classcalc| |
|
studentcalc| |
|
assesscalc)$/x) { |
|
my $sheettype = $1; |
|
if ($sheettype eq 'classcalc') { |
|
# no need to do anything since viewing the sheet will |
|
# cause it to be updated. |
|
} elsif ($sheettype eq 'studentcalc') { |
|
# expire all the student spreadsheets |
|
&Apache::lonnet::expirespread('','','studentcalc'); |
|
} else { |
|
# expire all the assessment spreadsheets |
|
# this includes non-default spreadsheets, but better to |
|
# be safe than sorry. |
|
&Apache::lonnet::expirespread('','','assesscalc'); |
|
# expire all the student spreadsheets |
|
&Apache::lonnet::expirespread('','','studentcalc'); |
} |
} |
if ($name =~ /^spreadsheet_default_(classcalc| |
} |
studentcalc| |
# |
assesscalc)$/x) { |
# Deal with the enrollment dates |
my $sheettype = $1; |
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
if ($sheettype eq 'classcalc') { |
$value=&Apache::lonhtmlcommon::get_date_from_form($name.'_value'); |
# no need to do anything since viewing the sheet will |
} |
# cause it to be updated. |
# |
} elsif ($sheettype eq 'studentcalc') { |
# Let the user know we made the changes |
# expire all the student spreadsheets |
if ($name) { |
&Apache::lonnet::expirespread('','','studentcalc'); |
my $put_result = &Apache::lonnet::put('environment', |
} else { |
{$name=>$value},$dom,$crs); |
# expire all the default assessment spreadsheets |
if ($put_result eq 'ok') { |
} |
$setoutput.='Set <b>'.$name.'</b> to <b>'.$value.'</b>.<br />'; |
|
} else { |
|
$setoutput.='Unable to set <b>'.$name.'</b> to '. |
|
'<b>'.$value.'</b> due to '.$put_result.'.<br />'; |
} |
} |
|
|
if ($name) { |
|
$setoutput.='Setting <tt>'.$name.'</tt> to <tt>'. |
|
$value.'</tt>: '. |
|
&Apache::lonnet::put |
|
('environment',{$name=>$value},$dom,$crs). |
|
'<br>'; |
|
} |
|
} |
} |
} |
} |
|
# ------------------------- Re-init course environment entries for this session |
|
|
|
&Apache::lonnet::coursedescription($ENV{'request.course.id'}); |
|
|
# -------------------------------------------------------- Get parameters again |
# -------------------------------------------------------- Get parameters again |
|
|
my %values=&Apache::lonnet::dump('environment',$dom,$crs); |
my %values=&Apache::lonnet::dump('environment',$dom,$crs); |
Line 1438 sub crsenv {
|
Line 1464 sub crsenv {
|
('url' => '<b>Top Level Map</b> '. |
('url' => '<b>Top Level Map</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','url','sequence')\">". |
"('envform','url','sequence')\">". |
'Browse</a><br /><font color=red> '. |
'Select Map</a><br /><font color=red> '. |
'Modification may make assessment data '. |
'Modification may make assessment data '. |
'inaccessible</font>', |
'inaccessible</font>', |
'description' => '<b>Course Description</b>', |
'description' => '<b>Course Description</b>', |
Line 1447 sub crsenv {
|
Line 1473 sub crsenv {
|
'default_xml_style' => '<b>Default XML Style File</b> '. |
'default_xml_style' => '<b>Default XML Style File</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','default_xml_style'". |
"('envform','default_xml_style'". |
",'sty')\">Browse</a><br>", |
",'sty')\">Select Style File</a><br>", |
'question.email' => '<b>Feedback Addresses for Resource Content '. |
'question.email' => '<b>Feedback Addresses for Resource Content '. |
'Questions</b><br />(<tt>user:domain,'. |
'Questions</b><br />(<tt>user:domain,'. |
'user:domain(section;section;...;*;...),...</tt>)', |
'user:domain(section;section;...;*;...),...</tt>)', |
Line 1458 sub crsenv {
|
Line 1484 sub crsenv {
|
'hideemptyrows' => '<b>Hide Empty Rows in Spreadsheets</b><br />'. |
'hideemptyrows' => '<b>Hide Empty Rows in Spreadsheets</b><br />'. |
'("<tt>yes</tt>" for default hiding)', |
'("<tt>yes</tt>" for default hiding)', |
'pageseparators' => '<b>Visibly Separate Items on Pages</b><br />'. |
'pageseparators' => '<b>Visibly Separate Items on Pages</b><br />'. |
'("<tt>yes</tt>" for visible separation)', |
'("<tt>yes</tt>" for visible separation, '. |
|
'changes will not show until next login)', |
'pch.roles.denied'=> '<b>Disallow Resource Discussion for '. |
'pch.roles.denied'=> '<b>Disallow Resource Discussion for '. |
'Roles</b><br />"<tt>st</tt>": '. |
'Roles</b><br />"<tt>st</tt>": '. |
'student, "<tt>ta</tt>": '. |
'student, "<tt>ta</tt>": '. |
Line 1472 sub crsenv {
|
Line 1499 sub crsenv {
|
=> '<b>Default Course Spreadsheet</b> '. |
=> '<b>Default Course Spreadsheet</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_classcalc'". |
"('envform','spreadsheet_default_classcalc'". |
",'spreadsheet')\">Browse</a><br />", |
",'spreadsheet')\">Select Spreadsheet File</a><br />", |
'spreadsheet_default_studentcalc' |
'spreadsheet_default_studentcalc' |
=> '<b>Default Student Spreadsheet</b> '. |
=> '<b>Default Student Spreadsheet</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_calc'". |
"('envform','spreadsheet_default_calc'". |
",'spreadsheet')\">Browse</a><br />", |
",'spreadsheet')\">Select Spreadsheet File</a><br />", |
'spreadsheet_default_assesscalc' |
'spreadsheet_default_assesscalc' |
=> '<b>Default Assessment Spreadsheet</b> '. |
=> '<b>Default Assessment Spreadsheet</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_assesscalc'". |
"('envform','spreadsheet_default_assesscalc'". |
",'spreadsheet')\">Browse</a><br />", |
",'spreadsheet')\">Select Spreadsheet File</a><br />", |
'allow_limited_html_in_feedback' |
'allow_limited_html_in_feedback' |
=> '<b>Allow limited HTML in discussion posts</b><br />'. |
=> '<b>Allow limited HTML in discussion posts</b><br />'. |
'(Set value to yes to allow)' |
'(Set value to "<tt>yes</tt>" to allow)', |
); |
'rndseed' |
foreach (keys(%values)) { |
=> '<b>Randomization algorithm used</b> <br />'. |
unless ($descriptions{$_}) { |
'<font color="red">Modifying this will make problems '. |
$descriptions{$_}=$_; |
'have different numbers and answers</font>', |
|
'problem_stream_switch' |
|
=> '<b>Allow problems to be split over pages</b><br />'. |
|
' ("<tt>yes</tt>" if allowed, anything else if not)', |
|
'default_enrollment_start_date' => '<b>Default beginning date '. |
|
'when enrolling students</b>', |
|
'default_enrollment_end_date' => '<b>Default ending date '. |
|
'when enrolling students</b>', |
|
'languages' => '<b>Languages used</b>' |
|
); |
|
my @Display_Order = ('url','description','courseid', |
|
'default_xml_style','pageseparators', |
|
'question.email','comment.email','policy.email', |
|
'pch.roles.denied','pch.users.denied', |
|
'allow_limited_html_in_feedback', |
|
'languages', |
|
'rndseed', |
|
'problem_stream_switch', |
|
'spreadsheet_default_classcalc', |
|
'spreadsheet_default_studentcalc', |
|
'spreadsheet_default_assesscalc', |
|
'hideemptyrows', |
|
'default_enrollment_start_date', |
|
'default_enrollment_end_date', |
|
); |
|
foreach my $parameter (sort(keys(%values))) { |
|
if (! $descriptions{$parameter}) { |
|
$descriptions{$parameter}=$parameter; |
|
push(@Display_Order,$parameter); |
} |
} |
} |
} |
foreach (sort keys %descriptions) { |
foreach my $parameter (@Display_Order) { |
|
my $description = $descriptions{$parameter}; |
# onchange is javascript to automatically check the 'Set' button. |
# onchange is javascript to automatically check the 'Set' button. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
'[\'envform\'].elements[\''.$_.'_setparmval\']'. |
"['envform'].elements['".$parameter."_setparmval']". |
'.checked=true;"'; |
'.checked=true;"'; |
$output.='<tr><td>'.$descriptions{$_}.'</td>'. |
$output .= '<tr><td>'.$description.'</td>'; |
'<td><input name="'.$_.'_value" size=40 '. |
if ($parameter =~ /^default_enrollment_(start|end)_date$/) { |
'value="'.$values{$_}.'" '.$onchange.' /></td>'. |
$output .= '<td>'. |
'<td><input type=checkbox name="'.$_.'_setparmval"></td>'. |
&Apache::lonhtmlcommon::date_setter('envform', |
'</tr>'."\n"; |
$parameter.'_value', |
|
$values{$parameter}, |
|
$onchange). |
|
'</td>'; |
|
} else { |
|
$output .= '<td>'. |
|
&Apache::lonhtmlcommon::textbox($parameter.'_value', |
|
$values{$parameter}, |
|
40,$onchange).'</td>'; |
|
} |
|
$output .= '<td>'. |
|
&Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). |
|
'</td>'; |
|
$output .= "</tr>\n"; |
} |
} |
my $onchange = 'onFocus="javascript:window.document.forms'. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
'[\'envform\'].elements[\'newp_setparmval\']'. |
'[\'envform\'].elements[\'newp_setparmval\']'. |
Line 1570 Main handler. Calls &assessparms and &c
|
Line 1639 Main handler. Calls &assessparms and &c
|
|
|
################################################## |
################################################## |
################################################## |
################################################## |
|
use Data::Dumper; |
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
|
|
Line 1585 sub handler {
|
Line 1654 sub handler {
|
|
|
if (($ENV{'request.course.id'}) && |
if (($ENV{'request.course.id'}) && |
(&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}))) { |
(&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}))) { |
|
|
|
$r->content_type('text/html'); |
|
$r->send_http_header; |
|
|
$coursename=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
$coursename=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
|
|