--- loncom/interface/lonparmset.pm 2011/01/15 15:14:47 1.508 +++ loncom/interface/lonparmset.pm 2011/05/18 11:26:44 1.512 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.508 2011/01/15 15:14:47 www Exp $ +# $Id: lonparmset.pm,v 1.512 2011/05/18 11:26:44 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -137,33 +137,41 @@ javascript function 'pjump'. =item extractResourceInformation() : -Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. + extractResourceInformation extracts lots of information about all of the the course's resources into a variety of hashes. Input: See list below: -=item * B : An array that will contain all of the ids in the course. +=item * B : Current username -=item * B : hash, id->type, where "type" contains the extension of the file, thus, I. +=item * B : Domain of current user. -=item * B : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id +=item * b : hash, name of parameter->display value (what is the display value?) +Outputs: See list below: -=item * B : hash, part identification->text representation of part, where the text representation is "[Part $part]" +=item * B (out) : An array that will contain all of the ids in the course. -=item * B : hash, full key to part->display value (what's display value?) +=item * B(out) : hash, id->type, where "type" contains the extension of the file, thus, I. -=item * B : hash, ??? +=item * B (out) : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id -=item * B : ??? +=item * B (out) : hash, name of parameter->display value (what is the display value?) -=item * B : hash, ??? +=item * B (out) : hash, part identification->text representation of part, where the text representation is "[Part $part]" + +=item * B (out) : hash, ??? =item * B : ?? =item * B : hash, id->full sym? +=item * B + +=item * B +=item * B + +=item * B =item isdateparm() @@ -1165,6 +1173,9 @@ sub extractResourceInformation { $$typep{$id}=$1; $$keyp{$id}=''; $$uris{$id}=$srcf; + &Apache::lonnet::logthis("Invoking metadata $srcf"); + &Apache::lonnet::logthis(&Apache::lonnet::metadata($srcf, 'allpossiblekeys')); + foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { next if ($key!~/^parameter_/); @@ -1264,14 +1275,12 @@ sub parmmenu { ele = document.forms.parmform.elements[i]; if (ele.name == checkName) { document.forms.parmform.elements[i].checked=value; - document.getElementById(document.forms.parmform.elements[i].value.concat(li)).style.display = displayOverview; } } } function checkthis(thisvalue, checkName) { - document.getElementById(thisvalue.concat("_li")).style.display = ""; for (i=0; i ENDSCRIPT - $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); - - #part to print selected parms overview - $r->print(&mt('Selected Parameters:').'
'); - - #print out all possible parms and hide them by default - $r->print('
    '); - foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { - $r->print('
  • print(' style="display:none"'); - } - $r->print('>' - .($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey) - .'
  • ' - ); - } - $r->print('
'); $r->print('
'); &shortCuts($r,$allparms,$pscat,$keyorder); $r->print('
'); - - $r->print( - '

' - .&mt('Show detailed Parameter Selection') - .'

' - ); - - $r->print(&Apache::lonhtmlcommon::row_closure(1)); } # return a hash sub categories { @@ -1399,6 +1364,8 @@ sub lookUpTableParameter { 'contentopen' => 'time_settings', 'contentclose' => 'time_settings', 'discussend' => 'time_settings', + 'printopendate' => 'time_settings', + 'printclosedate' => 'time_settings', 'weight' => 'grading', 'handgrade' => 'grading', 'maxtries' => 'tries', @@ -1498,24 +1465,12 @@ sub parmboxes { 'file_submission' => [], 'misc' => [], ); - my $hidelink = - '

' - .'' - .&mt('Hide detailed Parameter Selection') - .'' - .'

' - ."\n"; -; + foreach $tempparameter (keys %$allparms) { &whatIsMyCategory($tempparameter, \%categoryList); } #part to print the parm-list - $r->print( - '\n"); } # # This function offers some links on the parameter section to get with one click a group a parameters @@ -1708,11 +1657,19 @@ function group_or_section(caller) { # This function shows on table Mode the available Parameters for the selected Resources # sub displaymenu { - my ($r,$allparms,$allparts,$pscat,$psprt,$keyorder)=@_; + my ($r,$allparms,$pscat,$psprt,$keyorder)=@_; + $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::lonhtmlcommon::end_pick_box()); + $r->print(&Apache::loncommon::start_scrollbox()); &parmboxes($r,$allparms,$pscat,$keyorder); + $r->print(&Apache::loncommon::end_scrollbox()); + + $r->print(&Apache::lonhtmlcommon::row_closure(1)); + $r->print(&Apache::lonhtmlcommon::end_pick_box()); + } sub mapmenu { @@ -1780,7 +1737,7 @@ sub mapmenu { .'' ); - + $r->print(&Apache::loncommon::start_scrollbox()); $r->print(&Apache::loncommon::start_data_table()); # Display row: "All Maps or Folders" @@ -1861,6 +1818,7 @@ sub mapmenu { } $r->print(&Apache::loncommon::end_data_table()); + $r->print(&Apache::loncommon::end_scrollbox()); } } @@ -1987,7 +1945,9 @@ sub standardkeyorder { 'parameter_0_sig' => 17, 'parameter_0_turnoffunit' => 18, 'parameter_0_discussend' => 19, - 'parameter_0_discusshide' => 20); + 'parameter_0_discusshide' => 20, + 'parameter_0_printopendate' => 21, + 'parameter_0_printclosedate' => 22); } @@ -1995,6 +1955,9 @@ sub assessparms { my $r=shift; + + +# -------------------------------------------------------- Variable declaration my @ids=(); my %symbp=(); my %mapp=(); @@ -2002,9 +1965,6 @@ sub assessparms { my %keyp=(); my %uris=(); my %maptitles=(); - -# -------------------------------------------------------- Variable declaration - my %allmaps=(); my %alllevs=(); @@ -2023,14 +1983,16 @@ sub assessparms { my %allparms; my %allparts; +# ------------------------------------------------------------------------------ + # # Order in which these parameters will be displayed # my %keyorder=&standardkeyorder(); - @ids=(); - %symbp=(); - %typep=(); +# @ids=(); +# %symbp=(); # These seem defined above already. +# %typep=(); my $message=''; @@ -2152,6 +2114,8 @@ sub assessparms { my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; my ($got_chostname,$chostname,$cmajor,$cminor); my $totalstored = 0; + + for (my $i=0;$i<=$#markers;$i++) { my ($needsrelease,$needsnewer); if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { @@ -2287,7 +2251,7 @@ COURSECONTENTSCRIPT # Step 2 $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'))); - &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); + &displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder); # Step 3 $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'))); @@ -2299,7 +2263,7 @@ COURSECONTENTSCRIPT # Update Display Button $r->print('

' .'' + .' value="'.&mt('Update Display').'" />' .'' .'

'); $r->print(''); @@ -2335,7 +2299,7 @@ COURSECONTENTSCRIPT $r->print(&Apache::lonhtmlcommon::end_pick_box()); $r->print('

' .'' + .' value="'.&mt('Update Display').'" />' .'' .'

'); } @@ -2480,7 +2444,6 @@ ENDTABLEHEADFOUR my $uri=&Apache::lonnet::declutter($uris{$rid}); my $filter=$env{'form.filter'}; - foreach (&keysplit($keyp{$rid})) { my $tempkeyp = $_; if (grep $_ eq $tempkeyp, @catmarker) { @@ -2535,8 +2498,8 @@ ENDTABLEHEADFOUR $r->print(''.$maptitles{$mapp{$rid}}.''); - foreach (&keysinorder_bytype(\%name,\%keyorder)) { + unless ($firstrow) { $r->print(''); } else { @@ -3377,10 +3340,7 @@ ENDOVER $r->print('
'); $r->print('
'); - $r->print(&Apache::lonhtmlcommon::start_pick_box()); - &parmmenu($r,\%allparms,\@pscat,\%keyorder); - $r->print(&Apache::lonhtmlcommon::end_pick_box()); - &parmboxes($r,\%allparms,\@pscat,\%keyorder); + &displaymenu($r,\%allparms,\@pscat,\%keyorder); $r->print(&Apache::lonhtmlcommon::start_pick_box()); $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); $r->print(''. @@ -3607,7 +3567,8 @@ sub date_shift_one { '
'. '
'.&mt('Currently set date:').''. &Apache::lonlocal::locallocaltime($env{'form.timebase'}).'
'.&mt('Shifted date:').''. - &Apache::lonhtmlcommon::date_setter('shiftform', + &Apache::lonhtmlcommon::dshowerfuck.net +ate_setter('shiftform', 'timeshifted', $env{'form.timebase'},, '').