version 1.142, 2003/12/05 16:18:45
|
version 1.158, 2004/04/28 18:10:54
|
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"). |
|
&Apache::loncommon::help_open_faq(10). |
|
&Apache::loncommon::help_open_bug('Instructor Interface'); |
|
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 359 sub startpage {
|
$selscript |
$selscript |
</head> |
</head> |
$bodytag |
$bodytag |
|
|
ENDHEAD |
ENDHEAD |
|
|
unless ($trimheader) {$r->print(<<ENDHEAD2); |
unless ($trimheader) {$r->print(<<ENDHEAD2); |
Line 362 ENDHEAD
|
Line 368 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 432 sub print_row {
|
Line 439 sub print_row {
|
$parm=~s|\[.*\]\s||g; |
$parm=~s|\[.*\]\s||g; |
} |
} |
|
|
$r->print('<td bgcolor='.$defbgone.'>'.$parm.'</td>'); |
$r->print('<td bgcolor='.$defbgone.'>'.&mt($parm).'</td>'); |
|
|
my $thismarker=$which; |
my $thismarker=$which; |
$thismarker=~s/^parameter\_//; |
$thismarker=~s/^parameter\_//; |
Line 580 sub extractResourceInformation {
|
Line 587 sub extractResourceInformation {
|
my $resid=$2; |
my $resid=$2; |
my $id=$mapid.'.'.$resid; |
my $id=$mapid.'.'.$resid; |
my $srcf=$$bighash{$_}; |
my $srcf=$$bighash{$_}; |
if ($srcf=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
# if ($srcf=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
|
if (1) { |
$$ids[$#$ids+1]=$id; |
$$ids[$#$ids+1]=$id; |
$$typep{$id}=$1; |
$$typep{$id}=$1; |
$$keyp{$id}=''; |
$$keyp{$id}=''; |
Line 1099 sub assessparms {
|
Line 1107 sub assessparms {
|
'rl' => "Resource Level", |
'rl' => "Resource Level", |
'ic' => 'in Course', |
'ic' => 'in Course', |
'aut' => "Assessment URL and Title", |
'aut' => "Assessment URL and Title", |
'type' => &mt('Type'), |
'type' => 'Type', |
'emof' => "Enclosing Map or Folder", |
'emof' => "Enclosing Map or Folder", |
'part' => &mt('Part'), |
'part' => 'Part', |
'pn' => 'Parameter Name', |
'pn' => 'Parameter Name', |
'def' => 'default', |
'def' => 'default', |
'femof' => 'from Enclosing Map or Folder', |
'femof' => 'from Enclosing Map or Folder', |
Line 1144 ENDTABLEHEADFOUR
|
Line 1152 ENDTABLEHEADFOUR
|
my $rid=$_; |
my $rid=$_; |
my ($inmapid)=($rid=~/\.(\d+)$/); |
my ($inmapid)=($rid=~/\.(\d+)$/); |
|
|
if (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid}) || |
if ((!$pssymb && |
($pssymb eq $symbp{$rid})) { |
(($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid}))) |
|
|| |
|
($pssymb && $pssymb eq $symbp{$rid})) { |
# ------------------------------------------------------ Entry for one resource |
# ------------------------------------------------------ Entry for one resource |
if ($defbgone eq '"E0E099"') { |
if ($defbgone eq '"E0E099"') { |
$defbgone='"E0E0DD"'; |
$defbgone='"E0E0DD"'; |
Line 1189 ENDTABLEHEADFOUR
|
Line 1199 ENDTABLEHEADFOUR
|
'><tt><font size=-1>'. |
'><tt><font size=-1>'. |
join(' / ',split(/\//,$uri)). |
join(' / ',split(/\//,$uri)). |
'</font></tt><p><b>'. |
'</font></tt><p><b>'. |
"<a href=\"javascript:openWindow('/res/".$uri. |
"<a href=\"javascript:openWindow('". |
|
&Apache::lonnet::clutter($uri). |
"', 'metadatafile', '450', '500', 'no', 'yes')\";". |
"', 'metadatafile', '450', '500', 'no', 'yes')\";". |
" TARGET=_self>$title"); |
" TARGET=_self>$title"); |
|
|
Line 1489 sub crsenv {
|
Line 1500 sub crsenv {
|
} |
} |
# |
# |
# Let the user know we made the changes |
# Let the user know we made the changes |
if ($name) { |
if ($name && defined($value)) { |
my $put_result = &Apache::lonnet::put('environment', |
my $put_result = &Apache::lonnet::put('environment', |
{$name=>$value},$dom,$crs); |
{$name=>$value},$dom,$crs); |
if ($put_result eq 'ok') { |
if ($put_result eq 'ok') { |
Line 1519 sub crsenv {
|
Line 1530 sub crsenv {
|
&mt('Modification may make assessment data inaccessible'). |
&mt('Modification may make assessment data inaccessible'). |
'</font>', |
'</font>', |
'description' => '<b>'.&mt('Course Description').'</b>', |
'description' => '<b>'.&mt('Course Description').'</b>', |
'courseid' => '<b>'.&mt('Course ID').' '.&mt('or').' '.&mt('number'). |
'courseid' => '<b>'.&mt('Course ID or number'). |
'</b><br />'. |
'</b><br />'. |
'('.&mt('internal').', '.&mt('optional').')', |
'('.&mt('internal').', '.&mt('optional').')', |
'grading' => '<b>'.&mt('Grading').'</b>'. |
'grading' => '<b>'.&mt('Grading').'</b><br />'. |
' "'.&mt('standard').'", "'.&mt('external').'", '. |
'<tt>"standard", "external", or "spreadsheet"</tt> '.&Apache::loncommon::help_open_topic('GradingOptions'), |
&mt('or any other value').'.'. |
|
' '.&mt('Default for new courses is').' "'. |
|
&mt('standard').'".', |
|
'default_xml_style' => '<b>'.&mt('Default XML Style File').'</b> '. |
'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'". |
Line 1539 sub crsenv {
|
Line 1547 sub crsenv {
|
'policy.email' => '<b>'.&mt('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>'.&mt('Hide Empty Rows in Spreadsheets').'</b><br />'. |
'hideemptyrows' => '<b>'.&mt('Hide Empty Rows in Spreadsheets').'</b><br />'. |
'("<tt>yes</tt>" for default hiding)', |
'('.&mt('"[_1]" for default hiding','<tt>yes</tt>').')', |
'pageseparators' => '<b>'.&mt('Visibly Separate Items on Pages').'</b><br />'. |
'pageseparators' => '<b>'.&mt('Visibly Separate Items on Pages').'</b><br />'. |
'("<tt>'.&mt('yes').'</tt>" '.&mt('for visible separation').', '. |
'('.&mt('"[_1]" for visible separation','<tt>yes</tt>').', '. |
&mt('changes will not show until next login').')', |
&mt('changes will not show until next login').')', |
|
|
'plc.roles.denied'=> '<b>'.&mt('Disallow live chatroom use for Roles'). |
'plc.roles.denied'=> '<b>'.&mt('Disallow live chatroom use for Roles'). |
'</b><br />"<tt>st</tt>": '. |
'</b><br />"<tt>st</tt>": '. |
'student, "<tt>ta</tt>": '. |
&mt('student').', "<tt>ta</tt>": '. |
'TA, "<tt>in</tt>": '. |
'TA, "<tt>in</tt>": '. |
'instructor;<br /><tt>role,role,...</tt>) '. |
&mt('instructor').';<br /><tt>'.&mt('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>'.&mt('Disallow live chatroom use for Users').'</b><br />'. |
'<b>'.&mt('Disallow live chatroom use for Users').'</b><br />'. |
Line 1580 sub crsenv {
|
Line 1588 sub crsenv {
|
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
'allow_limited_html_in_feedback' |
'allow_limited_html_in_feedback' |
=> '<b>'.&mt('Allow limited HTML in discussion posts').'</b><br />'. |
=> '<b>'.&mt('Allow limited HTML in discussion posts').'</b><br />'. |
'('.&mt('Set value to').' "<tt>'.&mt('yes').'</tt>" '.&mt('to allow').')', |
'('.&mt('Set value to "[_1]" to allow',"<tt>yes</tt>").')', |
'rndseed' |
'rndseed' |
=> '<b>'.&mt('Randomization algorithm used').'</b> <br />'. |
=> '<b>'.&mt('Randomization algorithm used').'</b> <br />'. |
'<font color="red">'.&mt('Modifying this will make problems').' '. |
'<font color="red">'.&mt('Modifying this will make problems').' '. |
&mt('have different numbers and answers').'</font>', |
&mt('have different numbers and answers').'</font>', |
|
'receiptalg' |
|
=> '<b>'.&mt('Receipt algorithm used').'</b> <br />'. |
|
&mt('This controls how receipt numbers are generated.'), |
'problem_stream_switch' |
'problem_stream_switch' |
=> '<b>'.&mt('Allow problems to be split over pages').'</b><br />'. |
=> '<b>'.&mt('Allow problems to be split over pages').'</b><br />'. |
' ("<tt>'.&mt('yes').'</tt>" '.&mt('if allowed, anything else if not').')', |
' ('.&mt('"[_1]" if allowed, anything else if not','<tt>yes</tt>').')', |
'anonymous_quiz' |
'anonymous_quiz' |
=> '<b>'.&mt('Anonimous quiz/exam').'</b><br />'. |
=> '<b>'.&mt('Anonymous quiz/exam').'</b><br />'. |
' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)', |
' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)', |
'default_enrollment_start_date' => '<b>'.&mt('Default beginning date when enrolling students').'</b>', |
'default_enrollment_start_date' => '<b>'.&mt('Default beginning date when enrolling students').'</b>', |
'default_enrollment_end_date' => '<b>'.&mt('Default ending date when enrolling students').'</b>', |
'default_enrollment_end_date' => '<b>'.&mt('Default ending date when enrolling students').'</b>', |
|
'nothideprivileged' => '<b>'.&mt('Privileged users that should not be hidden on staff listings').'</b>'. |
|
'<br />(<tt>user:domain,user:domain,...</tt>)', |
'languages' => '<b>'.&mt('Languages used').'</b>', |
'languages' => '<b>'.&mt('Languages used').'</b>', |
'disable_receipt_display' |
'disable_receipt_display' |
=> '<b>'.&mt('Disable display of problem receipts').'</b><br />'. |
=> '<b>'.&mt('Disable display of problem receipts').'</b><br />'. |
' ("<tt>'.&mt('yes').'</tt>" '.&mt('to disable, anything else if not').')' |
' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')', |
|
'tthoptions' |
|
=> '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>' |
); |
); |
my @Display_Order = ('url','description','courseid','grading', |
my @Display_Order = ('url','description','courseid','grading', |
'default_xml_style','pageseparators', |
'default_xml_style','pageseparators', |
Line 1605 sub crsenv {
|
Line 1620 sub crsenv {
|
'pch.roles.denied','pch.users.denied', |
'pch.roles.denied','pch.users.denied', |
'allow_limited_html_in_feedback', |
'allow_limited_html_in_feedback', |
'languages', |
'languages', |
|
'nothideprivileged', |
'rndseed', |
'rndseed', |
|
'receiptalg', |
'problem_stream_switch', |
'problem_stream_switch', |
'disable_receipt_display', |
'disable_receipt_display', |
'spreadsheet_default_classcalc', |
'spreadsheet_default_classcalc', |
Line 1614 sub crsenv {
|
Line 1631 sub crsenv {
|
'hideemptyrows', |
'hideemptyrows', |
'default_enrollment_start_date', |
'default_enrollment_start_date', |
'default_enrollment_end_date', |
'default_enrollment_end_date', |
|
'tthoptions' |
); |
); |
foreach my $parameter (sort(keys(%values))) { |
foreach my $parameter (sort(keys(%values))) { |
unless ($parameter =~ m/^internal\./) { |
unless ($parameter =~ m/^internal\./) { |
Line 1658 sub crsenv {
|
Line 1676 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 %lt=&Apache::lonlocal::texthash( |
|
'par' => 'Parameter', |
|
'val' => 'Value', |
|
'set' => 'Set', |
|
'sce' => 'Set Course Environment' |
|
); |
|
|
my $Parameter=&mt('Parameter'); |
my $Parameter=&mt('Parameter'); |
my $Value=&mt('Value'); |
my $Value=&mt('Value'); |
my $Set=&mt('Set'); |
my $Set=&mt('Set'); |
|
my $browse_js=&Apache::loncommon::browser_and_searcher_javascript(); |
$r->print(<<ENDENV); |
$r->print(<<ENDENV); |
<html> |
<html> |
<script type="text/javascript" language="Javascript" > |
<script type="text/javascript" language="Javascript" > |
var editbrowser; |
$browse_js |
function openbrowser(formname,elementname,only,omit) { |
|
var url = '/res/?'; |
|
if (editbrowser == null) { |
|
url += 'launch=1&'; |
|
} |
|
url += 'catalogmode=interactive&'; |
|
url += 'mode=parmset&'; |
|
url += 'form=' + formname + '&'; |
|
if (only != null) { |
|
url += 'only=' + only + '&'; |
|
} |
|
if (omit != null) { |
|
url += 'omit=' + omit + '&'; |
|
} |
|
url += 'element=' + elementname + ''; |
|
var title = 'Browser'; |
|
var options = 'scrollbars=1,resizable=1,menubar=0'; |
|
options += ',width=700,height=600'; |
|
editbrowser = open(url,title,options,'1'); |
|
editbrowser.focus(); |
|
} |
|
</script> |
</script> |
<head> |
<head> |
<title>LON-CAPA Course Environment</title> |
<title>LON-CAPA Course Environment</title> |
Line 1695 $bodytag
|
Line 1700 $bodytag
|
$setoutput |
$setoutput |
<p> |
<p> |
<table border=2> |
<table border=2> |
<tr><th>$Parameter</th><th>$Value</th><th>$Set?</th></tr> |
<tr><th>$lt{'par'}</th><th>$lt{'val'}</th><th>$lt{'set'}?</th></tr> |
$output |
$output |
</table> |
</table> |
<input type="submit" name="crsenv" value="Set Course Environment"> |
<input type="submit" name="crsenv" value="$lt{'sce'}"> |
</form> |
</form> |
</body> |
</body> |
</html> |
</html> |
Line 1759 ENDOVER
|
Line 1764 ENDOVER
|
push (@deldata,$thiskey); |
push (@deldata,$thiskey); |
} elsif ($cmd eq 'datepointer') { |
} elsif ($cmd eq 'datepointer') { |
my $data=&Apache::lonhtmlcommon::get_date_from_form($ENV{$_}); |
my $data=&Apache::lonhtmlcommon::get_date_from_form($ENV{$_}); |
if ($olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; } |
if (defined($data) and $olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; } |
} |
} |
} |
} |
} |
} |
# 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 1773 ENDOVER
|
Line 1795 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 1810 ENDOVER
|
Line 1833 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 1828 ENDOVER
|
Line 1852 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>'); |
} |
} |
|
|
################################################## |
################################################## |