version 1.137, 2003/11/18 22:21:00
|
version 1.147, 2004/01/14 22:08:23
|
Line 131 sub parmval {
|
Line 131 sub parmval {
|
|
|
# -------------------------------------------------------- first, check default |
# -------------------------------------------------------- first, check default |
|
|
if ($def) { $outpar[11]=$def; $result=11; } |
if (defined($def)) { $outpar[11]=$def; $result=11; } |
|
|
# ----------------------------------------------------- second, check map parms |
# ----------------------------------------------------- second, check map parms |
|
|
my $thisparm=$parmhash{$symbparm}; |
my $thisparm=$parmhash{$symbparm}; |
if ($thisparm) { $outpar[10]=$thisparm; $result=10; } |
if (defined($thisparm)) { $outpar[10]=$thisparm; $result=10; } |
|
|
# --------------------------------------------------------- third, check course |
# --------------------------------------------------------- third, check course |
|
|
Line 306 sub startpage {
|
Line 306 sub startpage {
|
'oi' => "or ID", |
'oi' => "or ID", |
'ad' => "at Domain" |
'ad' => "at Domain" |
); |
); |
|
my $overallhelp=&Apache::loncommon::help_open_topic("Course_Setting_Parameters","Parameters"); |
|
my $assessparmhelp=&Apache::loncommon::help_open_topic("Cascading_Parameters","Assessment Parameters"); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<html> |
<html> |
<head> |
<head> |
Line 354 sub startpage {
|
Line 356 sub startpage {
|
$selscript |
$selscript |
</head> |
</head> |
$bodytag |
$bodytag |
|
$overallhelp |
ENDHEAD |
ENDHEAD |
|
|
unless ($trimheader) {$r->print(<<ENDHEAD2); |
unless ($trimheader) {$r->print(<<ENDHEAD2); |
Line 362 ENDHEAD
|
Line 365 ENDHEAD
|
<input type="submit" name="crsenv" value="$lt{'scep'}" /> |
<input type="submit" name="crsenv" value="$lt{'scep'}" /> |
</form> |
</form> |
<hr /> |
<hr /> |
|
$assessparmhelp |
<form method="post" action="/adm/helper/parameter.helper" name="helpform"> |
<form method="post" action="/adm/helper/parameter.helper" name="helpform"> |
<h4>$lt{'caphm'}</h4> |
<h4>$lt{'caphm'}</h4> |
<input type="submit" value="$lt{'smcap'}" /> |
<input type="submit" value="$lt{'smcap'}" /> |
Line 1507 sub crsenv {
|
Line 1511 sub crsenv {
|
# -------------------------------------------------------- Get parameters again |
# -------------------------------------------------------- Get parameters again |
|
|
my %values=&Apache::lonnet::dump('environment',$dom,$crs); |
my %values=&Apache::lonnet::dump('environment',$dom,$crs); |
|
my $SelectStyleFile=&mt('Select Style File'); |
|
my $SelectSpreadsheetFile=&mt('Select Spreadsheet File'); |
my $output=''; |
my $output=''; |
if (! exists($values{'con_lost'})) { |
if (! exists($values{'con_lost'})) { |
my %descriptions= |
my %descriptions= |
('url' => '<b>Top Level Map</b> '. |
('url' => '<b>'.&mt('Top Level Map').'</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','url','sequence')\">". |
"('envform','url','sequence')\">". |
'Select Map</a><br /><font color=red> '. |
&mt('Select Map').'</a><br /><font color=red> '. |
'Modification may make assessment data '. |
&mt('Modification may make assessment data inaccessible'). |
'inaccessible</font>', |
'</font>', |
'description' => '<b>Course Description</b>', |
'description' => '<b>'.&mt('Course Description').'</b>', |
'courseid' => '<b>Course ID or number</b><br />'. |
'courseid' => '<b>'.&mt('Course ID').' '.&mt('or').' '.&mt('number'). |
'(internal, optional)', |
'</b><br />'. |
'grading' => '<b>Grading</b>'. |
'('.&mt('internal').', '.&mt('optional').')', |
'"standard" or any other value. '. |
'grading' => '<b>'.&mt('Grading').'</b>'. |
'Default for new courses is "standard".', |
' "'.&mt('standard').'", "'.&mt('external').'", '. |
|
&mt('or any other value').'.'. |
'default_xml_style' => '<b>Default XML Style File</b> '. |
' '.&mt('Default for new courses is').' "'. |
|
&mt('standard').'".', |
|
'default_xml_style' => '<b>'.&mt('Default XML Style File').'</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','default_xml_style'". |
"('envform','default_xml_style'". |
",'sty')\">Select Style File</a><br>", |
",'sty')\">$SelectStyleFile</a><br>", |
'question.email' => '<b>Feedback Addresses for Resource Content '. |
'question.email' => '<b>'.&mt('Feedback Addresses for Resource Content Question'). |
'Questions</b><br />(<tt>user:domain,'. |
'</b><br />(<tt>user:domain,'. |
'user:domain(section;section;...;*;...),...</tt>)', |
'user:domain(section;section;...;*;...),...</tt>)', |
'comment.email' => '<b>Feedback Addresses for Course Content Comments</b><br />'. |
'comment.email' => '<b>'.&mt('Feedback Addresses for Course Content Comments').'</b><br />'. |
'(<tt>user:domain,user:domain(section;section;...;*;...),...</tt>)', |
'(<tt>user:domain,user:domain(section;section;...;*;...),...</tt>)', |
'policy.email' => '<b>Feedback Addresses for Course Policy</b>'. |
'policy.email' => '<b>'.&mt('Feedback Addresses for Course Policy').'</b>'. |
'<br />(<tt>user:domain,user:domain(section;section;...;*;...),...</tt>)', |
'<br />(<tt>user:domain,user:domain(section;section;...;*;...),...</tt>)', |
'hideemptyrows' => '<b>Hide Empty Rows in Spreadsheets</b><br />'. |
'hideemptyrows' => '<b>'.&mt('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>'.&mt('Visibly Separate Items on Pages').'</b><br />'. |
'("<tt>yes</tt>" for visible separation, '. |
'("<tt>'.&mt('yes').'</tt>" '.&mt('for visible separation').', '. |
'changes will not show until next login)', |
&mt('changes will not show until next login').')', |
|
|
'plc.roles.denied'=> '<b>Disallow live chatroom use for '. |
'plc.roles.denied'=> '<b>'.&mt('Disallow live chatroom use for Roles'). |
'Roles</b><br />"<tt>st</tt>": '. |
'</b><br />"<tt>st</tt>": '. |
'student, "<tt>ta</tt>": '. |
'student, "<tt>ta</tt>": '. |
'TA, "<tt>in</tt>": '. |
'TA, "<tt>in</tt>": '. |
'instructor;<br /><tt>role,role,...</tt>) '. |
'instructor;<br /><tt>role,role,...</tt>) '. |
Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
'plc.users.denied' => |
'plc.users.denied' => |
'<b>Disallow live chatroom use for Users</b><br />'. |
'<b>'.&mt('Disallow live chatroom use for Users').'</b><br />'. |
'(<tt>user:domain,user:domain,...</tt>)', |
'(<tt>user:domain,user:domain,...</tt>)', |
|
|
'pch.roles.denied'=> '<b>Disallow Resource Discussion for '. |
'pch.roles.denied'=> '<b>'.&mt('Disallow Resource Discussion for Roles'). |
'Roles</b><br />"<tt>st</tt>": '. |
'</b><br />"<tt>st</tt>": '. |
'student, "<tt>ta</tt>": '. |
'student, "<tt>ta</tt>": '. |
'TA, "<tt>in</tt>": '. |
'TA, "<tt>in</tt>": '. |
'instructor;<br /><tt>role,role,...</tt>) '. |
'instructor;<br /><tt>role,role,...</tt>) '. |
Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
'pch.users.denied' => |
'pch.users.denied' => |
'<b>Disallow Resource Discussion for Users</b><br />'. |
'<b>'.&mt('Disallow Resource Discussion for Users').'</b><br />'. |
'(<tt>user:domain,user:domain,...</tt>)', |
'(<tt>user:domain,user:domain,...</tt>)', |
'spreadsheet_default_classcalc' |
'spreadsheet_default_classcalc' |
=> '<b>Default Course Spreadsheet</b> '. |
=> '<b>'.&mt('Default Course Spreadsheet').'</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_classcalc'". |
"('envform','spreadsheet_default_classcalc'". |
",'spreadsheet')\">Select Spreadsheet File</a><br />", |
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
'spreadsheet_default_studentcalc' |
'spreadsheet_default_studentcalc' |
=> '<b>Default Student Spreadsheet</b> '. |
=> '<b>'.&mt('Default Student Spreadsheet').'</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_calc'". |
"('envform','spreadsheet_default_calc'". |
",'spreadsheet')\">Select Spreadsheet File</a><br />", |
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
'spreadsheet_default_assesscalc' |
'spreadsheet_default_assesscalc' |
=> '<b>Default Assessment Spreadsheet</b> '. |
=> '<b>'.&mt('Default Assessment Spreadsheet').'</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_assesscalc'". |
"('envform','spreadsheet_default_assesscalc'". |
",'spreadsheet')\">Select Spreadsheet File</a><br />", |
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
'allow_limited_html_in_feedback' |
'allow_limited_html_in_feedback' |
=> '<b>Allow limited HTML in discussion posts</b><br />'. |
=> '<b>'.&mt('Allow limited HTML in discussion posts').'</b><br />'. |
'(Set value to "<tt>yes</tt>" to allow)', |
'('.&mt('Set value to').' "<tt>'.&mt('yes').'</tt>" '.&mt('to allow').')', |
'rndseed' |
'rndseed' |
=> '<b>Randomization algorithm used</b> <br />'. |
=> '<b>'.&mt('Randomization algorithm used').'</b> <br />'. |
'<font color="red">Modifying this will make problems '. |
'<font color="red">'.&mt('Modifying this will make problems').' '. |
'have different numbers and answers</font>', |
&mt('have different numbers and answers').'</font>', |
'problem_stream_switch' |
'problem_stream_switch' |
=> '<b>Allow problems to be split over pages</b><br />'. |
=> '<b>'.&mt('Allow problems to be split over pages').'</b><br />'. |
' ("<tt>yes</tt>" if allowed, anything else if not)', |
' ("<tt>'.&mt('yes').'</tt>" '.&mt('if allowed, anything else if not').')', |
'anonymous_quiz' |
'anonymous_quiz' |
=> '<b>Anonimous quiz/exam</b><br />'. |
=> '<b>'.&mt('Anonimous quiz/exam').'</b><br />'. |
' (<tt><b>yes</b> to avoid print students names </tt>)', |
' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)', |
'default_enrollment_start_date' => '<b>Default beginning date '. |
'default_enrollment_start_date' => '<b>'.&mt('Default beginning date when enrolling students').'</b>', |
'when enrolling students</b>', |
'default_enrollment_end_date' => '<b>'.&mt('Default ending date when enrolling students').'</b>', |
'default_enrollment_end_date' => '<b>Default ending date '. |
'languages' => '<b>'.&mt('Languages used').'</b>', |
'when enrolling students</b>', |
|
'languages' => '<b>Languages used</b>', |
|
'disable_receipt_display' |
'disable_receipt_display' |
=> '<b>Disable display of problem receipts</b><br />'. |
=> '<b>'.&mt('Disable display of problem receipts').'</b><br />'. |
' ("<tt>yes</tt>" to disable, anything else if not)' |
' ("<tt>'.&mt('yes').'</tt>" '.&mt('to disable, anything else if not').')' |
); |
); |
my @Display_Order = ('url','description','courseid','grading', |
my @Display_Order = ('url','description','courseid','grading', |
'default_xml_style','pageseparators', |
'default_xml_style','pageseparators', |
Line 1614 sub crsenv {
|
Line 1620 sub crsenv {
|
'default_enrollment_end_date', |
'default_enrollment_end_date', |
); |
); |
foreach my $parameter (sort(keys(%values))) { |
foreach my $parameter (sort(keys(%values))) { |
if (! $descriptions{$parameter}) { |
unless ($parameter =~ m/^internal\./) { |
$descriptions{$parameter}=$parameter; |
if (! $descriptions{$parameter}) { |
push(@Display_Order,$parameter); |
$descriptions{$parameter}=$parameter; |
} |
push(@Display_Order,$parameter); |
|
} |
|
} |
} |
} |
foreach my $parameter (@Display_Order) { |
foreach my $parameter (@Display_Order) { |
my $description = $descriptions{$parameter}; |
my $description = $descriptions{$parameter}; |
Line 1654 sub crsenv {
|
Line 1662 sub crsenv {
|
$onchange.' /></td><td>'. |
$onchange.' /></td><td>'. |
'<input type="checkbox" name="newp_setparmval" /></td></tr>'; |
'<input type="checkbox" name="newp_setparmval" /></td></tr>'; |
} |
} |
|
my $Parameter=&mt('Parameter'); |
|
my $Value=&mt('Value'); |
|
my $Set=&mt('Set'); |
$r->print(<<ENDENV); |
$r->print(<<ENDENV); |
<html> |
<html> |
<script type="text/javascript" language="Javascript" > |
<script type="text/javascript" language="Javascript" > |
Line 1688 $bodytag
|
Line 1699 $bodytag
|
$setoutput |
$setoutput |
<p> |
<p> |
<table border=2> |
<table border=2> |
<tr><th>Parameter</th><th>Value</th><th>Set?</th></tr> |
<tr><th>$Parameter</th><th>$Value</th><th>$Set?</th></tr> |
$output |
$output |
</table> |
</table> |
<input type="submit" name="crsenv" value="Set Course Environment"> |
<input type="submit" name="crsenv" value="Set Course Environment"> |
Line 1757 ENDOVER
|
Line 1768 ENDOVER
|
} |
} |
} |
} |
# Store |
# Store |
&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs); |
my $delentries=$#deldata+1; |
&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs); |
my @newdatakeys=keys %newdata; |
|
my $putentries=$#newdatakeys+1; |
|
if ($delentries) { |
|
if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') { |
|
$r->print('<h2>'.&mt('Deleted [_1] parameter(s)</h2>',$delentries)); |
|
} else { |
|
$r->print('<h2><font color="red">'. |
|
&mt('Error deleting parameters').'</font></h2>'); |
|
} |
|
} |
|
if ($putentries) { |
|
if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') { |
|
$r->print('<h2>'.&mt('Stored [_1] parameter(s)</h2>',$putentries)); |
|
} else { |
|
$r->print('<h2><font color="red">'. |
|
&mt('Error storing parameters').'</font></h2>'); |
|
} |
|
} |
# Read and display |
# Read and display |
my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs); |
my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs); |
my $oldsection=''; |
my $oldsection=''; |
Line 1766 ENDOVER
|
Line 1794 ENDOVER
|
my $oldpart=''; |
my $oldpart=''; |
my $pointer=0; |
my $pointer=0; |
$tableopen=0; |
$tableopen=0; |
|
my $foundkeys=0; |
foreach my $thiskey (sort keys %resourcedata) { |
foreach my $thiskey (sort keys %resourcedata) { |
if ($resourcedata{$thiskey.'.type'}) { |
if ($resourcedata{$thiskey.'.type'}) { |
my ($course,$middle,$part,$name)= |
my ($course,$middle,$part,$name)= |
Line 1803 ENDOVER
|
Line 1832 ENDOVER
|
$r->print(&tablestart().'<tr><td><b>'.$name. |
$r->print(&tablestart().'<tr><td><b>'.$name. |
':</b></td><td><input type="checkbox" name="del_'. |
':</b></td><td><input type="checkbox" name="del_'. |
$thiskey.'" /></td><td>'); |
$thiskey.'" /></td><td>'); |
|
$foundkeys++; |
if ($resourcedata{$thiskey.'.type'}=~/^date/) { |
if ($resourcedata{$thiskey.'.type'}=~/^date/) { |
my $jskey='key_'.$pointer; |
my $jskey='key_'.$pointer; |
$pointer++; |
$pointer++; |
Line 1821 ENDOVER
|
Line 1851 ENDOVER
|
} |
} |
} |
} |
|
|
$r->print(&tableend(). |
$r->print(&tableend().'<p>'. |
'<p><input type="submit" value="'.&mt('Modify Parameters').'" /></p></form></body></html>'); |
($foundkeys?'<input type="submit" value="'.&mt('Modify Parameters').'" />':&mt('There are no course or section parameters.')).'</p></form></body></html>'); |
} |
} |
|
|
################################################## |
################################################## |