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

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 10 Dec 2003 23:09:26 -0000


matthew		Wed Dec 10 18:09:26 2003 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemanalysis.pm 
  Log:
  &ProblemSelector(): fallback for resources without titles.
  The wonders of cut and paste coding.
  
  
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.49 loncom/interface/statistics/lonproblemanalysis.pm:1.50
--- loncom/interface/statistics/lonproblemanalysis.pm:1.49	Tue Nov 11 17:14:28 2003
+++ loncom/interface/statistics/lonproblemanalysis.pm	Wed Dec 10 18:09:26 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemanalysis.pm,v 1.49 2003/11/11 22:14:28 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.50 2003/12/10 23:09:26 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1491,10 +1491,14 @@
                         if ($ENV{'form.problemchoice'} eq $value) {
                             $checked = 'checked ';
                         }
+                        my $title = $res->{'title'};
+                        if (! defined($title) || $title eq '') {
+                            ($title) = ($res->{'src'} =~ m:/([^/]*)$:);
+                        }
                         $seq_str .= '<tr><td>'.
   '<input type="radio" name="problemchoice" value="'.$value.'" '.$checked.'/>'.
   '</td><td>'.
-  '<a href="'.$res->{'src'}.'">'.$res->{'title'}.'</a> ';
+  '<a href="'.$res->{'src'}.'">'.$title.'</a> ';
 #  '<a href="'.$res->{'src'}.'">'.$resptype.' '.$res->{'title'}.'</a> ';
                         if ($partdata->{'option'} > 1) {
                             $seq_str .= &mt('response').' '.$respid;