--- loncom/interface/lonparmset.pm 2003/12/08 23:17:52 1.143 +++ loncom/interface/lonparmset.pm 2004/02/24 23:22:27 1.151 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.143 2003/12/08 23:17:52 albertel Exp $ +# $Id: lonparmset.pm,v 1.151 2004/02/24 23:22:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -306,6 +306,11 @@ sub startpage { 'oi' => "or ID", '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(< @@ -354,6 +359,7 @@ sub startpage { $selscript $bodytag +$overallhelp ENDHEAD unless ($trimheader) {$r->print(<
+$assessparmhelp

$lt{'caphm'}

@@ -1522,11 +1529,8 @@ sub crsenv { 'courseid' => ''.&mt('Course ID').' '.&mt('or').' '.&mt('number'). '
'. '('.&mt('internal').', '.&mt('optional').')', - 'grading' => ''.&mt('Grading').''. - ' "'.&mt('standard').'", "'.&mt('external').'", '. - &mt('or any other value').'.'. - ' '.&mt('Default for new courses is').' "'. - &mt('standard').'".', + 'grading' => ''.&mt('Grading').'
'. + '"standard", "external", or "spreadsheet" '.&Apache::loncommon::help_open_topic('GradingOptions'), 'default_xml_style' => ''.&mt('Default XML Style File').' '. ' ''.&mt('Randomization algorithm used').'
'. ''.&mt('Modifying this will make problems').' '. &mt('have different numbers and answers').'', + 'receiptalg' + => ''.&mt('Receipt algorithm used').'
'. + &mt('This controls how receipt numbers are generated.'), 'problem_stream_switch' => ''.&mt('Allow problems to be split over pages').'
'. ' ("'.&mt('yes').'" '.&mt('if allowed, anything else if not').')', 'anonymous_quiz' - => ''.&mt('Anonimous quiz/exam').'
'. + => ''.&mt('Anonymous quiz/exam').'
'. ' ('.&mt('yes').' '.&mt('to avoid print students names').' )', 'default_enrollment_start_date' => ''.&mt('Default beginning date when enrolling students').'', 'default_enrollment_end_date' => ''.&mt('Default ending date when enrolling students').'', + 'nothideprivileged' => ''.&mt('Privileged users that should not be hidden on staff listings').''. + '
(user:domain,user:domain,...)', 'languages' => ''.&mt('Languages used').'', 'disable_receipt_display' => ''.&mt('Disable display of problem receipts').'
'. - ' ("'.&mt('yes').'" '.&mt('to disable, anything else if not').')' + ' ("'.&mt('yes').'" '.&mt('to disable, anything else if not').')', + 'tthoptions' + => ''.&mt('Default set of options to pass to tth/m when converting tex').'' ); my @Display_Order = ('url','description','courseid','grading', 'default_xml_style','pageseparators', @@ -1605,7 +1616,9 @@ sub crsenv { 'pch.roles.denied','pch.users.denied', 'allow_limited_html_in_feedback', 'languages', + 'nothideprivileged', 'rndseed', + 'receiptalg', 'problem_stream_switch', 'disable_receipt_display', 'spreadsheet_default_classcalc', @@ -1614,6 +1627,7 @@ sub crsenv { 'hideemptyrows', 'default_enrollment_start_date', 'default_enrollment_end_date', + 'tthoptions' ); foreach my $parameter (sort(keys(%values))) { unless ($parameter =~ m/^internal\./) { @@ -1764,8 +1778,25 @@ ENDOVER } } # Store - &Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs); - &Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs); + my $delentries=$#deldata+1; + my @newdatakeys=keys %newdata; + my $putentries=$#newdatakeys+1; + if ($delentries) { + if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') { + $r->print('

'.&mt('Deleted [_1] parameter(s)

',$delentries)); + } else { + $r->print('

'. + &mt('Error deleting parameters').'

'); + } + } + if ($putentries) { + if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') { + $r->print('

'.&mt('Stored [_1] parameter(s)

',$putentries)); + } else { + $r->print('

'. + &mt('Error storing parameters').'

'); + } + } # Read and display my %resourcedata=&Apache::lonnet::dump('resourcedata',$dom,$crs); my $oldsection=''; @@ -1773,6 +1804,7 @@ ENDOVER my $oldpart=''; my $pointer=0; $tableopen=0; + my $foundkeys=0; foreach my $thiskey (sort keys %resourcedata) { if ($resourcedata{$thiskey.'.type'}) { my ($course,$middle,$part,$name)= @@ -1810,6 +1842,7 @@ ENDOVER $r->print(&tablestart().''.$name. ':'); + $foundkeys++; if ($resourcedata{$thiskey.'.type'}=~/^date/) { my $jskey='key_'.$pointer; $pointer++; @@ -1828,8 +1861,8 @@ ENDOVER } } - $r->print(&tableend(). - '

'); + $r->print(&tableend().'

'. + ($foundkeys?'':&mt('There are no course or section parameters.')).'

'); } ##################################################