[LON-CAPA-cvs] cvs: loncom /interface/statistics lonproblemstatistics.pm

minaeibi lon-capa-cvs@mail.lon-capa.org
Tue, 30 Jul 2002 23:08:56 -0000


minaeibi		Tue Jul 30 19:08:56 2002 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemstatistics.pm 
  Log:
  Fixed a bug in making a link to a problem resource in statististics table.
  
  
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.7 loncom/interface/statistics/lonproblemstatistics.pm:1.8
--- loncom/interface/statistics/lonproblemstatistics.pm:1.7	Tue Jul 30 18:09:01 2002
+++ loncom/interface/statistics/lonproblemstatistics.pm	Tue Jul 30 19:08:56 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonproblemstatistics.pm,v 1.7 2002/07/30 22:09:01 minaeibi Exp $
+# $Id: lonproblemstatistics.pm,v 1.8 2002/07/30 23:08:56 minaeibi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -427,7 +427,11 @@
 	    $Temp = '<a href="'.$cache->{$ResId.':source'}.
                 '" target="_blank">'.$cache->{$ResId.':title'}.$Dummy.'</a>';
 
-	    my $res = &Apache::lonnet::declutter($cache->{'src_'.$ResId});
+	    #$r->print('<br>rid='.$ResId);
+	    #$r->print('<br>src='.$cache->{$ResId.':source'});
+	    #$r->print('<br>tit='.$cache->{$ResId.':title'});
+
+	    my $res = &Apache::lonnet::declutter($cache->{$ResId.':source'});
 	    my $urlres=$res;
 
 	    $ResId=~/(\d+)\.(\d+)/;
@@ -579,46 +583,46 @@
     my($PrOrd,$Temp,$StdNo,$TotalTries,$MxTries,$Avg,$YES,$Override,
        $Wrng,$DoD,$SD,$Sk,$_D1,$_D2,$DiscNo,$Prob)=split(/\&/,$Str);	
 #    $r->print('<br>'.$Str);
+    my $Ptr;
     if ($ENV{'form.showcsv'}) {
         my ($ResId,$Dummy)=split(/\*/,$Prob);
-        my $Ptr =  "\n".'<br>'.
-               "\n".'"'.($RealIdx+1).'",'.
-               "\n".'"'.$cache->{'title_'.$ResId}.$Dummy.'",'.
-               "\n".'"'.$cache->{'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.'"'.
-	       "\n".'"'.$DiscNo.'"';
+        $Ptr="\n".'<br>'.
+             "\n".'"'.($RealIdx+1).'",'.
+             "\n".'"'.$cache->{'title_'.$ResId}.$Dummy.'",'.
+             "\n".'"'.$cache->{'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.'"'.
+	     "\n".'"'.$DiscNo.'"';
 
         $r->print("\n".$Ptr);
-    }
-    else{
-        my $Ptr =  "\n".'<tr>'.
-               "\n".'<td>'.($RealIdx+1).'</td>'.
-          #     "\n".'<td>'.$PrOrd.$Temp.'</td>'.
-               "\n".'<td>'.$Temp.'</td>'.
-               "\n".'<td bgcolor='.$color->{"yellow"}.'> '.$StdNo.'</td>'.
-               "\n".'<td bgcolor='.$color->{"yellow"}.'>'.$TotalTries.'</td>'.
-               "\n".'<td bgcolor='.$color->{"yellow"}.'>'.$MxTries.'</td>'.
-               "\n".'<td bgcolor='.$color->{"gb"}.'>'.$Avg.'</td>'.
-               "\n".'<td bgcolor='.$color->{"gb"}.'> '.$YES.'</td>'.
-               "\n".'<td bgcolor='.$color->{"gb"}.'> '.$Override.'</td>'.
-               "\n".'<td bgcolor='.$color->{"red"}.'> '.$Wrng.'</td>'.
-               "\n".'<td bgcolor='.$color->{"red"}.'> '.$DoD.'</td>'.
-               "\n".'<td bgcolor='.$color->{"green"}.'> '.$SD.'</td>'.
-               "\n".'<td bgcolor='.$color->{"green"}.'> '.$Sk.'</td>'.
-               "\n".'<td bgcolor='.$color->{"purple"}.'> '.$_D1.'</td>'.
-	       "\n".'<td bgcolor='.$color->{"purple"}.'> '.$_D2.'</td>'.
-               "\n".'<td bgcolor='.$color->{"yellow"}.'> '.$DiscNo.'</td>';
+    } else {
+        $Ptr="\n".'<tr>'.
+             "\n".'<td>'.($RealIdx+1).'</td>'.
+          #  "\n".'<td>'.$PrOrd.$Temp.'</td>'.
+             "\n".'<td>'.$Temp.'</td>'.
+             "\n".'<td bgcolor='.$color->{"yellow"}.'> '.$StdNo.'</td>'.
+             "\n".'<td bgcolor='.$color->{"yellow"}.'>'.$TotalTries.'</td>'.
+             "\n".'<td bgcolor='.$color->{"yellow"}.'>'.$MxTries.'</td>'.
+             "\n".'<td bgcolor='.$color->{"gb"}.'>'.$Avg.'</td>'.
+             "\n".'<td bgcolor='.$color->{"gb"}.'> '.$YES.'</td>'.
+             "\n".'<td bgcolor='.$color->{"gb"}.'> '.$Override.'</td>'.
+             "\n".'<td bgcolor='.$color->{"red"}.'> '.$Wrng.'</td>'.
+             "\n".'<td bgcolor='.$color->{"red"}.'> '.$DoD.'</td>'.
+             "\n".'<td bgcolor='.$color->{"green"}.'> '.$SD.'</td>'.
+             "\n".'<td bgcolor='.$color->{"green"}.'> '.$Sk.'</td>'.
+             "\n".'<td bgcolor='.$color->{"purple"}.'> '.$_D1.'</td>'.
+	     "\n".'<td bgcolor='.$color->{"purple"}.'> '.$_D2.'</td>'.
+             "\n".'<td bgcolor='.$color->{"yellow"}.'> '.$DiscNo.'</td>';
         $r->print("\n".$Ptr.'</tr>' );
     }
 #    $GraphDat->{$RealIdx}=$DoD.':'.$Wrng;
@@ -842,9 +846,7 @@
     my %DisLow = &ProcessDiscriminant(\@LowList,$r);
 
     return (\%DisUp, \%DisLow);
-}
-
-   
+}   
 
 #---- END Problem Statistics Web Page ----------------------------------------