[LON-CAPA-cvs] cvs: loncom /interface/statistics lonsubmissiontimeanalysis.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Wed, 10 Dec 2003 23:06:57 -0000
matthew Wed Dec 10 18:06:57 2003 EDT
Modified files:
/loncom/interface/statistics lonsubmissiontimeanalysis.pm
Log:
&ProblemSelector: have fallback for case when the resource does not have
a title.
Index: loncom/interface/statistics/lonsubmissiontimeanalysis.pm
diff -u loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.4 loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.5
--- loncom/interface/statistics/lonsubmissiontimeanalysis.pm:1.4 Tue Nov 11 17:14:28 2003
+++ loncom/interface/statistics/lonsubmissiontimeanalysis.pm Wed Dec 10 18:06:57 2003
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonsubmissiontimeanalysis.pm,v 1.4 2003/11/11 22:14:28 matthew Exp $
+# $Id: lonsubmissiontimeanalysis.pm,v 1.5 2003/12/10 23:06:57 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -364,14 +364,23 @@
if ($ENV{'form.problemchoice'} eq $value) {
$checked = 'checked ';
}
+ my $title = $res->{'title'};
+ if (! defined($title) || $title eq '') {
+ ($title) = ($res->{'src'} =~ m:/([^/]*)$:);
+ }
+# &Apache::lonnet::logthis('title = :'.$title.':');
$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> ';
} else {
+ my $title = $res->{'title'};
+ if (! defined($title) || $title eq '') {
+ ($title) = ($res->{'src'} =~ m:/([^/]*)$:);
+ }
$seq_str .= '<tr><td>'.
' '.'</td><td>'.
- '<a href="'.$res->{'src'}.'">'.$res->{'title'}.'</a>'.
+ '<a href="'.$res->{'src'}.'">'.$title.'</a>'.
"</td></tr>\n";
foreach my $part (@{$res->{'parts'}}) {
my $value = &Apache::lonnet::escape