Diff for /loncom/interface/lonmeta.pm between versions 1.10 and 1.11

version 1.10, 2001/12/24 17:13:11 version 1.11, 2001/12/24 21:09:08
Line 85  sub dynamicmeta { Line 85  sub dynamicmeta {
     }      }
     my %returnhash=();      my %returnhash=();
     foreach (keys %cnt) {      foreach (keys %cnt) {
                 if ($listitems{$_} eq 'avg') {
      $returnhash{$_}=int(($sum{$_}/$cnt{$_})*100.0+0.5)/100.0;
          } elsif ($listitems{$_} eq 'cnt') {
              $returnhash{$_}=$cnt{$_};
          } else {
              $returnhash{$_}=$sum{$_};
          }
     }      }
     return %returnhash;      return %returnhash;
 }  }
Line 124  my $creationdate=localtime($content{'cre Line 130  my $creationdate=localtime($content{'cre
 my $lastrevisiondate=localtime($content{'lastrevisiondate'});  my $lastrevisiondate=localtime($content{'lastrevisiondate'});
 my $language=&Apache::loncommon::languagedescription($content{'language'});  my $language=&Apache::loncommon::languagedescription($content{'language'});
 my $mime=&Apache::loncommon::filedescription($content{'mime'});   my $mime=&Apache::loncommon::filedescription($content{'mime'}); 
   my $disuri=&Apache::lonnet::declutter($uri);
     $disuri=~s/\.meta$//;
   $r->print(<<ENDHEAD);    $r->print(<<ENDHEAD);
 <html><head><title>Catalog Information</title></head>  <html><head><title>Catalog Information</title></head>
 <body bgcolor="#FFFFFF">  <body bgcolor="#FFFFFF">
 <h1>Catalog Information</h1>  <h1>Catalog Information</h1>
 <h2>$content{'title'}</h2>  <h2>$content{'title'}</h2>
 <h3>Author(s): $content{'author'}</h3>  <h3><tt>$disuri</tt></h3>
 <b>Subject:</b> $content{'subject'}<br>  <table cellspacing=2 border=0>
 <b>Keyword(s):</b> $content{'keywords'}<br>  <tr><td bgcolor='#AAAAAA'>Author(s)</td>
 <b>Notes:</b> $content{'notes'}<br>  <td bgcolor="#CCCCCC">$content{'author'}&nbsp;</td></tr>
 <b>Abstract:</b>  <tr><td bgcolor='#AAAAAA'>Subject</td>
 <blockquote>$content{'abstract'}</blockquote>  <td bgcolor="#CCCCCC">$content{'subject'}&nbsp;</td></tr>
 <hr>  <tr><td bgcolor='#AAAAAA'>Keyword(s)</td>
 <b>MIME Type:</b> $mime ($content{'mime'})<br>  <td bgcolor="#CCCCCC">$content{'keywords'}&nbsp;</td></tr>
 <b>Language:</b> $language<br>  <tr><td bgcolor='#AAAAAA'>Notes</td>
 <b>Creation Date:</b> $creationdate<br>  <td bgcolor="#CCCCCC">$content{'notes'}&nbsp;</td></tr>
 <b>Last Revision Date:</b> $lastrevisiondate<br>  <tr><td bgcolor='#AAAAAA'>Abstract</td>
 <b>Publisher/Owner:</b> $content{'owner'}<br>  <td bgcolor="#CCCCCC">$content{'abstract'}&nbsp;</td></tr>
 <b>Copyright/Distribution:</b> $content{'copyright'}  <tr><td bgcolor='#AAAAAA'>MIME Type</td>
 <hr>  <td bgcolor="#CCCCCC">$mime ($content{'mime'})&nbsp;</td></tr>
   <tr><td bgcolor='#AAAAAA'>Language</td>
   <td bgcolor="#CCCCCC">$language&nbsp;</td></tr>
   <tr><td bgcolor='#AAAAAA'>Creation Date</td>
   <td bgcolor="#CCCCCC">$creationdate&nbsp;</td></tr>
   <tr><td bgcolor='#AAAAAA'>
   Last Revision Date</td><td bgcolor="#CCCCCC">$lastrevisiondate&nbsp;</td></tr>
   <tr><td bgcolor='#AAAAAA'>Publisher/Owner</td>
   <td bgcolor="#CCCCCC">$content{'owner'}&nbsp;</td></tr>
   <tr><td bgcolor='#AAAAAA'>Copyright/Distribution</td>
   <td bgcolor="#CCCCCC">$content{'copyright'}
   </table>
 ENDHEAD  ENDHEAD
   delete($content{'title'});    delete($content{'title'});
   delete($content{'author'});    delete($content{'author'});
Line 157  ENDHEAD Line 176  ENDHEAD
   delete($content{'owner'});    delete($content{'owner'});
   delete($content{'copyright'});    delete($content{'copyright'});
   if ($ENV{'user.adv'}) {    if ($ENV{'user.adv'}) {
   # ------------------------------------------------------------ Dynamic Metadata
    $r->print('<h3>Dynamic Metadata (updated periodically)</h3>');     $r->print('<h3>Dynamic Metadata (updated periodically)</h3>');
     my %items=(      my %items=(
  'count'      => 'Network-wide number of accesses (hits)',   'count'      => 'Network-wide number of accesses (hits)',
  'course'     => 'Network-wide number of courses using resource',   'course'     => 'Network-wide number of courses using resource',
  'usage'      => 'Number of resources using or importing resource',   'usage'      => 'Number of resources using or importing resource',
  'clear'      => 'Evaluation: presented in clear way',   'clear'      => 'Material presented in clear way',
  'depth'      => 'Evaluation: material covered with sufficient depth',   'depth'      => 'Material covered with sufficient depth',
  'helpful'    => 'Evaluation: material is helpful',   'helpful'    => 'Material is helpful',
  'correct'    => 'Evaluation: material appears to be correct',   'correct'    => 'Material appears to be correct',
  'technical'  => 'Evaluation: material is technically correct',    'technical'  => 'Resource is technically correct', 
  'avetries'   => 'Average number of tries till solved',   'avetries'   => 'Average number of tries till solved',
  'stdno'      => 'Total number of students who have worked on this problem',   'stdno'      => 'Total number of students who have worked on this problem',
  'difficulty' => 'Degree of difficulty');   'difficulty' => 'Degree of difficulty');
    my %dynmeta=&dynamicmeta($uri);     my %dynmeta=&dynamicmeta($uri);
    $r->print('<h4>Access and Usage Statistics</h4>');     $r->print(
   '</table><h4>Access and Usage Statistics</h4><table cellspacing=2 border=0>');
    foreach ('count','usage','course') {     foreach ('count','usage','course') {
        $r->print('<b>'.$items{$_}.':</b>'."<br>\n");         $r->print(
    }      '<tr><td bgcolor="#AAAAAA">'.$items{$_}.'</td><td bgcolor="#CCCCCC">'.
   $dynmeta{$_}."&nbsp;</td></tr>\n");
      }
          $r->print('</table>');
    if ($uri=~/\.(problem|exam|quiz|assess|survey|form)\.meta$/) {     if ($uri=~/\.(problem|exam|quiz|assess|survey|form)\.meta$/) {
       $r->print('<h4>Assessment Statistical Data</h4>');        $r->print(
   '<h4>Assessment Statistical Data</h4><table cellspacing=2 border=0>');
       foreach ('stdno','avetries','difficulty') {        foreach ('stdno','avetries','difficulty') {
           $r->print('<b>'.$items{$_}.':</b>'."<br>\n");            $r->print(
       }      '<tr><td bgcolor="#AAAAAA">'.$items{$_}.'</td><td bgcolor="#CCCCCC">'.
   $dynmeta{$_}."&nbsp;</td></tr>\n");
         }
         $r->print('</table>');    
    }     }
    $r->print('<h4>Evaluation Data</h4>');     $r->print('<h4>Evaluation Data</h4><table cellspacing=2 border=0>');
    foreach ('clear','depth','helpful','correct','technical') {     foreach ('clear','depth','helpful','correct','technical') {
        $r->print('<b>'.$items{$_}.':</b>'."<br>\n");         $r->print(
   '<tr><td bgcolor="#AAAAAA">'.$items{$_}.'</td><td bgcolor="#CCCCCC">'.
   $dynmeta{$_}."&nbsp;</td></tr>\n");
    }         }    
    &Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//;     $r->print('</table>');
      $disuri=~/^(\w+)\/(\w+)\//;   
    if ((($ENV{'user.domain'} eq $1) && ($ENV{'user.name'} eq $2))     if ((($ENV{'user.domain'} eq $1) && ($ENV{'user.name'} eq $2))
        || ($ENV{'user.role.ca./'.$1.'/'.$2})) {         || ($ENV{'user.role.ca./'.$1.'/'.$2})) {
       $r->print(        $r->print(
   '<h4>Evaluation Comments (visible to author and co-authors only)</h4>'.    '<h4>Evaluation Comments (visible to author and co-authors only)</h4>'.
       $dynmeta{'comments'});              '<blockquote>'.$dynmeta{'comments'}.'</blockquote>');      
    }     }
   # ------------------------------------------------------------- All other stuff
    $r->print(     $r->print(
  '<h3>Additional Metadata (non-standard, parameters, exports)</h3>');   '<h3>Additional Metadata (non-standard, parameters, exports)</h3>');
    foreach (sort keys %content) {     foreach (sort keys %content) {

Removed from v.1.10  
changed lines
  Added in v.1.11


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