--- loncom/interface/lonparmset.pm 2002/10/03 22:31:58 1.72 +++ loncom/interface/lonparmset.pm 2002/11/19 19:26:35 1.78 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.72 2002/10/03 22:31:58 albertel Exp $ +# $Id: lonparmset.pm,v 1.78 2002/11/19 19:26:35 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -657,6 +657,7 @@ sub assessparms { my @pscat=&get_env_multiple('form.pscat'); my $pschp=$ENV{'form.pschp'}; my @psprt=&get_env_multiple('form.psprt'); + if (!@psprt) { $psprt[0]='0'; } my $showoptions=$ENV{'form.showoptions'}; my $pssymb=''; @@ -930,7 +931,6 @@ sub assessparms { $r->print('>All Parameters'); my $cnt=0; - foreach $tempkey (sort { $allparms{$a} cmp $allparms{$b} } keys %allparms ) { ++$cnt; @@ -949,10 +949,12 @@ sub assessparms { $r->print(''); + my %temphash=(); + foreach (@psprt) { $temphash{$_}=1; } foreach $tempkey (sort keys %allparts) { unless ($tempkey =~ /\./) { $r->print(''); @@ -999,12 +1001,12 @@ sub assessparms { } $r->print(''); - my @temp_psprt; - foreach my $t (@psprt) { - push(@temp_psprt, grep {eval (/^$t\./ || ($_ == $t))} (keys %allparts)); - } +# my @temp_psprt; +# foreach my $t (@psprt) { +# push(@temp_psprt, grep {eval (/^$t\./ || ($_ == $t))} (keys %allparts)); +# } - @psprt = @temp_psprt; +# @psprt = @temp_psprt; my @temp_pscat; map { @@ -1196,7 +1198,7 @@ ENDTABLEHEADFOUR foreach (split(/\,/,$keyp{$rid})) { my $tempkeyp = $_; my $fullkeyp = $tempkeyp; - $tempkeyp =~ s/_[\d_]+_/_0_/; + $tempkeyp =~ s/_\w+_/_0_/; if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { $part{$tempkeyp}="0"; @@ -1204,7 +1206,7 @@ ENDTABLEHEADFOUR $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; - $display{$tempkeyp} =~ s/_[\d_]+_/_0_/; + $display{$tempkeyp} =~ s/_\w+_/_0_/; $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); } @@ -1278,14 +1280,14 @@ ENDMAPONE foreach (split(/\,/,$keyp{$rid})) { my $tempkeyp = $_; my $fullkeyp = $tempkeyp; - $tempkeyp =~ s/_[\d_]+_/_0_/; + $tempkeyp =~ s/_\w+_/_0_/; if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { $part{$tempkeyp}="0"; $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; - $display{$tempkeyp} =~ s/_[\d_]+_/_0_/; + $display{$tempkeyp} =~ s/_\w+_/_0_/; $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); } @@ -1375,6 +1377,21 @@ sub crsenv { $dom,$crs). '
'; } + 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) { $setoutput.='Setting '.$name.' to '. $value.': '. @@ -1393,51 +1410,54 @@ sub crsenv { ('url' => 'Top Level Map '. '". - 'Browse
'. + 'Browse
'. 'Modification may make assessment data '. 'inaccessible', 'description' => 'Course Description', - 'courseid' => 'Course ID or number
'. + 'courseid' => 'Course ID or number
'. '(internal, optional)', 'default_xml_style' => 'Default XML Style File '. 'Browse
", - 'question.email' => 'Feedback Addresses for Content '. - 'Questions
(user:domain,'. - 'user:domain,...)', - 'comment.email' => 'Feedback Addresses for Comments
'. - '(user:domain,user:domain,...)', + 'question.email' => 'Feedback Addresses for Resource Content '. + 'Questions
(user:domain,'. + 'user:domain(section;section;...;*;...),...)', + 'comment.email' => 'Feedback Addresses for Course Content Comments
'. + '(user:domain,user:domain(section;section;...;*;...),...)', 'policy.email' => 'Feedback Addresses for Course Policy'. - '
(user:domain,user:domain,...)', - 'hideemptyrows' => 'Hide Empty Rows in Spreadsheets
'. + '
(user:domain,user:domain(section;section;...;*;...),...)', + 'hideemptyrows' => 'Hide Empty Rows in Spreadsheets
'. '("yes" for default hiding)', - 'pageseparators' => 'Visibly Separate Items on Pages
'. + 'pageseparators' => 'Visibly Separate Items on Pages
'. '("yes" for visible separation)', 'pch.roles.denied'=> 'Disallow Resource Discussion for '. - 'Roles
"st": '. + 'Roles
"st": '. 'student, "ta": '. 'TA, "in": '. - 'instructor;
role,role,...) '. + 'instructor;
role,role,...) '. Apache::loncommon::help_open_topic("Course_Disable_Discussion"), 'pch.users.denied' => - 'Disallow Resource Discussion for Users
'. + 'Disallow Resource Discussion for Users
'. '(user:domain,user:domain,...)', 'spreadsheet_default_classcalc' => 'Default Course Spreadsheet '. 'Browse
", + ",'spreadsheet')\">Browse
", 'spreadsheet_default_studentcalc' => 'Default Student Spreadsheet '. 'Browse
", + ",'spreadsheet')\">Browse
", 'spreadsheet_default_assesscalc' => 'Default Assessment Spreadsheet '. 'Browse
", + ",'spreadsheet')\">Browse
", + 'allow_limited_html_in_feedback' + => 'Allow limited HTML in discussion posts
'. + '(Set value to yes to allow)' ); foreach (keys(%values)) { unless ($descriptions{$_}) {