--- loncom/interface/lonmeta.pm 2007/01/12 19:56:07 1.194
+++ loncom/interface/lonmeta.pm 2009/03/21 21:37:13 1.227
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.194 2007/01/12 19:56:07 raeburn Exp $
+# $Id: lonmeta.pm,v 1.227 2009/03/21 21:37:13 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,24 +42,6 @@ use Apache::lonmsg;
use LONCAPA qw(:DEFAULT :match);
-############################################################
-############################################################
-##
-## &get_dynamic_metadata_from_sql($url)
-##
-## Queries sql database for dynamic metdata
-## Returns a hash of hashes, with keys of urls which match $url
-## Returned fields are given below.
-##
-## Examples:
-##
-## %DynamicMetadata = &Apache::lonmeta::get_dynmaic_metadata_from_sql
-## ('/res/msu/korte/');
-##
-## $DynamicMetadata{'/res/msu/korte/example.problem'}->{$field}
-##
-############################################################
-############################################################
sub get_dynamic_metadata_from_sql {
my ($url) = shift();
my ($authordom,$author)=($url=~m{^/res/($match_domain)/($match_username)/});
@@ -182,7 +164,7 @@ sub evalgraph {
my $val=int($value*10.+0.5)-10;
my $output='
';
if ($val>=20) {
- $output.='
 
';
+ $output.='
'.(' ' x2).'
';
} else {
$output.='
'.
'
';
@@ -192,7 +174,7 @@ sub evalgraph {
$output.='
'.
'
';
} else {
- $output.='
 
';
+ $output.='
'.(' ' x2).'
';
}
$output.='
('.sprintf("%5.2f",$value).')
';
return $output;
@@ -265,7 +247,7 @@ sub fieldnames {
'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',
+ 'stdno' => 'Statistics calculated for number of students',
'difficulty' => 'Degree of difficulty',
'disc' => 'Degree of discrimination',
'dependencies' => 'Resources used by this resource',
@@ -356,7 +338,7 @@ sub pre_select_course {
&Apache::lonpublisher::metaeval($result);
}
$r->print('
+$cancel
+
ENDCLEAR
my %brokenurls =
&Apache::lonmsg::all_url_author_res_msg($author,$domain);
- foreach (sort(keys(%brokenurls))) {
- if ($_=~/^\Q$uri\E/) {
+ foreach my $key (sort(keys(%brokenurls))) {
+ if ($key=~/^\Q$uri\E/) {
$r->print
- (''.$_.''.
- &Apache::lonmsg::retrieve_author_res_msg($_).
+ (''.$key.''.
+ &Apache::lonmsg::retrieve_author_res_msg($key).
'');
}
}
@@ -832,8 +860,8 @@ sub present_uneditable_metadata {
my $uploaded = ($uri =~ m|/uploaded/|);
my %content=();
# Read file
- foreach (split(/\,/,&Apache::lonnet::metadata($uri,'keys'))) {
- $content{$_}=&Apache::lonnet::metadata($uri,$_);
+ foreach my $key (split(/\,/,&Apache::lonnet::metadata($uri,'keys'))) {
+ $content{$key}=&Apache::lonnet::metadata($uri,$key);
}
# Render Output
# displayed url
@@ -861,9 +889,9 @@ sub present_uneditable_metadata {
my $obsolete=$content{'obsolete'};
my $obsoletewarning='';
if (($obsolete) && ($env{'user.adv'})) {
- $obsoletewarning='
'.
+ $obsoletewarning='
'.
&mt('This resource has been marked obsolete by the author(s)').
- '
';
+ '';
}
#
my %lt=&fieldnames();
@@ -899,24 +927,27 @@ sub present_uneditable_metadata {
'obsolete',
'obsoletereplacement');
}
+ my $rownum = 0;
foreach my $field (@fields) {
- $table.='