version 1.107, 2003/06/20 16:13:06
|
version 1.121, 2003/09/03 21:24:32
|
Line 287 sub plink {
|
Line 287 sub plink {
|
sub startpage { |
sub startpage { |
my ($r,$id,$udom,$csec,$uname,$have_assesments)=@_; |
my ($r,$id,$udom,$csec,$uname,$have_assesments)=@_; |
|
|
my $bodytag=&Apache::loncommon::bodytag('Set Course Parameters','', |
my $bodytag=&Apache::loncommon::bodytag('Set/Modify 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'); |
Line 343 $selscript
|
Line 343 $selscript
|
$bodytag |
$bodytag |
|
|
<form method="post" action="/adm/parmset" name="envform"> |
<form method="post" action="/adm/parmset" name="envform"> |
<h3>Course Environment</h3> |
<h4>Course Environment Parameters</h4> |
<input type="submit" name="crsenv" value="Set Course Environment"> |
<input type="submit" name="crsenv" value="Set Course Environment Parameters" /> |
|
</form> |
|
<hr /> |
|
<form method="post" action="/adm/helper/parameter.helper" name="helpform"> |
|
<h4>Course Assessment Parameter - Helper Mode</h4> |
|
<input type="submit" value="Set/Modify Course Assessment Parameter" /> |
|
</form> |
|
<hr /> |
|
<form method="post" action="/adm/parmset" name="overview"> |
|
<h4>Course Assessment Parameters - Overview Mode</h4> |
|
<input type="submit" name="overview" value="Modify Course Assessment Parameters" /> |
</form> |
</form> |
<hr /> |
<hr /> |
<form method="post" action="/adm/parmset" name="parmform"> |
<form method="post" action="/adm/parmset" name="parmform"> |
<h3>Course Assessments</h3> |
<h4>Course Assessments Parameters - Table Mode</h4> |
|
|
<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 |
ENDHEAD |
|
|
if (!$have_assesments) { |
if (!$have_assesments) { |
Line 488 sub print_row {
|
Line 494 sub print_row {
|
sub print_td { |
sub print_td { |
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; |
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; |
$r->print('<td bgcolor='.(($result==$which)?'"#AAFFAA"':$defbg). |
$r->print('<td bgcolor='.(($result==$which)?'"#AAFFAA"':$defbg). |
' align="center">'. |
' align="center">'); |
&plink($$typeoutpar[$which],$$display{$value},$$outpar[$which], |
if ($which<10) { |
$mprefix."$which",'parmform.pres','psub').'</td>'."\n"); |
$r->print(&plink($$typeoutpar[$which], |
|
$$display{$value},$$outpar[$which], |
|
$mprefix."$which",'parmform.pres','psub')); |
|
} else { |
|
$r->print(&valout($$outpar[$which],$$typeoutpar[$which])); |
|
} |
|
$r->print('</td>'."\n"); |
} |
} |
|
|
sub get_env_multiple { |
sub get_env_multiple { |
Line 852 sub assessparms {
|
Line 864 sub assessparms {
|
$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>'; |
$message.='<h3>Changes can take up to 10 minutes before being active for all students.'.&Apache::loncommon::help_open_topic('Caching').'</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 891 sub assessparms {
|
Line 904 sub assessparms {
|
|
|
&startpage($r,$id,$udom,$csec,$uname,$have_assesments); |
&startpage($r,$id,$udom,$csec,$uname,$have_assesments); |
|
|
if (!$have_assesments) { return ''; } |
if (!$have_assesments) { |
|
untie(%bighash); |
|
untie(%parmhash); |
|
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 906 sub assessparms {
|
Line 923 sub assessparms {
|
|
|
$r->print('<h2>'.$message.'</h2><table>'); |
$r->print('<h2>'.$message.'</h2><table>'); |
|
|
my $submitmessage; |
my $submitmessage = 'Update Section or Specific User'; |
if (!$pssymb) { |
if (!$pssymb) { |
$r->print('<tr><td>Select Parameter Level</td><td colspan="2">'); |
$r->print('<tr><td>Select Parameter Level</td><td colspan="2">'); |
$r->print('<select name="parmlev">'); |
$r->print('<select name="parmlev">'); |
Line 1029 sub assessparms {
|
Line 1046 sub assessparms {
|
if (($prevvisit) || ($pschp) || ($pssymb)) { |
if (($prevvisit) || ($pschp) || ($pssymb)) { |
$submitmessage = "Update Course Assessment Parameter Display"; |
$submitmessage = "Update Course Assessment Parameter Display"; |
} else { |
} else { |
$submitmessage = "Set Course Assessment Parameters"; |
$submitmessage = "Set/Modify Course Assessment Parameters"; |
} |
} |
$r->print('<input type="submit" name="dis" value="'.$submitmessage.'">'); |
$r->print('<input type="submit" name="dis" value="'.$submitmessage.'">'); |
|
|
Line 1450 sub crsenv {
|
Line 1467 sub crsenv {
|
} |
} |
} |
} |
} |
} |
|
# ------------------------- Re-init course environment entries for this session |
|
|
|
&Apache::lonnet::coursedescription($ENV{'request.course.id'}); |
|
|
# -------------------------------------------------------- Get parameters again |
# -------------------------------------------------------- Get parameters again |
|
|
Line 1466 sub crsenv {
|
Line 1486 sub crsenv {
|
'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)', |
|
'grading' => '<b>Grading</b>'. |
|
'"standard" or any other value. '. |
|
'Default for new courses is "standard".', |
|
|
'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'". |
Line 1482 sub crsenv {
|
Line 1506 sub crsenv {
|
'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)', |
'changes will not show until next login)', |
|
|
|
'plc.roles.denied'=> '<b>Disallow live chatroom use for '. |
|
'Roles</b><br />"<tt>st</tt>": '. |
|
'student, "<tt>ta</tt>": '. |
|
'TA, "<tt>in</tt>": '. |
|
'instructor;<br /><tt>role,role,...</tt>) '. |
|
Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
|
'plc.users.denied' => |
|
'<b>Disallow live chatroom use for Users</b><br />'. |
|
'(<tt>user:domain,user:domain,...</tt>)', |
|
|
'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 1508 sub crsenv {
|
Line 1543 sub crsenv {
|
",'spreadsheet')\">Select Spreadsheet File</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' |
'rndseed' |
=> '<b>Randomization algorithm used</b> <br />'. |
=> '<b>Randomization algorithm used</b> <br />'. |
'<font color="red">Modifying this will make problems '. |
'<font color="red">Modifying this will make problems '. |
'have different numbers and answers</font>', |
'have different numbers and answers</font>', |
'problem_stream_switch' |
'problem_stream_switch' |
=> '<b>Allow problems to be split over pages</b><br />'. |
=> '<b>Allow problems to be split over pages</b><br />'. |
' (<tt><b>yes</b> if allow anything else if not</tt>)', |
' ("<tt>yes</tt>" if allowed, anything else if not)', |
'default_enrollment_start_date' => 'The default beginning date '. |
'anonymous_quiz' |
'for enrolled students.', |
=> '<b>Anonimous quiz/exam</b><br />'. |
'default_enrollment_end_date' => 'The default ending date '. |
' (<tt><b>yes</b> to avoid print students names </tt>)', |
'for enrolled students.', |
'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>', |
|
'disable_receipt_display' |
|
=> '<b>Disable display of problem receipts</b><br />'. |
|
' ("<tt>yes</tt>" to disable, anything else if not)' |
); |
); |
my @Display_Order = ('url','description','courseid', |
my @Display_Order = ('url','description','courseid','grading', |
'default_xml_style','pageseparators', |
'default_xml_style','pageseparators', |
'question.email','comment.email','policy.email', |
'question.email','comment.email','policy.email', |
|
'plc.roles.denied','plc.users.denied', |
'pch.roles.denied','pch.users.denied', |
'pch.roles.denied','pch.users.denied', |
'allow_limited_html_in_feedback', |
'allow_limited_html_in_feedback', |
|
'languages', |
'rndseed', |
'rndseed', |
'problem_stream_switch', |
'problem_stream_switch', |
|
'disable_receipt_display', |
'spreadsheet_default_classcalc', |
'spreadsheet_default_classcalc', |
'spreadsheet_default_studentcalc', |
'spreadsheet_default_studentcalc', |
'spreadsheet_default_assesscalc', |
'spreadsheet_default_assesscalc', |
Line 1619 $output
|
Line 1664 $output
|
</html> |
</html> |
ENDENV |
ENDENV |
} |
} |
|
################################################## |
|
|
|
sub overview { |
|
my $r=shift; |
|
my $bodytag=&Apache::loncommon::bodytag( |
|
'Set/Modify Course Assessment Parameters'); |
|
my $dom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
|
my $crs = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
|
my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs); |
|
$r->print(<<ENDOVER); |
|
<html> |
|
<head> |
|
<title>LON-CAPA Course Environment</title> |
|
</head> |
|
$bodytag |
|
<form method="post" action="/adm/parmset" name="overview"> |
|
<input type="hidden" name="overview" value="1" /> |
|
ENDOVER |
|
foreach (sort keys %resourcedata) { |
|
$r->print($_.' - '.$resourcedata{$_}.'<br />'); |
|
} |
|
$r->print('</form></body></html>'); |
|
} |
|
|
################################################## |
################################################## |
################################################## |
################################################## |
Line 1654 sub handler {
|
Line 1722 sub handler {
|
|
|
$coursename=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
$coursename=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
|
|
unless (($ENV{'form.crsenv'}) || (!$ENV{'request.course.fn'})) { |
if (($ENV{'form.crsenv'}) || (!$ENV{'request.course.fn'})) { |
# --------------------------------------------------------- Bring up assessment |
|
&assessparms($r); |
|
# ---------------------------------------------- This is for course environment |
# ---------------------------------------------- This is for course environment |
} else { |
# -------------------------- also call if toplevel map coudl not be initialized |
&crsenv($r); |
&crsenv($r); |
|
} elsif ($ENV{'form.overview'}) { |
|
# --------------------------------------------------------------- Overview mode |
|
&overview($r); |
|
} else { |
|
# --------------------------------------------------------- Bring up assessment |
|
&assessparms($r); |
} |
} |
} else { |
} else { |
# ----------------------------- Not in a course, or not allowed to modify parms |
# ----------------------------- Not in a course, or not allowed to modify parms |