--- loncom/interface/lonparmset.pm 2011/01/15 16:21:42 1.509 +++ loncom/interface/lonparmset.pm 2011/05/23 09:29:27 1.513 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.509 2011/01/15 16:21:42 www Exp $ +# $Id: lonparmset.pm,v 1.513 2011/05/23 09:29:27 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() @@ -196,8 +204,8 @@ Input: See list below: Show assessment data and parameters. This is a large routine that should be simplified and shortened... someday. -Inputs: $r - +Inputs: $r - the Apache request object. + Returns: nothing Variables used (guessed by Jeremy): @@ -1165,6 +1173,7 @@ sub extractResourceInformation { $$typep{$id}=$1; $$keyp{$id}=''; $$uris{$id}=$srcf; + foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { next if ($key!~/^parameter_/); @@ -1264,14 +1273,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 +1362,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 +1463,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 +1655,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 { @@ -1988,7 +1943,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); } @@ -1996,6 +1953,9 @@ sub assessparms { my $r=shift; + + +# -------------------------------------------------------- Variable declaration my @ids=(); my %symbp=(); my %mapp=(); @@ -2003,9 +1963,6 @@ sub assessparms { my %keyp=(); my %uris=(); my %maptitles=(); - -# -------------------------------------------------------- Variable declaration - my %allmaps=(); my %alllevs=(); @@ -2024,14 +1981,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=''; @@ -2153,6 +2112,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)$/) { @@ -2288,7 +2249,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)'))); @@ -2300,7 +2261,7 @@ COURSECONTENTSCRIPT # Update Display Button $r->print('

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

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

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

'); } @@ -2481,7 +2442,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) { @@ -2536,8 +2496,8 @@ ENDTABLEHEADFOUR $r->print(''.$maptitles{$mapp{$rid}}.''); - foreach (&keysinorder_bytype(\%name,\%keyorder)) { + unless ($firstrow) { $r->print(''); } else { @@ -3378,10 +3338,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(''. @@ -3608,7 +3565,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'},, '').