Diff for /loncom/interface/lonparmset.pm between versions 1.541 and 1.545

version 1.541, 2013/08/22 11:53:46 version 1.545, 2014/06/12 22:29:42
Line 46  This module sets coursewide and assessme Line 46  This module sets coursewide and assessme
   
 =over  =over
   
 =pod  
   
 =item parmval()  =item parmval()
   
 Figure out a cascading parameter.  Figure out a cascading parameter.
Line 139  javascript function 'pjump'. Line 137  javascript function 'pjump'.
   
  extractResourceInformation extracts lots of information about all of the 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:  Input: See list below
   
   =over 4
   
 =item * B<env{'user.name'}> : Current username  =item * B<env{'user.name'}> : Current username
   
 =item * B<env{'user.domain'}> : Domain of current user.  =item * B<env{'user.domain'}> : Domain of current user.
   
 =item * b<env{"request.course.fn"} : Course  =item * B<env{"request.course.fn"}> : Course
   
   =back
   
 Outputs: See list below:  Outputs: See list below:
   
   =over 4
   
 =item * B<ids> (out) : An array that will contain all of the ids in the course.  =item * B<ids> (out) : An array that will contain all of the ids in the course.
   
 =item * B<typep>(out) : hash, id->type, where "type" contains the extension of the file, thus, I<problem exam quiz assess survey form>.  =item * B<typep>(out) : hash, id->type, where "type" contains the extension of the file, thus, I<problem exam quiz assess survey form>.
Line 173  Outputs: See list below: Line 177  Outputs: See list below:
   
 =item * B<defkeytype>  =item * B<defkeytype>
   
   =back
   
 =item isdateparm()  =item isdateparm()
   
 =item parmmenu()  =item parmmenu()
Line 210  Returns: nothing Line 216  Returns: nothing
   
 Variables used (guessed by Jeremy):  Variables used (guessed by Jeremy):
   
   =over
   
 =item * B<pscat>: 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<pscat>: 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<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts?  =item * B<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts?
Line 222  Variables used (guessed by Jeremy): Line 230  Variables used (guessed by Jeremy):
         When storing information, store as part 0          When storing information, store as part 0
         When requesting information, request from full part          When requesting information, request from full part
   
   =back
   
 =item tablestart()  =item tablestart()
   
 =item tableend()  =item tableend()
Line 288  Set portfolio metadata Line 298  Set portfolio metadata
   
 Main handler.  Calls &assessparms subroutine.  Main handler.  Calls &assessparms subroutine.
   
   
 =back  =back
   
 =cut  =cut
Line 1401  sub lookUpTableParameter { Line 1410  sub lookUpTableParameter {
         'contentopen' => 'time_settings',          'contentopen' => 'time_settings',
         'contentclose' => 'time_settings',          'contentclose' => 'time_settings',
         'discussend' => 'time_settings',          'discussend' => 'time_settings',
  'printopendate' => 'time_settings',   'printstartdate' => 'time_settings',
  'printclosedate' => 'time_settings',   'printenddate' => 'time_settings',
         'weight' => 'grading',          'weight' => 'grading',
         'handgrade' => 'grading',          'handgrade' => 'grading',
         'maxtries' => 'tries',          'maxtries' => 'tries',
Line 1984  sub standardkeyorder { Line 1993  sub standardkeyorder {
         'parameter_0_discussend' => 19,          'parameter_0_discussend' => 19,
         'parameter_0_discusshide' => 20,          'parameter_0_discusshide' => 20,
         'parameter_0_discussvote' => 21,          'parameter_0_discussvote' => 21,
  'parameter_0_printopendate'  =>  22,   'parameter_0_printstartdate'  =>  22,
  'parameter_0_printclosedate' =>  23);   'parameter_0_printenddate' =>  23);
 }  }
   
   
