--- loncom/interface/lonparmset.pm 2009/06/04 16:56:27 1.454 +++ loncom/interface/lonparmset.pm 2009/06/18 19:43:14 1.462 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.454 2009/06/04 16:56:27 bisitz Exp $ +# $Id: lonparmset.pm,v 1.462 2009/06/18 19:43:14 neumanie Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1269,7 +1269,9 @@ sub parmmenu { } function checkthis(thisvalue, checkName) { - checkboxChecked(thisvalue); + + document.getElementById(thisvalue.concat("_li")).style.display = ""; + for (i=0; iprint(' style="display:none"'); } $r->print('>' - .($$allparms{$tempkey}=~/\s/ ? $$allparms{$tempkey} : $tempkey) + .($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey) .'' ); } @@ -1413,7 +1415,7 @@ sub shortCuts { #part to print out the shortcuts for parmselection $r->print('' .'' .''.&Apache::loncommon::end_data_table_header_row()); + foreach my $mapid (@{$tree}) { + my $depth = $treeinfo->{$mapid}->{'depth'}; + my $indent = (' 'x$depth); + $icon = ''; + if ($treeinfo->{$mapid}->{'type'} eq 'page') { + $icon = ''; + } + $r->print(&Apache::loncommon::start_data_table_header_row().''.&Apache::loncommon::end_data_table_header_row()); + } + $r->print(&Apache::loncommon::end_data_table()); } - $r->print(""); - } sub levelmenu { @@ -1918,7 +1964,10 @@ sub assessparms { $uname,$udom,$csec,$cgroup); } # ---------------------------------------------------------------- Done storing - $message.='

'.&mt('Changes can take up to 10 minutes before being active for all students.').&Apache::loncommon::help_open_topic('Caching').'

'; + $message.='

' + .&mt('Changes can take up to 10 minutes before being active for all students.') + .&Apache::loncommon::help_open_topic('Caching') + .'

'; } #----------------------------------------------- if all selected, fill in array if ($pscat[0] eq "all") {@pscat = (keys %allparms);} @@ -1935,6 +1984,27 @@ sub assessparms { '" name="recent_'.$_.'" />'); } + # ----- Start Parameter Selection + + # Hide parm selection? + $r->print(< +// + +ENDPARMSELSCRIPT + my $parmselhiddenstyle=' style="display:none"'; + if($env{'form.hideparmsel'} eq 'hidden') { + $r->print('
'); + } else { + $r->print('
'); + } + + # Display parameter selection boxes if (!$pssymb) { $r->print(&Apache::lonhtmlcommon::topic_bar (1,&mt('General Parameters'))); $r->print(&Apache::lonhtmlcommon::start_pick_box()); @@ -1964,10 +2034,31 @@ sub assessparms { $r->print(&Apache::lonhtmlcommon::row_closure(1)); $r->print(&Apache::lonhtmlcommon::end_pick_box()); + # parm selection is shown: display parm update button + $r->print('

' + .'' + .'' + .'

' + ); + + $r->print('
'); + # ----- End Parameter Selection + + # Offer link to display parameter selection again + $r->print(''); - $r->print('

'.$message.'

'); + # Display Messages + $r->print('
'.$message.'
'); - $r->print('
'); my @temp_pscat; map { @@ -2875,7 +2966,7 @@ ENDOVER #$r->print('
' - .'
'.&mt('Parameter Selection').'' + .'
'.&mt('Parameter Selection').'' .'' .'• '.&mt('Select All').'' .'' @@ -1428,7 +1430,7 @@ sub shortCuts { .'
' .'
' - .'
'.&mt('Add Selection for...').'' + .'
'.&mt('Add Selection for...').'' .'' .'• '.&mt('Problem Dates').'' .'' @@ -1587,17 +1589,61 @@ sub displaymenu { sub mapmenu { my ($r,$allmaps,$pschp,$maptitles)=@_; - + my $navmap = Apache::lonnavmaps::navmap->new(); + my $tree=[]; + my $treeinfo={}; + if (defined($navmap)) { + my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); + my $curRes; + my $depth = 0; + + while ($curRes = $it->next()) { + if ($curRes == $it->BEGIN_MAP()) { + $depth++; + } + if ($curRes == $it->END_MAP()) { + $depth--; + } + if (ref($curRes)) { + if (($curRes->is_sequence()) || ($curRes->is_page())) { + my $type = 'sequence'; + if ($curRes->is_page()) { + $type = 'page'; + } + my $id= $curRes->id(); + my ($mapid,$resid)=split(/\./,$id); + if(!exists($treeinfo->{$mapid})) { + push(@$tree,$mapid); + $treeinfo->{$mapid} = { + depth => $depth, + type => $type, + }; + } + } + } + } + } + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'))); - $r->print('
'.$icon.''.$indent.$icon.'
#
'); - $r->print('
'); + $r->print('
'); #$r->print('

Step 1

'); $r->print('
'); $r->print(&Apache::lonhtmlcommon::start_pick_box()); @@ -2893,7 +2984,7 @@ ENDOVER #$r->print(' #
'); - $r->print('
'); + $r->print('
'); $r->print('
'); $r->print(&Apache::lonhtmlcommon::start_pick_box()); &parmmenu($r,\%allparms,\@pscat,\%keyorder); @@ -2916,7 +3007,7 @@ ENDOVER $r->print(&Apache::lonhtmlcommon::end_pick_box()); $r->print('
'); - $r->print('
'); + $r->print('
'); $r->print('
'); my $sortorder=$env{'form.sortorder'}; unless ($sortorder) { $sortorder='realmstudent'; }