--- loncom/interface/lonparmset.pm 2013/05/23 14:26:43 1.522.2.6 +++ loncom/interface/lonparmset.pm 2013/12/13 23:39:51 1.522.2.11 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.522.2.6 2013/05/23 14:26:43 raeburn Exp $ +# $Id: lonparmset.pm,v 1.522.2.11 2013/12/13 23:39:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,8 +46,6 @@ This module sets coursewide and assessme =over -=pod - =item parmval() Figure out a cascading parameter. @@ -139,15 +137,21 @@ javascript function 'pjump'. extractResourceInformation extracts lots of information about all of the the course's resources into a variety of hashes. -Input: See list below: +Input: See list below + +=over 4 =item * B : Current username =item * B : Domain of current user. -=item * b (out) : An array that will contain all of the ids in the course. @@ -173,6 +177,8 @@ Outputs: See list below: =item * B +=back + =item isdateparm() =item parmmenu() @@ -210,6 +216,8 @@ Returns: nothing Variables used (guessed by Jeremy): +=over + =item * B: ParameterS CATegories? ends up a list of the types of parameters that exist, e.g., tol, weight, acc, opendate, duedate, answerdate, sig, maxtries, type. =item * B: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? @@ -222,6 +230,8 @@ Variables used (guessed by Jeremy): When storing information, store as part 0 When requesting information, request from full part +=back + =item tablestart() =item tableend() @@ -288,7 +298,6 @@ Set portfolio metadata Main handler. Calls &assessparms subroutine. - =back =cut @@ -751,7 +760,7 @@ sub valout { $result = ''.&mt('Change').''; + .' title="'.&mt('Change').'" style="border:0;" />'; } else { $result=' '; } @@ -1082,6 +1091,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])); @@ -1405,7 +1418,7 @@ sub lookUpTableParameter { 'lenient' => 'grading', 'retrypartial' => 'tries', 'discussvote' => 'misc', - + 'examcode' => 'high_level_randomization', ); } @@ -1482,26 +1495,23 @@ sub parmboxes { #Print parameters for my $key (sort { $category_order{$a} <=> $category_order{$b} } keys %categoryList) { - if(@{$categoryList{$key}} == 0) { - next; - } else { - $r->print('
' - .'

' - .&mt($categories{$key}) - .'

'."\n"); - foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { - $r->print('' - .'
'."\n"); + next if(@{$categoryList{$key}} == 0); + $r->print('
' + .'

' + .&mt($categories{$key}) + .'

'."\n"); + foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { + $r->print('' + .'
\n"); + $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} + : $tempkey) + .'
'."\n"); } + $r->print("
\n"); } $r->print("\n"); @@ -1669,13 +1679,13 @@ function group_or_section(caller) { # This function shows on table Mode the available Parameters for the selected Resources # sub displaymenu { - my ($r,$allparms,$pscat,$psprt,$keyorder)=@_; + my ($r,$allparms,$pscat,$psprt,$keyorder,$divid)=@_; $r->print(&Apache::lonhtmlcommon::start_pick_box()); $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); &parmmenu($r,$allparms,$pscat,$keyorder); - $r->print(&Apache::loncommon::start_scrollbox()); + $r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid)); &parmboxes($r,$allparms,$pscat,$keyorder); $r->print(&Apache::loncommon::end_scrollbox()); @@ -1749,7 +1759,7 @@ sub mapmenu { .'' ); - $r->print(&Apache::loncommon::start_scrollbox(undef,undef,undef,'mapmenuscroll')); + $r->print(&Apache::loncommon::start_scrollbox('700px','680px','400px','mapmenuscroll')); $r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner')); # Display row: "All Maps or Folders" @@ -2162,16 +2172,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); @@ -2254,7 +2270,7 @@ ENDPARMSELSCRIPT # Step 2 $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2')); - &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder); + &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder,'parmmenuscroll'); # Step 3 $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3')); @@ -2819,6 +2835,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'; @@ -3601,12 +3619,11 @@ sub date_shift_one { my $start_page=&Apache::loncommon::start_page('Shift Dates'); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); $r->print($start_page.$breadcrumbs); - $r->print('
'. + $r->print(''. ''. '
'.&mt('Currently set date:').''. &Apache::lonlocal::locallocaltime($env{'form.timebase'}).'
'.&mt('Shifted date:').''. - &Apache::lonhtmlcommon::dshowerfuck.net -ate_setter('shiftform', + &Apache::lonhtmlcommon::date_setter('shiftform', 'timeshifted', $env{'form.timebase'},, ''). @@ -3771,6 +3788,7 @@ ENDMAINFORMHEAD }]} ); $r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); + $r->print(''.&Apache::loncommon::end_page()); return; } @@ -3899,7 +3917,7 @@ sub order_meta_fields { foreach my $key (@fields_in_order) { $r->print('
'); $r->print('
'); - $r->print(''); for (my $i = 1;$i le $num_fields;$i ++) { if ($i eq $idx) { $r->print(''); @@ -4643,9 +4661,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') { + $desc = $value; + } elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') { foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) { next unless (ref($possibilities) eq 'ARRAY'); my ($parmval, $description) = @{ $possibilities };