--- loncom/interface/lonmeta.pm 2001/12/24 17:13:11 1.10 +++ loncom/interface/lonmeta.pm 2001/12/24 21:09:08 1.11 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.10 2001/12/24 17:13:11 www Exp $ +# $Id: lonmeta.pm,v 1.11 2001/12/24 21:09:08 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -85,7 +85,13 @@ sub dynamicmeta { } my %returnhash=(); 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; } @@ -124,25 +130,38 @@ my $creationdate=localtime($content{'cre my $lastrevisiondate=localtime($content{'lastrevisiondate'}); my $language=&Apache::loncommon::languagedescription($content{'language'}); my $mime=&Apache::loncommon::filedescription($content{'mime'}); +my $disuri=&Apache::lonnet::declutter($uri); + $disuri=~s/\.meta$//; $r->print(<Catalog Information

Catalog Information

$content{'title'}

-

Author(s): $content{'author'}

-Subject: $content{'subject'}
-Keyword(s): $content{'keywords'}
-Notes: $content{'notes'}
-Abstract: -
$content{'abstract'}
-
-MIME Type: $mime ($content{'mime'})
-Language: $language
-Creation Date: $creationdate
-Last Revision Date: $lastrevisiondate
-Publisher/Owner: $content{'owner'}
-Copyright/Distribution: $content{'copyright'} -
+

$disuri

+ + + + + + + + + + + + + + + + + + + + + +
Author(s)$content{'author'} 
Subject$content{'subject'} 
Keyword(s)$content{'keywords'} 
Notes$content{'notes'} 
Abstract$content{'abstract'} 
MIME Type$mime ($content{'mime'}) 
Language$language 
Creation Date$creationdate 
+Last Revision Date$lastrevisiondate 
Publisher/Owner$content{'owner'} 
Copyright/Distribution$content{'copyright'} +
ENDHEAD delete($content{'title'}); delete($content{'author'}); @@ -157,41 +176,54 @@ ENDHEAD delete($content{'owner'}); delete($content{'copyright'}); if ($ENV{'user.adv'}) { +# ------------------------------------------------------------ Dynamic Metadata $r->print('

Dynamic Metadata (updated periodically)

'); my %items=( 'count' => 'Network-wide number of accesses (hits)', 'course' => 'Network-wide number of courses using resource', 'usage' => 'Number of resources using or importing resource', - 'clear' => 'Evaluation: presented in clear way', - 'depth' => 'Evaluation: material covered with sufficient depth', - 'helpful' => 'Evaluation: material is helpful', - 'correct' => 'Evaluation: material appears to be correct', - 'technical' => 'Evaluation: material is technically correct', + 'clear' => 'Material presented in clear way', + 'depth' => 'Material covered with sufficient depth', + 'helpful' => 'Material is helpful', + 'correct' => 'Material appears to be correct', + 'technical' => 'Resource is technically correct', 'avetries' => 'Average number of tries till solved', 'stdno' => 'Total number of students who have worked on this problem', 'difficulty' => 'Degree of difficulty'); my %dynmeta=&dynamicmeta($uri); - $r->print('

Access and Usage Statistics

'); + $r->print( +'

Access and Usage Statistics

'); foreach ('count','usage','course') { - $r->print(''.$items{$_}.':'."
\n"); - } + $r->print( +'\n"); + } + $r->print('
'.$items{$_}.''. +$dynmeta{$_}." 
'); if ($uri=~/\.(problem|exam|quiz|assess|survey|form)\.meta$/) { - $r->print('

Assessment Statistical Data

'); + $r->print( +'

Assessment Statistical Data

'); foreach ('stdno','avetries','difficulty') { - $r->print(''.$items{$_}.':'."
\n"); - } + $r->print( +'\n"); + } + $r->print('
'.$items{$_}.''. +$dynmeta{$_}." 
'); } - $r->print('

Evaluation Data

'); + $r->print('

Evaluation Data

'); foreach ('clear','depth','helpful','correct','technical') { - $r->print(''.$items{$_}.':'."
\n"); + $r->print( +'\n"); } - &Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//; + $r->print('
'.$items{$_}.''. +$dynmeta{$_}." 
'); + $disuri=~/^(\w+)\/(\w+)\//; if ((($ENV{'user.domain'} eq $1) && ($ENV{'user.name'} eq $2)) || ($ENV{'user.role.ca./'.$1.'/'.$2})) { $r->print( '

Evaluation Comments (visible to author and co-authors only)

'. - $dynmeta{'comments'}); + '
'.$dynmeta{'comments'}.'
'); } +# ------------------------------------------------------------- All other stuff $r->print( '

Additional Metadata (non-standard, parameters, exports)

'); foreach (sort keys %content) {