Line 2196  sub assessparms { Line 2205  sub assessparms {
                 $name = $1;                  $name = $1;
                 my $val = $values[$i];                  my $val = $values[$i];
                 if ($name eq 'examcode') {                  if ($name eq 'examcode') {
                    if (&Apache::lonnet::validCODE($values[$i])) {                      if (&Apache::lonnet::validCODE($values[$i])) {
                        $val = 'valid';                              $val = 'valid';
                    }                      }
                 }                  }
                 $needsrelease =                  $needsrelease =
                     $Apache::lonnet::needsrelease{"parameter:$name:$val"};                      $Apache::lonnet::needsrelease{"parameter:$name:$val"};
Line 2209  sub assessparms { Line 2218  sub assessparms {
                     }                      }
                     $needsnewer = &parameter_releasecheck($name,$val,                      $needsnewer = &parameter_releasecheck($name,$val,
                                                           $needsrelease,                                                            $needsrelease,
                                                           $chostname,  
                                                           $cmajor,$cminor);                                                            $cmajor,$cminor);
                 }                  }
             }              }
Line 2866  sub storedata { Line 2874  sub storedata {
                     }                      }
                     $needsnewer = &parameter_releasecheck($name,$data,                      $needsnewer = &parameter_releasecheck($name,$data,
                                                           $needsrelease,                                                            $needsrelease,
                                                           $chostname,$cmajor,                                                            $cmajor,$cminor);
                                                           $cminor);  
                 }                  }
                 if ($needsnewer) {                  if ($needsnewer) {
                     $r->print('<br />'.&oldversion_warning($name,$data,                      $r->print('<br />'.&oldversion_warning($name,$data,
Line 3221  sub string_selector { Line 3228  sub string_selector {
                     $got_chostname = 1;                      $got_chostname = 1;
                 }                  }
                 my $needsnewer=&parameter_releasecheck($name,$parmval,$needsrelease,                  my $needsnewer=&parameter_releasecheck($name,$parmval,$needsrelease,
                                                        $chostname,$cmajor,                                                         $cmajor,$cminor);
                                                        $cminor);  
                 if ($needsnewer) {                  if ($needsnewer) {
                     $skiptype{$parmval} = 1;                      $skiptype{$parmval} = 1;
                 }                  }
Line 3669  sub date_shift_two { Line 3675  sub date_shift_two {
     $r->print($start_page.$breadcrumbs);      $r->print($start_page.$breadcrumbs);
     &startSettingsScreen($r,'parmset',$crstype);      &startSettingsScreen($r,'parmset',$crstype);
     my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted');      my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted');
     $r->print(&mt('Shifting all dates such that [_1] becomes [_2]',      $r->print('<h2>'.&mt('Shift Dates').'</h2>'.
                 '<p>'.&mt('Shifting all dates such that [_1] becomes [_2]',
               &Apache::lonlocal::locallocaltime($env{'form.timebase'}),                &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
               &Apache::lonlocal::locallocaltime($timeshifted)));                &Apache::lonlocal::locallocaltime($timeshifted)).'</p>');
     my $delta=$timeshifted-$env{'form.timebase'};      my $delta=$timeshifted-$env{'form.timebase'};
     &dateshift($delta);      &dateshift($delta);
       $r->print(
           &Apache::lonhtmlcommon::confirm_success(&mt('Done')).
           '<br /><br />'.
           &Apache::lonhtmlcommon::actionbox(
               ['<a href="/adm/parmset">'.&mt('Content and Problem Settings').'</a>']));
     &endSettingsScreen($r);      &endSettingsScreen($r);
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
 }  }
Line 4684  sub parameter_release_vars { Line 4696  sub parameter_release_vars {
 }  }
   
 sub parameter_releasecheck {  sub parameter_releasecheck {
     my ($name,$value,$needsrelease,$chostname,$cmajor,$cminor) = @_;      my ($name,$value,$needsrelease,$cmajor,$cminor) = @_;
     my $needsnewer;      my $needsnewer;
     my ($needsmajor,$needsminor) = split(/\./,$needsrelease);      my ($needsmajor,$needsminor) = split(/\./,$needsrelease);
     if (($cmajor < $needsmajor) ||       if (($cmajor < $needsmajor) || 

Removed from v.1.541  
changed lines
  Added in v.1.545


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>