--- loncom/interface/lonparmset.pm 2013/05/21 18:54:15 1.532 +++ loncom/interface/lonparmset.pm 2013/06/26 21:22:39 1.533 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.532 2013/05/21 18:54:15 raeburn Exp $ +# $Id: lonparmset.pm,v 1.533 2013/06/26 21:22:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1110,6 +1110,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])); @@ -1433,7 +1437,7 @@ sub lookUpTableParameter { 'lenient' => 'grading', 'retrypartial' => 'tries', 'discussvote' => 'misc', - + 'examcode' => 'high_level_randomization', ); } @@ -2190,10 +2194,16 @@ 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(); @@ -2841,6 +2851,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'; @@ -4693,9 +4705,12 @@ sub oldversion_warning { lenient => 'string_lenient', retrypartial => 'string_yesno', discussvote => 'string_discussvote', + examcode => 'string_examcode', ); if (exists($stringtypes{$name})) { - if (ref($strings{$stringtypes{$name}}) eq 'ARRAY') { + if ($name eq 'examcode') { + + } elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') { foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) { next unless (ref($possibilities) eq 'ARRAY'); my ($parmval, $description) = @{ $possibilities };