Diff for /loncom/interface/lonstatistics.pm between versions 1.17 and 1.18

version 1.17, 2002/05/13 16:41:46 version 1.18, 2002/05/14 23:17:06
Line 30 Line 30
 # 5/5,7/9,7/25/1,8/11,9/13,9/26,10/5,10/9,10/22,10/26 Behrouz Minaei  # 5/5,7/9,7/25/1,8/11,9/13,9/26,10/5,10/9,10/22,10/26 Behrouz Minaei
 # 11/1,11/4,11/16,12/14,12/16,12/18,12/20,12/31 Behrouz Minaei  # 11/1,11/4,11/16,12/14,12/16,12/18,12/20,12/31 Behrouz Minaei
 # YEAR=2002  # YEAR=2002
 # 1/22,2/1,2/6,2/25,3/2,3/6,3/17,3/21,3/22,3/26,4/7,5/6,5/12 Behrouz Minaei  # 1/22,2/1,2/6,2/25,3/2,3/6,3/17,3/21,3/22,3/26,4/7,5/6 Behrouz Minaei
   # 5/12, 5/14 Behrouz Minaei
 #  #
 ###  ###
   
Line 83  my %ConceptData; Line 84  my %ConceptData;
 my %Header = (0,"Homework Sets Order",1,"#Stdnts",2,"Tries",3,"Mod",  my %Header = (0,"Homework Sets Order",1,"#Stdnts",2,"Tries",3,"Mod",
               4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"DoDiff",                4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"DoDiff",
               9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd");                9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd");
 my @shown;  my %Answer = ();
   
 sub InitAnalysis {  sub InitAnalysis {
     my ($rid, $student)=@_;      my ($rid, $student)=@_;
Line 100  sub InitAnalysis { Line 101  sub InitAnalysis {
 #    my $Answ=&Apache::lonnet::ssi($URI,('grade_target' => 'analyze'));  #    my $Answ=&Apache::lonnet::ssi($URI,('grade_target' => 'analyze'));
   
     (my $garbage,$Answ)=split(/_HASH_REF__/,$Answ,2);      (my $garbage,$Answ)=split(/_HASH_REF__/,$Answ,2);
     my %Answer=();      %Answer=();
     %Answer=&Apache::lonnet::str2hash($Answ);      %Answer=&Apache::lonnet::str2hash($Answ);
   
     my $parts='';      my $parts='';
Line 115  sub InitAnalysis { Line 116  sub InitAnalysis {
     chop($conc);      chop($conc);
   
     @Concepts=split(/\@/,$conc);      @Concepts=split(/\@/,$conc);
     my $show='';  
     foreach my $elm (@{$Answer{"$parts.shown"}}) {  
  $show.="$elm@";  
     }  
     chop($show);  
     @shown=split(/\@/,$show);  
 #    $r->print("<br> shown:".$show);#    $r->rflush();  
     foreach my $concept (@{$Answer{"$parts.concepts"}}) {      foreach my $concept (@{$Answer{"$parts.concepts"}}) {
  foreach my $foil (@{$Answer{"$parts.concept.$concept"}}) {   foreach my $foil (@{$Answer{"$parts.concept.$concept"}}) {
     $foil_to_concept{$foil} = $concept;      $foil_to_concept{$foil} = $concept;
     $ConceptData{$foil} = $Answer{"$parts.foil.value.$foil"};  
  }   }
     }      }
     return $symb;      return $symb;
Line 138  sub Interval { Line 131  sub Interval {
     my $due = &Apache::lonnet::EXT('resource.$part.duedate',$symb)+1;      my $due = &Apache::lonnet::EXT('resource.$part.duedate',$symb)+1;
     my $opn = &Apache::lonnet::EXT('resource.$part.opendate',$symb);      my $opn = &Apache::lonnet::EXT('resource.$part.opendate',$symb);
     my $add=int(($due-$opn)/$Int);      my $add=int(($due-$opn)/$Int);
 #$r->print("<br> $opn, to $due add=$add  int=$Int");#$r->rflush();  
     $ConceptData{"Int.0"}=$opn;      $ConceptData{"Int.0"}=$opn;
     for (my $i=1;$i<$Int;$i++) {      for (my $i=1;$i<$Int;$i++) {
  $ConceptData{"Int.$i"}=$opn+$i*$add;   $ConceptData{"Int.$i"}=$opn+$i*$add;
Line 155  sub Interval { Line 147  sub Interval {
   
   
 sub ShowOpGraph {  sub ShowOpGraph {
   
     my ($InpStr, $Int_No)=@_;      my ($InpStr, $Int_No)=@_;
   
     $r->print(<<ENDPOP);  
     <script language="JavaScript">  
   
     function display(name) {  
  document.forms.displayform.elements.dis.value=name;  
  window.status=name;  
     }  
     function cleardisplay() {  
  document.forms.displayform.elements.dis.value='';  
  window.status='No Concept in particular';  
     }  
   
     </script>  
 ENDPOP  
   
     my ($rid,$part)=split(/\:/,substr($InpStr,8));      my ($rid,$part)=split(/\:/,substr($InpStr,8));
     $ConceptData{"Interval"}=$Int_No;      $ConceptData{"Interval"}=$Int_No;
     my $symb=&InitAnalysis($rid,$students[0]);      my $symb=&InitAnalysis($rid,$students[0]);
Line 181  ENDPOP Line 156  ENDPOP
     my $Src = $hash{'title_'.$rid};      my $Src = $hash{'title_'.$rid};
     $Src =~ s/\ /"_"/eg;      $Src =~ s/\ /"_"/eg;
     $r->print('<br><b>'.$URI.'</b>');      $r->print('<br><b>'.$URI.'</b>');
     for (my $n=1; $n<=$#Concepts+1; $n++ ) {  
  my $tmp=$Concepts[$n-1];  
  $tmp =~ s/</" less than "/eg;  
  $r->print("<br><b>Concept $n</b>:$tmp");  
     }  
     $r->rflush();      $r->rflush();
           
     &Create_PrgWin();      &Create_PrgWin();
Line 197  ENDPOP Line 167  ENDPOP
     &Close_PrgWin();      &Close_PrgWin();
   
     for (my $k=0; $k<$Int_No; $k++ ) {      for (my $k=0; $k<$Int_No; $k++ ) {
   my $data1='';    &DrawGraph($k,$Src);
  my $data2='';  
  &DrawGraph(&AdjustData($k).'+'.$Src.'+'.($k+1));  
     }      }
 #$Apache::lonxml::debug=1;  #$Apache::lonxml::debug=1;
 #&Apache::lonhomework::showhash(%ConceptData);  #&Apache::lonhomework::showhash(%ConceptData);
Line 208  ENDPOP Line 176  ENDPOP
     $r->print("<br><b>Here you can see the Problem:</b><br>$Answ");      $r->print("<br><b>Here you can see the Problem:</b><br>$Answ");
 }  }
   
 sub AdjustData {  
     my $k=shift;  sub DrawGraph {
       my ($k,$Src)=@_;
     my $Max=0;      my $Max=0;
     my @data1;      my @data1;
     my @data2;      my @data2;
       my $Correct=0;
       my $Wrong=0;
       # Adjust Data and find the Max 
     for (my $n=0; $n<=$#Concepts; $n++ ) {      for (my $n=0; $n<=$#Concepts; $n++ ) {
  my $tmp=$Concepts[$n];   my $tmp=$Concepts[$n];
  $data1[$n]=$ConceptData{"$tmp.$k.true"};   $data1[$n]=$ConceptData{"$tmp.$k.true"};
    $Correct+=$data1[$n];
  $data2[$n]=$ConceptData{"$tmp.$k.false"};   $data2[$n]=$ConceptData{"$tmp.$k.false"};
    $Wrong+=$data2[$n];
  my $Sum=$data1[$n]+$data2[$n];   my $Sum=$data1[$n]+$data2[$n];
  if ( $Max<$Sum ) {$Max=$Sum;}   if ( $Max<$Sum ) {$Max=$Sum;}
  $ConceptData{"$tmp.true"}+=$data1[$n];  
  $ConceptData{"$tmp.false"}+=$data2[$n];  
     }      }
     for (my $n=0; $n<=$#Concepts; $n++ ) {      for (my $n=0; $n<=$#Concepts; $n++ ) {
  if ($data1[$n]+$data2[$n]<$Max) {   if ($data1[$n]+$data2[$n]<$Max) {
     $data2[$n]+=$Max-($data1[$n]+$data2[$n]);      $data2[$n]+=$Max-($data1[$n]+$data2[$n]);
  }   }
     }      }
     return join(',',@data1).'+'.      my $P_No = $#data1+1;
            join(',',@data2).'+'.  #    $r->print('<br><b>From: ['.localtime($ConceptData{'Int.'.($k-1)}).
            $Max.'+'.($#data1+1);  #              '] To: ['.localtime($ConceptData{"Int.$k"}).']</b>'); 
 }      my $Str = "\n".'<table border=2>'.
                 "\n".'<tr>'.
                 "\n".'<th> # </th>'.
         "\n".'<th> Concept </th>'.
         "\n".'<th> Correct </th>'.
         "\n".'<th> Wrong </th>'.
         "\n".'</tr>';
   
       for (my $n=0; $n<=$#Concepts; $n++ ) {
    $Str .= "\n"."<tr>".
           "\n"."<td>".($n+1)."</td>".
                   "\n"."<td bgcolor=#FFFFDD> ".$Concepts[$n]." </td>".
                   "\n"."<td bgcolor=#DDFFDD> ".$data1[$n]." </td>".
                   "\n"."<td bgcolor=#FFDDDD> ".$data2[$n]." </td>".
                   "\n"."</tr>";
       }
       $Str.='<td></td><td><b>From:['.localtime($ConceptData{'Int.'.($k-1)}).
             '] To: ['.localtime($ConceptData{"Int.$k"}).
             "]</b></td><td>$Correct</td><td>$Wrong</td>";
   
 sub DrawGraph {      $Str .= "\n".'</table>';
     my $data=shift;  
     my($data1,$data2,$Max,$P_No,$Src,$k)=split(/\+/,$data);  
   
     my $Str="\n".'<table border=1>'.  
             "\n".'<tr>'.  
     "\n".'<th> Correct Answers </th>'.  
     "\n".'<th> Wrong Answers </th>'.  
     "\n".'<th> From </th>'.  
     "\n".'<th> To </th>'.  
     "\n".'</tr>'.  
     "\n"."<tr>".  
     "\n"."<td> $data1 </td>".  
             "\n"."<td> $data2 </td>".  
             "\n"."<td> ".localtime($ConceptData{'Int.'.($k-1)})." </td>".  
             "\n"."<td> ".localtime($ConceptData{'Int.'.$k}-1)." </td>".  
             "\n"."</tr></table>";  
     $r->print($Str);      $r->print($Str);
 #    $r->print('<br><b>Correct Answers:</b> '.$data1.  
 #              '<br><b>Wrong Answers: </b>'.$data2);       if ( $Max > 1 ) { 
 #    $r->print('<br><b>From: </b>'.localtime($ConceptData{'Int.'.($k-1)}).   $Max += (10 - $Max % 10);
 #              '<br><b>To: </b>'.localtime($ConceptData{"Int.$k"}));    $Max = int($Max);
       } else { $Max = 1; }
 #   if ( $Max > 1 ) {   
 # $Max += (10 - $Max % 10);      if ( $Max > 1 ) { 
 # $Max = int($Max);   $Max += (10 - $Max % 10);
 #   }   $Max = int($Max);
 #   else { $Max = 1; }      } else { $Max = 1; }
     my $Titr=($ConceptData{'Interval'}>1) ? $Src.'_interval_'.$k : $Src;      my $Titr=($ConceptData{'Interval'}>1) ? $Src.'_interval_'.$k : $Src;
     $GData=$Titr.'&'.'Concepts'.'&'.'Answers'.'&'.$Max.'&'.$P_No.'&'.$data1.'&'.$data2;  #    $GData=$Titr.'&Concepts'.'&'.'Answers'.'&'.$Max.'&'.$P_No.'&'.$data1.'&'.$data2;
     if($ConceptData{'Interval'}>1){      $GData="$Titr&Concepts&Answers&$Max&$P_No&".
  $r->print('<br><IMG src="/cgi-bin/graph.gif?'.$GData.'" />');             (join(',',@data1)).'&'.(join(',',@data2));
  return;  
     }      $r->print('<br><IMG src="/cgi-bin/graph.gif?'.$GData.'" />');
     $r->print('<br>Move your mouse over a bar to find out the concept');   
     my $ptr='';  
     $ptr.="\n".'<form method="post" action="" name="displayform"> <input type=text name="dis" size=80> </form>';  
     $ptr.="\n".'<p><img src=/cgi-bin/graph.gif?'.$GData.  
           ' usemap="#Map" border=1>'.  
           "\n".'<map name="Map">';  
     my $gap=12;  
     my $Size=340;  
     my $barsize=($P_No) ? int($Size/$P_No) : 1;  
     for (my $i=0; $i<$P_No; $i++) {  
  my $x1=80+$gap*$i+($i*$barsize);  
  my $x2=$x1+$barsize;  
  my $y1=25;  
  my $y2=350;  
  my $j=$i+1;  
  $ptr.="\n".'<area shape="rect" coords='.$x1.','.$y1.','.$x2.','.$y2.' onMouseOver="display('."'Concept $j: $Concepts[$i]'".'); " href="javascript:alert('."'Concept $j: $Concepts[$i]'".');">';  
     }   
     $ptr.="\n".'<area shape="default" onMouseOver="cleardisplay(); " href="javascript:alert('.'No Concept  in particular'.');">';  
     $ptr.="\n".'</map></p>';  
     $r->print('<br>'.$ptr.'<br>');  
 }  }
   
   
Line 354  sub OpStatus { Line 308  sub OpStatus {
     my @True = ();      my @True = ();
     my @False = ();      my @False = ();
     my $flag=0;      my $flag=0;
     @shown=();  
     if ($reshash{'version'}) {      if ($reshash{'version'}) {
           my $tries=0;
    &Apache::lonhomework::showhash(%Answer);
  for (my $version=1;$version<=$reshash{'version'};$version++) {   for (my $version=1;$version<=$reshash{'version'};$version++) {
     my $time=$reshash{"$version:timestamp"};      my $time=$reshash{"$version:timestamp"};
     foreach (sort(split(/\:/,$reshash{$version.':keys'}))) {     
  if (($_=~/\.(\w+)\.(\w+)\.submission$/)) {      foreach my $key (sort(split(/\:/,$reshash{$version.':keys'}))) {
     #my $Id1=$1; my $Id2=$2;   if (($key=~/\.(\w+)\.(\w+)\.submission$/)) {
     my $Resp = $reshash{$_};      my $Id1 = $1; my $Id2 = $2;
       #check if this is a repeat submission, if so skip it
                if ($reshash{"$version:resource.$Id1.previous"}) { next; }
       #if no solved this wasn't a real submission, ignore it
       if (!defined($reshash{"$version:resource.$Id1.solved"})) {
    &Apache::lonxml::debug("skipping ");
    next;
       }
       my $Resp = $reshash{"$version:$key"};
     my %submission=&Apache::lonnet::str2hash($Resp);      my %submission=&Apache::lonnet::str2hash($Resp);
     foreach (keys %submission) {      foreach (keys %submission) {
  my $Ansr = $ConceptData{"$_"};   my $Ansr = $Answer{"$Id1.$Id2.foil.value.$_"};
  #my $Ansr = $Answer{"$Id1.$Id2.foil.value.$_"};  
  #$r->print("<br>shown: ".join(',',@shown)." size=$#shown");       
  if ($submission{$_}) {   if ($submission{$_}) {
     #if($#shown==-1){  
  #my @str=split(/\&/,$Resp);  
  #my $garb;  
  #for(my $j=0;$j<=$#str;$j++){  
  #    ($shown[$j],$garb)=split(/\=/,$str[$j]);  
  #}  
  ##$r->print("<br>shown: ".join(',',@shown)." size=$#shown");       
     #}  
     if ($submission{$_} eq $Ansr) {      if ($submission{$_} eq $Ansr) {
  &Decide("true",$_,$time );   &Decide("true",$_,$time );
     }      }
     else {&Decide("false",$_,$time );}      else {&Decide("false",$_,$time );}
  }   }
  #else {  
  #    if ($#shown==-1 && $flag==0) {  
  # $flag++;  
  # &InitAnalysis($rid,$student);  
  #    }  
  #    my @erl=split(/\:/,$_);  
  #    for (my $i=0;$i<=$#shown; $i++){  
  # my $Ans=$Answer{"$Id1.$Id2.foil.value.$shown[$i]"};  
  # if ($erl[$i] eq $Ans) {  
  #    &Decide("true",$shown[$i],$time);  
  # }  
  # else {&Decide("false",$shown[$i],$time);}  
  #    }  
  #}  
     }      }
         }            }  
     }      }
Line 598  sub StudentReport { Line 537  sub StudentReport {
 }  }
   
 sub CreateTable {  sub CreateTable {
       my ($Hd, $Hid)=@_;
       if ($ENV{'form.showcsv'}) {
    if ( $Hd == 1 ) {
       $r->print('<br>"'.$hash{'title_'.$Hid}.'","'.$hash{'src_'.$Hid}.'"');
    }
    return;
       }
     my $ColNo=0;      my $ColNo=0;
     foreach (keys(%Header)){       foreach (keys(%Header)){ 
  $ColNo++;   $ColNo++;
     }       } 
     my ($Hd, $Hid)=@_;  
     if ( $Hd == 1 ) {      if ( $Hd == 1 ) {
  $r->print('<br><a href="'.$hash{'src_'.$Hid}.   $r->print('<br><a href="'.$hash{'src_'.$Hid}.
                   '" target="_blank">'.$hash{'title_'.$Hid}.'</a>');                    '" target="_blank">'.$hash{'title_'.$Hid}.'</a>');
Line 619  sub CreateTable { Line 564  sub CreateTable {
 }  }
   
 sub CloseTable {  sub CloseTable {
       if ($ENV{'form.showcsv'}) {
    return;
       }    
     $r->print("\n".'</table>'."\n");      $r->print("\n".'</table>'."\n");
     $r->rflush();      $r->rflush();
 }  }
Line 657  sub PreStatTable { Line 605  sub PreStatTable {
     $Ptr .= '<pre>'.      $Ptr .= '<pre>'.
     '<b>  #Stdnts</b>: Total Number of Students opened the problem.<br>'.       '<b>  #Stdnts</b>: Total Number of Students opened the problem.<br>'. 
     '<b>  Tries  </b>: Total Number of Tries for solving the problem.<br>'.       '<b>  Tries  </b>: Total Number of Tries for solving the problem.<br>'. 
     '<b>  Mod   </b> : Maximunm Number of Tries for solving the problem.<br>'.       '<b>  Max   </b> : Maximunm Number of Tries for solving the problem.<br>'. 
     '<b>  Mean   </b>: Average Number of the tries. [ Tries / #Stdnts ]<br>'.      '<b>  Avg.   </b>: Average Number of the tries. [ Tries / #Stdnts ]<br>'.
     '<b>  #YES   </b>: Number of students solved the problem correctly.<br>'.       '<b>  #YES   </b>: Number of students solved the problem correctly.<br>'. 
     '<b>  #yes   </b>: Number of students solved the problem by override.<br>'.      '<b>  #yes   </b>: Number of students solved the problem by override.<br>'.
     '<b>  %Wrng  </b>: Percentage of students tried to solve the problem but'.      '<b>  %Wrng  </b>: Percentage of students tried to solve the problem but'.
Line 666  sub PreStatTable { Line 614  sub PreStatTable {
 #    '  DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]<br>'. Kashy formula  #    '  DoDiff : Degree of Difficulty of the problem. [ Tries/(#YES+#yes+0.1) ]<br>'. Kashy formula
     '<b>  DoDiff </b>: Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]<br>'. #Gerd formula      '<b>  DoDiff </b>: Degree of Difficulty of the problem. [ 1 - ((#YES+#yes) / Tries) ]<br>'. #Gerd formula
     '<b>  S.D.  </b> : Standard Deviation of the tries.'.      '<b>  S.D.  </b> : Standard Deviation of the tries.'.
     '[ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)'.      '[ sqrt(sum((Xi - Avg.)^2)) / (#Stdnts-1)'.
     ' where Xi denotes every student\'s tries ]<br>'.      ' where Xi denotes every student\'s tries ]<br>'.
     '<b>  Skew.  </b>: Skewness of the students tries.'.      '<b>  Skew.  </b>: Skewness of the students tries.'.
  ' [ (sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3) ]<br>'.   ' [ (sqrt( sum((Xi - Avg.)^3) / #Stdnts)) / (S.D.^3) ]<br>'.
     '<b>  Dis.F. </b>: Discrimination Factor: A Standard for '.      '<b>  Dis.F. </b>: Discrimination Factor: A Standard for '.
  'evaluating the problem according to a Criterion<br>'.   'evaluating the problem according to a Criterion<br>'.
  '<b>           [Applied Criterion in %27 Upper Students - '.   '<b>           [Applied Criterion in %27 Upper Students - '.
Line 681  sub PreStatTable { Line 629  sub PreStatTable {
             '</pre>';              '</pre>';
   
     $r->print($Ptr);      $r->print($Ptr);
       
       $r->print('Output CSV format: <input type=checkbox name=showcsv onClick="submit()"');
       if ($ENV{'form.showcsv'}) { $r->print(' checked'); }
       $r->print('>');
   
     $r->rflush();      $r->rflush();
   
     if ((-e "$CacheDB")&&($ENV{'form.sort'} ne 'Recalculate Statistics')) {      if ((-e "$CacheDB")&&($ENV{'form.sort'} ne 'Recalculate Statistics')) {
Line 1230  sub TableRow { Line 1183  sub TableRow {
     my ($Str,$Idx,$RealIdx)=@_;      my ($Str,$Idx,$RealIdx)=@_;
     my($PrOrd,$Temp,$StdNo,$TotalTries,$MxTries,$Avg,$YES,$Override,      my($PrOrd,$Temp,$StdNo,$TotalTries,$MxTries,$Avg,$YES,$Override,
        $Wrng,$DoD,$SD,$Sk,$_D1,$_D2,$Prob)=split(/\&/,$Str);         $Wrng,$DoD,$SD,$Sk,$_D1,$_D2,$Prob)=split(/\&/,$Str);
     my $Ptr =  "\n".'<tr>'.      if ($ENV{'form.showcsv'}) {
           my ($ResId,$Dummy)=split(/\*/,$Prob);
           my $Ptr =  "\n".'<br>'.
                  "\n".'"'.($RealIdx+1).'",'.
                  "\n".'"'.$hash{'title_'.$ResId}.$Dummy.'",'.
                  "\n".'"'.$hash{'src_'.$ResId}.'",'.
                  "\n".'"'.$StdNo.'",'.
                  "\n".'"'.$TotalTries.'",'.
                  "\n".'"'.$MxTries.'",'.
                  "\n".'"'.$Avg.'",'.
                  "\n".'"'.$YES.'",'.
                  "\n".'"'.$Override.'",'.
                  "\n".'"'.$Wrng.'",'.
                  "\n".'"'.$DoD.'",'.
                  "\n".'"'.$SD.'",'.
                  "\n".'"'.$Sk.'",'.
                  "\n".'"'.$_D1.'",'.
          "\n".'"'.$_D2.'"';
           $r->print("\n".$Ptr);
       }
       else{
           my $Ptr =  "\n".'<tr>'.
                "\n".'<td>'.($RealIdx+1).'</td>'.                 "\n".'<td>'.($RealIdx+1).'</td>'.
           #     "\n".'<td>'.$PrOrd.$Temp.'</td>'.            #     "\n".'<td>'.$PrOrd.$Temp.'</td>'.
                "\n".'<td>'.$Temp.'</td>'.                 "\n".'<td>'.$Temp.'</td>'.
Line 1246  sub TableRow { Line 1220  sub TableRow {
                "\n".'<td bgcolor="#DDFFDD"> '.$Sk.'</td>'.                 "\n".'<td bgcolor="#DDFFDD"> '.$Sk.'</td>'.
                "\n".'<td bgcolor="#FFDDFF"> '.$_D1.'</td>'.                 "\n".'<td bgcolor="#FFDDFF"> '.$_D1.'</td>'.
        "\n".'<td bgcolor="#FFDDFF"> '.$_D2.'</td>';         "\n".'<td bgcolor="#FFDDFF"> '.$_D2.'</td>';
     $r->print("\n".$Ptr.'</tr>' );          $r->print("\n".$Ptr.'</tr>' );
       }
     $GraphDat{$RealIdx}=$DoD.':'.$Wrng;      $GraphDat{$RealIdx}=$DoD.':'.$Wrng;
 }  }
   
Line 1332  sub ClassList { Line 1307  sub ClassList {
     $firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}};      $firstres=$hash{'map_start_/res/'.$ENV{'request.course.uri'}};
     $lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}};      $lastres=$hash{'map_finish_/res/'.$ENV{'request.course.uri'}};
     if (($firstres) && ($lastres)) {      if (($firstres) && ($lastres)) {
 # ----------------------------------------------------------------- Render page   #my %result = &Apache::lonnet::dump('classlist',$sdom,$sname);
  my $classlst=&Apache::lonnet::reply   my $classlst=&Apache::lonnet::reply('dump:'.$cdom.':'.$cnum.':classlist',$chome);
                  ('dump:'.$cdom.':'.$cnum.':classlist',$chome);  
  my $StudNo = 0;   my $StudNo = 0;
  my $now=time;   my $now=time;
  unless ($classlst=~/^error\:/) {   unless ($classlst=~/^error\:/) {
Line 1350  sub ClassList { Line 1324  sub ClassList {
                      ( ($Status eq 'Active') ) ) { $active=0; }                       ( ($Status eq 'Active') ) ) { $active=0; }
  if ( ($Status eq 'Expired') &&    if ( ($Status eq 'Expired') && 
                      ($end == 0 || $now < $end) ) { $active=0; }                       ($end == 0 || $now < $end) ) { $active=0; }
 #//new  
 # $Status = 'Any';  
 #end new  
  if ($active) {   if ($active) {
     my $thisindex=$#students+1;      my $thisindex=$#students+1;
     $name=&Apache::lonnet::unescape($name);      $name=&Apache::lonnet::unescape($name);
Line 1419  sub Title { Line 1390  sub Title {
 sub CreateForm {  sub CreateForm {
     $r->print("\n".'<form name=stat method=post action="/adm/statistics" >');      $r->print("\n".'<form name=stat method=post action="/adm/statistics" >');
     my $content = $ENV{'form.sort'};      my $content = $ENV{'form.sort'};
     if ($content eq '' || $content eq 'Return to Menu') {      if (!($ENV{'form.showcsv'}) && ($content eq '' || $content eq 'Return to Menu')) {
  my $Ptr = '<h3>';   my $Ptr = '<h3>';
  $Ptr .= '<input type=submit name=sort value="Problem Stats"/>';   $Ptr .= '<input type=submit name=sort value="Problem Stats"/>';
  $Ptr .= '<br><br>';   $Ptr .= '<br><br>';
Line 1449  sub CreateForm { Line 1420  sub CreateForm {
   
 sub Menu {  sub Menu {
     &initial();      &initial();
       #$Apache::lonxml::debug=1;
       #&Apache::lonhomework::showhash(%ENV);
       #$Apache::lonxml::debug=0;
     &Title();      &Title();
     &ClassList();      &ClassList();
     my $InpStr = $ENV{'form.sort'};      my $InpStr = $ENV{'form.sort'};
Line 1523  sub GetStatus { Line 1497  sub GetStatus {
   
 sub MapSecOptions {  sub MapSecOptions {
 # ----------------------------------- Loading the Maps Combobox  # ----------------------------------- Loading the Maps Combobox
     my $Ptr = '<br>';      my $Ptr = '';
     $Ptr .= '<br><input type="submit" name="sort" value="Return to Menu" />';      $Ptr .= '<input type="submit" name="sort" value="Return to Menu" />';
     $Ptr .= '<br><b> Select &nbsp; Map &nbsp; &nbsp; </b>'."\n".      $Ptr .= '<br><b> Select &nbsp; Map &nbsp; &nbsp; </b>'."\n".
            '<select name="maps">'."\n".              '<select name="maps">'."\n". 
     '<option '.$OpSel3.'>All Maps</option>';                                   '<option '.$OpSel3.'>All Maps</option>';                             

Removed from v.1.17  
changed lines
  Added in v.1.18


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