version 1.71, 2002/10/01 07:09:05
|
version 1.81, 2002/12/30 14:10:58
|
Line 288 sub startpage {
|
Line 288 sub startpage {
|
|
|
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').' '. |
|
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
|
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
|
|
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<html> |
<html> |
<head> |
<head> |
Line 341 sub startpage {
|
Line 345 sub startpage {
|
newWin.focus(); |
newWin.focus(); |
} |
} |
</script> |
</script> |
|
$selscript |
</head> |
</head> |
$bodytag |
$bodytag |
<form method="post" action="/adm/parmset" name="envform"> |
<form method="post" action="/adm/parmset" name="envform"> |
Line 358 For User
|
Line 363 For User
|
or ID |
or ID |
<input type="text" value="$id" size="12" name="id"> |
<input type="text" value="$id" size="12" name="id"> |
at Domain |
at Domain |
<input type="text" value="$udom" size="6" name="udom"> |
$chooseopt |
</b> |
</b> |
<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"> |
Line 467 sub print_row {
|
Line 472 sub print_row {
|
# '.'.$$name{$which}.'.type',$symbp{$rid}); |
# '.'.$$name{$which}.'.type',$symbp{$rid}); |
# this seems to work |
# this seems to work |
my $sessionvaltype=$typeoutpar[$result]; |
my $sessionvaltype=$typeoutpar[$result]; |
|
if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } |
$r->print('<td bgcolor=#999999 align="center"><font color=#FFFFFF>'. |
$r->print('<td bgcolor=#999999 align="center"><font color=#FFFFFF>'. |
&valout($sessionval,$sessionvaltype).' '. |
&valout($sessionval,$sessionvaltype).' '. |
'</font></td>'); |
'</font></td>'); |
Line 656 sub assessparms {
|
Line 662 sub assessparms {
|
my @pscat=&get_env_multiple('form.pscat'); |
my @pscat=&get_env_multiple('form.pscat'); |
my $pschp=$ENV{'form.pschp'}; |
my $pschp=$ENV{'form.pschp'}; |
my @psprt=&get_env_multiple('form.psprt'); |
my @psprt=&get_env_multiple('form.psprt'); |
|
if (!@psprt) { $psprt[0]='0'; } |
my $showoptions=$ENV{'form.showoptions'}; |
my $showoptions=$ENV{'form.showoptions'}; |
|
|
my $pssymb=''; |
my $pssymb=''; |
Line 778 sub assessparms {
|
Line 785 sub assessparms {
|
if ($snum==5) { $storeunder=$seclevelm; } |
if ($snum==5) { $storeunder=$seclevelm; } |
if ($snum==4) { $storeunder=$seclevelr; } |
if ($snum==4) { $storeunder=$seclevelr; } |
|
|
|
my $delete; |
|
if ($ENV{'form.pres_value'} eq '') { $delete=1;} |
my %storecontent = ($storeunder => $ENV{'form.pres_value'}, |
my %storecontent = ($storeunder => $ENV{'form.pres_value'}, |
$storeunder.'.type' => $ENV{'form.pres_type'}); |
$storeunder.'.type' => $ENV{'form.pres_type'}); |
my $reply=''; |
my $reply=''; |
Line 794 sub assessparms {
|
Line 803 sub assessparms {
|
&Apache::lonnet::expirespread('','','assesscalc'); |
&Apache::lonnet::expirespread('','','assesscalc'); |
} |
} |
# Store parameter |
# Store parameter |
$reply=&Apache::lonnet::cput |
if ($delete) { |
('resourcedata',\%storecontent, |
$reply=&Apache::lonnet::del |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
('resourcedata',[keys(%storecontent)], |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
|
} else { |
|
$reply=&Apache::lonnet::cput |
|
('resourcedata',\%storecontent, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
|
} |
} else { |
} else { |
# ------------------------------------------------------------------ Store User |
# ------------------------------------------------------------------ Store User |
# |
# |
Line 813 sub assessparms {
|
Line 829 sub assessparms {
|
&Apache::lonnet::expirespread($uname,$udom,'assesscalc'); |
&Apache::lonnet::expirespread($uname,$udom,'assesscalc'); |
} |
} |
# Store parameter |
# Store parameter |
$reply=&Apache::lonnet::cput |
if ($delete) { |
('resourcedata',\%storecontent,$udom,$uname); |
$reply=&Apache::lonnet::del |
|
('resourcedata',[keys(%storecontent)],$udom,$uname); |
|
} else { |
|
$reply=&Apache::lonnet::cput |
|
('resourcedata',\%storecontent,$udom,$uname); |
|
} |
} |
} |
|
|
if ($reply=~/^error\:(.*)/) { |
if ($reply=~/^error\:(.*)/) { |
$message.="<font color=red>Write Error: $1</font>"; |
$message.="<font color=red>Write Error: $1</font>"; |
} |
} |
# ---------------------------------------------------------------- Done storing |
# ---------------------------------------------------------------- Done storing |
|
$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( |
Line 929 sub assessparms {
|
Line 951 sub assessparms {
|
$r->print('>All Parameters</td>'); |
$r->print('>All Parameters</td>'); |
|
|
my $cnt=0; |
my $cnt=0; |
|
|
foreach $tempkey (sort { $allparms{$a} cmp $allparms{$b} } |
foreach $tempkey (sort { $allparms{$a} cmp $allparms{$b} } |
keys %allparms ) { |
keys %allparms ) { |
++$cnt; |
++$cnt; |
Line 948 sub assessparms {
|
Line 969 sub assessparms {
|
$r->print('<option value="all"'); |
$r->print('<option value="all"'); |
$r->print(' selected') unless (@psprt); |
$r->print(' selected') unless (@psprt); |
$r->print('>All Parts</option>'); |
$r->print('>All Parts</option>'); |
|
my %temphash=(); |
|
foreach (@psprt) { $temphash{$_}=1; } |
foreach $tempkey (sort keys %allparts) { |
foreach $tempkey (sort keys %allparts) { |
unless ($tempkey =~ /\./) { |
unless ($tempkey =~ /\./) { |
$r->print('<option value="'.$tempkey.'"'); |
$r->print('<option value="'.$tempkey.'"'); |
if ($psprt[0] eq "all" || grep $_ == $tempkey, @psprt) { |
if ($psprt[0] eq "all" || $temphash{$tempkey}) { |
$r->print(' selected'); |
$r->print(' selected'); |
} |
} |
$r->print('>'.$allparts{$tempkey}.'</option>'); |
$r->print('>'.$allparts{$tempkey}.'</option>'); |
Line 998 sub assessparms {
|
Line 1021 sub assessparms {
|
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |
|
|
my @temp_psprt; |
# my @temp_psprt; |
foreach my $t (@psprt) { |
# foreach my $t (@psprt) { |
push(@temp_psprt, grep {eval (/^$t\./ || ($_ == $t))} (keys %allparts)); |
# push(@temp_psprt, grep {eval (/^$t\./ || ($_ == $t))} (keys %allparts)); |
} |
# } |
|
|
@psprt = @temp_psprt; |
# @psprt = @temp_psprt; |
|
|
my @temp_pscat; |
my @temp_pscat; |
map { |
map { |
Line 1195 ENDTABLEHEADFOUR
|
Line 1218 ENDTABLEHEADFOUR
|
foreach (split(/\,/,$keyp{$rid})) { |
foreach (split(/\,/,$keyp{$rid})) { |
my $tempkeyp = $_; |
my $tempkeyp = $_; |
my $fullkeyp = $tempkeyp; |
my $fullkeyp = $tempkeyp; |
$tempkeyp =~ s/_[\d_]+_/_0_/; |
$tempkeyp =~ s/_\w+_/_0_/; |
|
|
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
Line 1203 ENDTABLEHEADFOUR
|
Line 1226 ENDTABLEHEADFOUR
|
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_[\d_]+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); |
} |
} |
Line 1277 ENDMAPONE
|
Line 1300 ENDMAPONE
|
foreach (split(/\,/,$keyp{$rid})) { |
foreach (split(/\,/,$keyp{$rid})) { |
my $tempkeyp = $_; |
my $tempkeyp = $_; |
my $fullkeyp = $tempkeyp; |
my $fullkeyp = $tempkeyp; |
$tempkeyp =~ s/_[\d_]+_/_0_/; |
$tempkeyp =~ s/_\w+_/_0_/; |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_[\d_]+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); |
$default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); |
$type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); |
} |
} |
Line 1374 sub crsenv {
|
Line 1397 sub crsenv {
|
$dom,$crs). |
$dom,$crs). |
'<br>'; |
'<br>'; |
} |
} |
|
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 default assessment spreadsheets |
|
} |
|
} |
|
|
if ($name) { |
if ($name) { |
$setoutput.='Setting <tt>'.$name.'</tt> to <tt>'. |
$setoutput.='Setting <tt>'.$name.'</tt> to <tt>'. |
$value.'</tt>: '. |
$value.'</tt>: '. |
Line 1392 sub crsenv {
|
Line 1430 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> '. |
'Browse</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>', |
'courseid' => '<b>Course ID or number</b><br>'. |
'courseid' => '<b>Course ID or number</b><br />'. |
'(internal, optional)', |
'(internal, optional)', |
'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')\">Browse</a><br>", |
'question.email' => '<b>Feedback Addresses for Content '. |
'question.email' => '<b>Feedback Addresses for Resource Content '. |
'Questions</b><br>(<tt>user:domain,'. |
'Questions</b><br />(<tt>user:domain,'. |
'user:domain,...</tt>)', |
'user:domain(section;section;...;*;...),...</tt>)', |
'comment.email' => '<b>Feedback Addresses for Comments</b><br>'. |
'comment.email' => '<b>Feedback Addresses for Course Content Comments</b><br />'. |
'(<tt>user:domain,user:domain,...</tt>)', |
'(<tt>user:domain,user:domain(section;section;...;*;...),...</tt>)', |
'policy.email' => '<b>Feedback Addresses for Course Policy</b>'. |
'policy.email' => '<b>Feedback Addresses for Course Policy</b>'. |
'<br>(<tt>user:domain,user:domain,...</tt>)', |
'<br />(<tt>user:domain,user:domain(section;section;...;*;...),...</tt>)', |
'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)', |
'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>": '. |
'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>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>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')\">Browse</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')\">Browse</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')\">Browse</a><br />", |
|
'allow_limited_html_in_feedback' |
|
=> '<b>Allow limited HTML in discussion posts</b><br />'. |
|
'(Set value to yes to allow)' |
); |
); |
foreach (keys(%values)) { |
foreach (keys(%values)) { |
unless ($descriptions{$_}) { |
unless ($descriptions{$_}) { |