--- loncom/interface/lonmeta.pm 2008/12/10 18:43:32 1.218
+++ loncom/interface/lonmeta.pm 2008/12/13 19:44:52 1.220
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.218 2008/12/10 18:43:32 bisitz Exp $
+# $Id: lonmeta.pm,v 1.220 2008/12/13 19:44:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -164,7 +164,7 @@ sub evalgraph {
my $val=int($value*10.+0.5)-10;
my $output='
';
if ($val>=20) {
- $output.='  | ';
+ $output.=' | ';
} else {
$output.=' | '.
' | ';
@@ -174,7 +174,7 @@ sub evalgraph {
$output.=' | '.
' | ';
} else {
- $output.='  | ';
+ $output.=' | ';
}
$output.=' ('.sprintf("%5.2f",$value).') |
';
return $output;
@@ -555,12 +555,13 @@ sub selectbox {
$functionref=\&direct;
}
my $selout='';
}
@@ -832,11 +833,11 @@ sub report_bombs {
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).
'
');
}
}
@@ -859,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
@@ -970,13 +971,13 @@ sub print_dynamic_metadata {
exists($dynmeta{'course'})) {
$r->print(''.&mt('Access and Usage Statistics').'
'.
&Apache::lonhtmlcommon::start_pick_box());
- foreach ('count',
- 'sequsage','sequsage_list',
- 'comefrom','comefrom_list',
- 'goto','goto_list',
- 'course','course_list') {
- $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
- .&prettyprint($_,$dynmeta{$_})
+ foreach my $item ('count',
+ 'sequsage','sequsage_list',
+ 'comefrom','comefrom_list',
+ 'goto','goto_list',
+ 'course','course_list') {
+ $r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
+ .&prettyprint($item,$dynmeta{$item})
.&Apache::lonhtmlcommon::row_closure()
);
}
@@ -1000,9 +1001,9 @@ sub print_dynamic_metadata {
.&prettyprint('stdno',$dynmeta{'stdno'})
.&Apache::lonhtmlcommon::row_closure()
);
- foreach ('avetries','difficulty','disc') {
- $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
- .&prettyprint($_,sprintf('%5.2f',$dynmeta{$_}))
+ foreach my $item ('avetries','difficulty','disc') {
+ $r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
+ .&prettyprint($item,sprintf('%5.2f',$dynmeta{$item}))
.&Apache::lonhtmlcommon::row_closure()
);
}
@@ -1041,10 +1042,10 @@ sub print_dynamic_metadata {
''.$data->{'sections'}.' | ';
$table .=
''.$data->{'stdno'}.' | ';
- foreach ('avetries','difficulty','disc') {
+ foreach my $item ('avetries','difficulty','disc') {
$table .= '';
- if (exists($data->{$_})) {
- $table .= sprintf('%.2f',$data->{$_}).' ';
+ if (exists($data->{$item})) {
+ $table .= sprintf('%.2f',$data->{$item}).' ';
} else {
$table .= '';
}
@@ -1076,9 +1077,9 @@ sub print_dynamic_metadata {
exists($dynmeta{'technical'})){
$r->print(''.&mt('Evaluation Data').''.
&Apache::lonhtmlcommon::start_pick_box());
- foreach ('clear','depth','helpful','correct','technical') {
- $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
- .&prettyprint($_,$dynmeta{$_})
+ foreach my $item ('clear','depth','helpful','correct','technical') {
+ $r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
+ .&prettyprint($item,$dynmeta{$item})
.&Apache::lonhtmlcommon::row_closure()
);
}
@@ -1112,8 +1113,7 @@ sub print_dynamic_metadata {
&mt('Additional Metadata (non-standard, parameters, exports)').
'');
$r->print(&Apache::lonhtmlcommon::start_pick_box());
- foreach (sort(keys(%content))) {
- my $name=$_;
+ foreach my $name (sort(keys(%content))) {
if ($name!~/\.display$/) {
my $display=&Apache::lonnet::metadata($uri,
$name.'.display');
@@ -1121,12 +1121,12 @@ sub print_dynamic_metadata {
$display=$name;
};
my $otherinfo='';
- foreach ('name','part','type','default') {
+ foreach my $item ('name','part','type','default') {
if (defined(&Apache::lonnet::metadata($uri,
- $name.'.'.$_))) {
- $otherinfo.=' '.$_.'='.
+ $name.'.'.$item))) {
+ $otherinfo.=' '.$item.'='.
&Apache::lonnet::metadata($uri,
- $name.'.'.$_).'; ';
+ $name.'.'.$item).'; ';
}
}
$r->print(&Apache::lonhtmlcommon::row_title($display)
|