[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm lonmeta.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 17 Jun 2004 20:43:05 -0000


www		Thu Jun 17 16:43:05 2004 EDT

  Modified files:              
    /loncom/interface	lonindexer.pm lonmeta.pm 
  Log:
  Displaying dynamic metadata, including possibility to follow "selection" trail
  when browsing.
  
  
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.113 loncom/interface/lonindexer.pm:1.114
--- loncom/interface/lonindexer.pm:1.113	Thu Jun 17 14:22:13 2004
+++ loncom/interface/lonindexer.pm	Thu Jun 17 16:43:04 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.113 2004/06/17 18:22:13 www Exp $
+# $Id: lonindexer.pm,v 1.114 2004/06/17 20:43:04 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -874,7 +874,7 @@
         }
 	# Set the icon for the file
 	my $iconname = &Apache::loncommon::icon($listname);
-	$r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap>");
+	$r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap='1' align='top'>");
 	
 	my $metafile = $Apache::lonnet::perlvar{'lonDocRoot'}.$pathprefix.
 	    $filecom[0].'.meta';
@@ -1017,10 +1017,17 @@
 	if ($hash{'display_attrs_8'} == 1) {
 # statistics
 	    $r->print("<td>");
-	    if ($dynhash{$filelink}->{'stdno'}) {
-		$r->print(&mt('Number of students: ').
-			  $dynhash{$filelink}->{'stdno'}.'<br />');
-	    }
+	    &dynmetaprint($r,$filelink,'count');
+	    &dynmetaprint($r,$filelink,'course');
+	    &dynmetaprint($r,$filelink,'stdno');
+	    &dynmetaprint($r,$filelink,'avetries');
+	    &dynmetaprint($r,$filelink,'difficulty');
+	    &dynmetaprint($r,$filelink,'disc');
+	    &dynmetaprint($r,$filelink,'clear');
+	    &dynmetaprint($r,$filelink,'technical');
+	    &dynmetaprint($r,$filelink,'correct');
+	    &dynmetaprint($r,$filelink,'helpful');
+	    &dynmetaprint($r,$filelink,'depth');
 	    $r->print("&nbsp;</td>\n");
 
 	}
@@ -1041,16 +1048,9 @@
 	   &dynmetaprint($r,$filelink,'goto_list');
 	   &dynmetaprint($r,$filelink,'comefrom_list');
 	   &dynmetaprint($r,$filelink,'sequsage_list');
-	   my $dependencies=&Apache::lonnet::metadata($filelink,'dependencies');
-	   if ($dependencies=~/\w/) {
-	       $r->print(&mt('Links to:').
-		     &Apache::lonmeta::prettyprint('linkto_list',&Apache::lonnet::metadata($filelink,'dependencies'),
-		  (($ENV{'form.catalogmode'} ne 'groupimport')?'preview':''),
-		  '',
-		  (($ENV{'form.catalogmode'} eq 'groupimport')?'document.forms.fileattr':''),1));
-	   }
+	   &dynmetaprint($r,$filelink,'dependencies');
 	   $r->print('</td>');
-	   }
+        }
 	$r->print("</tr>\n");
     }
 
@@ -1141,7 +1141,7 @@
 sub dynmetaprint {
     my ($r,$filelink,$item)=@_;
     if ($dynhash{$filelink}->{$item}) {
-	$r->print($fieldnames{$item}.': '.
+	$r->print("\n<br />".$fieldnames{$item}.': '.
 		  &Apache::lonmeta::prettyprint($item,
 						$dynhash{$filelink}->{$item},
 		  (($ENV{'form.catalogmode'} ne 'groupimport')?'preview':''),
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.82 loncom/interface/lonmeta.pm:1.83
--- loncom/interface/lonmeta.pm:1.82	Thu Jun 17 14:22:13 2004
+++ loncom/interface/lonmeta.pm	Thu Jun 17 16:43:04 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.82 2004/06/17 18:22:13 www Exp $
+# $Id: lonmeta.pm,v 1.83 2004/06/17 20:43:04 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -71,11 +71,12 @@
     if (! defined($authordom) || ! defined($author)) {
         return ();
     }
-    my @Fields = ('url',
+    my @Fields = ('url','count','course',
                   'goto','goto_list',
                   'comefrom','comefrom_list',
                   'sequsage','sequsage_list',
                   'stdno','stdno_list',
+		  'dependencies',
                   'avetries','avetries_list',
                   'difficulty','difficulty_list',
                   'disc','disc_list',
@@ -277,6 +278,7 @@
          'stdno'      => 'Total number of students who have worked on this problem',
          'difficulty' => 'Degree of difficulty',
          'disc'       => 'Degree of discrimination',
+	 'dependencies' => 'Resources used by this resource',
          );
 }
 
@@ -339,7 +341,7 @@
 	($type eq 'goto_list') ||
 	($type eq 'comefrom_list') ||
 	($type eq 'sequsage_list') ||
-	($type eq 'linkto_list')) {
+	($type eq 'dependencies')) {
 	return '<ul><font size="-1">'.join("\n",map {
             my $url = &Apache::lonnet::clutter($_);
             my $title = &Apache::lonnet::gettitle($url);