--- loncom/interface/lonparmset.pm 2012/05/10 17:50:07 1.522.2.2 +++ loncom/interface/lonparmset.pm 2013/06/27 18:22:41 1.522.2.7 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.522.2.2 2012/05/10 17:50:07 raeburn Exp $ +# $Id: lonparmset.pm,v 1.522.2.7 2013/06/27 18:22:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -640,7 +640,7 @@ sub storeparm_by_symb { } sub log_parmset { - return &Apache::lonnet::instructor_log('parameterlog',@_); + return &Apache::lonnet::write_log('course','parameterlog',@_); } sub storeparm_by_symb_inner { @@ -747,11 +747,14 @@ sub valout { my $result = ''; # Values of zero are valid. if (! $value && $value ne '0') { - if ($editable) { - $result = '*'; - } else { - $result=' '; - } + if ($editable) { + $result = + ''; + } else { + $result=' '; + } } else { if ($type eq 'date_interval') { my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); @@ -1079,6 +1082,10 @@ sub print_td { if ($which > 3) { $nolink = 1; } + } elsif ($mprefix =~ /examcode\&$/) { + unless ($which == 2) { + $nolink = 1; + } } if ($nolink) { $r->print(&valout($$outpar[$which],$$typeoutpar[$which])); @@ -1232,7 +1239,7 @@ sub extractResourceInformation { $$mapp{$mapid}=$$mapp{$id}; $$allmaps{$mapid}=$$mapp{$id}; if ($mapid eq '1') { - $$maptitles{$mapid}=&mt('Main Course Documents'); + $$maptitles{$mapid}=&mt('Main Content'); } else { $$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id}); } @@ -1402,7 +1409,7 @@ sub lookUpTableParameter { 'lenient' => 'grading', 'retrypartial' => 'tries', 'discussvote' => 'misc', - + 'examcode' => 'high_level_randomization', ); } @@ -1765,7 +1772,7 @@ sub mapmenu { .&Apache::loncommon::end_data_table_row() ); - # Display row: "Main Course Documents" + # Display row: "Main Content" if (exists($$allmaps{1})) { $r->print( &Apache::loncommon::start_data_table_row() @@ -2159,16 +2166,22 @@ sub assessparms { } } } - } elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote)\&\d+$/) { + } elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote|examcode)\&\d+$/) { $name = $1; + my $val = $values[$i]; + if ($name eq 'examcode') { + if (&Apache::lonnet::validCODE($values[$i])) { + $val = 'valid'; + } + } $needsrelease = - $Apache::lonnet::needsrelease{"parameter:$name:$values[$i]"}; + $Apache::lonnet::needsrelease{"parameter:$name:$val"}; if ($needsrelease) { unless ($got_chostname) { ($chostname,$cmajor,$cminor) = ¶meter_release_vars(); $got_chostname = 1; } - $needsnewer = ¶meter_releasecheck($name,$values[$i], + $needsnewer = ¶meter_releasecheck($name,$val, $needsrelease, $chostname, $cmajor,$cminor); @@ -2816,6 +2829,8 @@ sub storedata { $name = 'lenient'; } elsif ($typeof eq 'string_discussvote') { $name = 'discussvote'; + } elsif ($typeof eq 'string_examcode') { + $name = 'examcode'; } elsif ($typeof eq 'string_yesno') { if ($thiskey =~ /\.retrypartial$/) { $name = 'retrypartial'; @@ -2892,7 +2907,7 @@ sub storedata { if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') { my %loghash=map { $_ => '' } @deldata; &log_parmset(\%loghash,1); - $r->print('
'. - ($foundkeys?'':&mt('There are no parameters.')).'
'. + ($foundkeys?'':''.&mt('There are no parameters.').'').''. &Apache::loncommon::end_page()); } @@ -3573,8 +3588,9 @@ ENDOVER } elsif ($data{'realm_type'} eq 'symb') { my ($map,$resid,$url) = &Apache::lonnet::decode_symb($data{'realm'}); - $r->print(&mt('Resource: [_1]