--- loncom/interface/lonparmset.pm 2003/06/23 21:42:07 1.109 +++ loncom/interface/lonparmset.pm 2003/09/04 01:09:04 1.122 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.109 2003/06/23 21:42:07 albertel Exp $ +# $Id: lonparmset.pm,v 1.122 2003/09/04 01:09:04 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -287,7 +287,7 @@ sub plink { sub startpage { 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()"'); my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. &Apache::loncommon::selectstudent_link('parmform','uname','udom'); @@ -343,16 +343,22 @@ $selscript $bodytag
-

Course Environment

- +

Course Environment Parameters

+ +
+
+
+

Course Assessment Parameter - Helper Mode

+ +
+
+
+

Course Assessment Parameters - Overview Mode

+

-

Course Assessments

- -Use Assignment Parameter Helper, a -simpler interface to set open, due, or answer open dates for problems or -sequences.
 
+

Course Assessments Parameters - Table Mode

ENDHEAD if (!$have_assesments) { @@ -488,9 +494,15 @@ sub print_row { sub print_td { my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; $r->print(''. - &plink($$typeoutpar[$which],$$display{$value},$$outpar[$which], - $mprefix."$which",'parmform.pres','psub').''."\n"); + ' align="center">'); + if ($which<10) { + $r->print(&plink($$typeoutpar[$which], + $$display{$value},$$outpar[$which], + $mprefix."$which",'parmform.pres','psub')); + } else { + $r->print(&valout($$outpar[$which],$$typeoutpar[$which])); + } + $r->print(''."\n"); } sub get_env_multiple { @@ -852,7 +864,7 @@ sub assessparms { $message.="Write Error: $1"; } # ---------------------------------------------------------------- Done storing - $message.='

Changes can take up to 10 minutes before being active for all students

'; + $message.='

Changes can take up to 10 minutes before being active for all students.'.&Apache::loncommon::help_open_topic('Caching').'

'; } # --------------------------------------------- Devalidate cache for this child &Apache::lonnet::devalidatecourseresdata( @@ -892,7 +904,11 @@ sub assessparms { &startpage($r,$id,$udom,$csec,$uname,$have_assesments); - if (!$have_assesments) { return ''; } + if (!$have_assesments) { + untie(%bighash); + untie(%parmhash); + return ''; + } # if ($ENV{'form.url'}) { # $r->print(''); @@ -907,7 +923,7 @@ sub assessparms { $r->print('

'.$message.'

'); - my $submitmessage; + my $submitmessage = 'Update Section or Specific User'; if (!$pssymb) { $r->print('
Select Parameter Level'); $r->print(''); @@ -1470,6 +1486,10 @@ sub crsenv { 'description' => 'Course Description', 'courseid' => 'Course ID or number
'. '(internal, optional)', + 'grading' => 'Grading'. + '"standard" or any other value. '. + 'Default for new courses is "standard".', + 'default_xml_style' => 'Default XML Style File '. ' 'Visibly Separate Items on Pages
'. '("yes" for visible separation, '. 'changes will not show until next login)', + + 'plc.roles.denied'=> 'Disallow live chatroom use for '. + 'Roles
"st": '. + 'student, "ta": '. + 'TA, "in": '. + 'instructor;
role,role,...) '. + Apache::loncommon::help_open_topic("Course_Disable_Discussion"), + 'plc.users.denied' => + 'Disallow live chatroom use for Users
'. + '(user:domain,user:domain,...)', + 'pch.roles.denied'=> 'Disallow Resource Discussion for '. 'Roles
"st": '. 'student, "ta": '. @@ -1520,20 +1551,28 @@ sub crsenv { 'problem_stream_switch' => 'Allow problems to be split over pages
'. ' ("yes" if allowed, anything else if not)', + 'anonymous_quiz' + => 'Anonimous quiz/exam
'. + ' (yes to avoid print students names )', 'default_enrollment_start_date' => 'Default beginning date '. 'when enrolling students', 'default_enrollment_end_date' => 'Default ending date '. 'when enrolling students', - 'languages' => 'Languages used' + 'languages' => 'Languages used', + 'disable_receipt_display' + => 'Disable display of problem receipts
'. + ' ("yes" to disable, anything else if not)' ); - my @Display_Order = ('url','description','courseid', + my @Display_Order = ('url','description','courseid','grading', 'default_xml_style','pageseparators', 'question.email','comment.email','policy.email', + 'plc.roles.denied','plc.users.denied', 'pch.roles.denied','pch.users.denied', 'allow_limited_html_in_feedback', 'languages', 'rndseed', 'problem_stream_switch', + 'disable_receipt_display', 'spreadsheet_default_classcalc', 'spreadsheet_default_studentcalc', 'spreadsheet_default_assesscalc', @@ -1625,6 +1664,63 @@ $output 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'}; + $r->print(< + +LON-CAPA Course Environment + +$bodytag + + +ENDOVER +# Read and display + my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs); + my $oldsection=''; + my $oldrealm=''; + my $oldpart=''; + foreach my $thiskey (sort keys %resourcedata) { + my ($course,$middle,$part,$name)= + ($thiskey=~/^(\w+)\.(.*)\.*([\w\s]+)\.(\w+)$/); + unless ($name eq 'type') { + my $section='All Students'; + if ($middle=~/^\[(.*)\]\./) { + $section='Group/Section: '.$1; + $middle=~s/^\[(.*)\]\.//; + } + my $realm='All Resources'; + if ($middle=~/^(.+)\_\_\_\(all\)$/) { + $realm='Folder/Map: '.$1; + } elsif ($middle) { + $realm='Resource: '.$middle; + } + if ($section ne $oldsection) { + $r->print("\n

$section

"); + $oldsection=$section; + $oldrealm=''; + } + if ($realm ne $oldrealm) { + $r->print("\n

$realm

"); + $oldrealm=$realm; + $oldpart=''; + } + if ($part ne $oldpart) { + $r->print("\n

Part: $part

"); + $oldpart=$part; + } + + $r->print('
'.$name.': '.$thiskey.' = '.$resourcedata{$thiskey}); + } + } + $r->print(''); +} ################################################## ################################################## @@ -1660,12 +1756,16 @@ sub handler { $coursename=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; - unless (($ENV{'form.crsenv'}) || (!$ENV{'request.course.fn'})) { -# --------------------------------------------------------- Bring up assessment - &assessparms($r); + if (($ENV{'form.crsenv'}) || (!$ENV{'request.course.fn'})) { # ---------------------------------------------- This is for course environment - } else { +# -------------------------- also call if toplevel map coudl not be initialized &crsenv($r); + } elsif ($ENV{'form.overview'}) { +# --------------------------------------------------------------- Overview mode + &overview($r); + } else { +# --------------------------------------------------------- Bring up assessment + &assessparms($r); } } else { # ----------------------------- Not in a course, or not allowed to modify parms