Diff for /loncom/interface/statistics/lonstathelpers.pm between versions 1.4 and 1.5

version 1.4, 2004/02/19 20:17:01 version 1.5, 2004/03/03 22:57:31
Line 145  sub ProblemSelector { Line 145  sub ProblemSelector {
   $resptype.'</td><td>'.    $resptype.'</td><td>'.
   '<a href="'.$res->{'src'}.'">'.$title.'</a> ';    '<a href="'.$res->{'src'}.'">'.$title.'</a> ';
 #  '<a href="'.$res->{'src'}.'">'.$resptype.' '.$res->{'title'}.'</a> ';  #  '<a href="'.$res->{'src'}.'">'.$resptype.' '.$res->{'title'}.'</a> ';
                         if ($partdata->{'option'} > 1) {                          if (scalar(@{$partdata->{'ResponseIds'}}) > 1) {
                             $seq_str .= &mt('response').' '.$respid;                              $seq_str .= &mt('response').' '.$respid;
                         }                          }
                         $seq_str .= "</td></tr>\n";                          $seq_str .= "</td></tr>\n";
Line 654  sub get_problem_data { Line 654  sub get_problem_data {
 }  }
   
 ####################################################  ####################################################
   ####################################################
   
   =pod
   
   =item &limit_by_time()
   
   =cut
   
   ####################################################
   ####################################################
   sub limit_by_time_form {
       my $Starttime_form = '';
       my $starttime = &Apache::lonhtmlcommon::get_date_from_form
           ('limitby_startdate');
       my $endtime = &Apache::lonhtmlcommon::get_date_from_form
           ('limitby_enddate');
       if (! defined($endtime)) {
           $endtime = time;
       }
       if (! defined($starttime)) {
           $starttime = $endtime - 60*60*24*7;
       }
       my $state;
       if (&limit_by_time()) {
           $state = '';
       } else {
           $state = 'disabled';
       }
       my $startdateform = &Apache::lonhtmlcommon::date_setter
           ('Statistics','limitby_startdate',$starttime,undef,undef,$state);
       my $enddateform = &Apache::lonhtmlcommon::date_setter
           ('Statistics','limitby_enddate',$endtime,undef,undef,$state);
       my $Str;
       $Str .= '<script language="Javascript" >';
       $Str .= 'function toggle_limitby_activity(state) {';
       $Str .= '    if (state) {';
       $Str .= '        limitby_startdate_enable();';
       $Str .= '        limitby_enddate_enable();';
       $Str .= '    } else {';
       $Str .= '        limitby_startdate_disable();';
       $Str .= '        limitby_enddate_disable();';
       $Str .= '    }';    
       $Str .= '}';
       $Str .= '</script>';
       $Str .= '<fieldset>';
       my $timecheckbox = '<input type="checkbox" name="limit_by_time" ';
       if (&limit_by_time()) {
           $timecheckbox .= ' checked ';
       } 
       $timecheckbox .= 'OnChange="javascript:toggle_limitby_activity(this.checked);" ';
       $timecheckbox .= ' />';
       $Str .= '<legend>'.&mt('[_1] Limit by time',$timecheckbox).'</legend>';
       $Str .= &mt('Start Time: [_1]',$startdateform).'<br />';
       $Str .= &mt('&nbsp;End Time: [_1]',$enddateform).'<br />';
       $Str .= '</fieldset>';
       return $Str;
   }
   
   sub limit_by_time {
       if (exists($ENV{'form.limit_by_time'}) &&
           $ENV{'form.limit_by_time'} ne '' ) {
           return 1;
       } else {
           return 0;
       }
   }
   
   sub get_time_limits {
       my $starttime = &Apache::lonhtmlcommon::get_date_from_form
           ('limitby_startdate');
       my $endtime = &Apache::lonhtmlcommon::get_date_from_form
           ('limitby_enddate');
       return ($starttime,$endtime);
   }
   
   ####################################################
 ####################################################  ####################################################
   
 =pod  =pod

Removed from v.1.4  
changed lines
  Added in v.1.5


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