--- loncom/interface/lonmeta.pm 2008/12/13 22:17:15 1.212.2.2
+++ loncom/interface/lonmeta.pm 2009/04/04 13:47:50 1.212.2.5
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.212.2.2 2008/12/13 22:17:15 raeburn Exp $
+# $Id: lonmeta.pm,v 1.212.2.5 2009/04/04 13:47:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -576,7 +576,7 @@ sub selectbox {
foreach my $id (@idlist) {
$selout.='';
+ $selout.=' selected="selected">'.&{$functionref}($id).'';
} else {
$selout.='>'.&{$functionref}($id).'';
}
@@ -945,10 +945,14 @@ sub present_uneditable_metadata {
'obsolete',
'obsoletereplacement');
}
+ my $rownum = 0;
foreach my $field (@fields) {
+ my $lastrow = '';
+ $rownum ++;
+ $lastrow = 1 if ($rownum == @fields);
$table.=&Apache::lonhtmlcommon::row_title($lt{$field})
- .&prettyprint($field,$content{$field}).
- .&Apache::lonhtmlcommon::row_closure();
+ .&prettyprint($field,$content{$field})
+ .&Apache::lonhtmlcommon::row_closure($lastrow);
delete($content{$field});
}
#
@@ -989,14 +993,17 @@ sub print_dynamic_metadata {
exists($dynmeta{'course'})) {
$r->print('
'.&mt('Access and Usage Statistics').'
'.
&Apache::lonhtmlcommon::start_pick_box());
- foreach my $item ('count',
- 'sequsage','sequsage_list',
- 'comefrom','comefrom_list',
- 'goto','goto_list',
- 'course','course_list') {
+ my @counts = ('count','sequsage','sequsage_list',
+ 'comefrom','comefrom_list','goto',
+ 'goto_list','course','course_list');
+ my $rownum = 0;
+ foreach my $item (@counts) {
+ my $lastrow = '';
+ $rownum ++;
+ $lastrow = 1 if ($rownum == @counts);
$r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
.&prettyprint($item,$dynmeta{$item})
- .&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_closure($lastrow)
);
}
$r->print(&Apache::lonhtmlcommon::end_pick_box());
@@ -1019,10 +1026,15 @@ sub print_dynamic_metadata {
.&prettyprint('stdno',$dynmeta{'stdno'})
.&Apache::lonhtmlcommon::row_closure()
);
- foreach my $item ('avetries','difficulty','disc') {
+ my @stats = ('avetries','difficulty','disc');
+ my $rownum = 0;
+ foreach my $item (@stats) {
+ my $lastrow = '';
+ $rownum ++;
+ $lastrow = 1 if ($rownum == @stats);
$r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
- .&prettyprint($item,sprintf('%5.2f',$dynmeta{$item})).
- .&Apache::lonhtmlcommon::row_closure()
+ .&prettyprint($item,sprintf('%5.2f',$dynmeta{$item}))
+ .&Apache::lonhtmlcommon::row_closure($lastrow)
);
}
$r->print(&Apache::lonhtmlcommon::end_pick_box());
@@ -1035,13 +1047,13 @@ sub print_dynamic_metadata {
'');
my $table=&Apache::loncommon::start_data_table()
.&Apache::loncommon::start_data_table_header_row()
- .''.&mt('Course').' | '.
- .''.&mt('Section(s)').' | '.
- .''.&mt('Num Student').'s | '.
- .''.&mt('Mean Tries').' | '.
- .''.&mt('Degree of Difficulty').' | '.
- .''.&mt('Degree of Discrimination').' | '.
- .''.&mt('Time of computation').' | '.
+ .''.&mt('Course').' | '
+ .''.&mt('Section(s)').' | '
+ .''.&mt('Num Student').'s | '
+ .''.&mt('Mean Tries').' | '
+ .''.&mt('Degree of Difficulty').' | '
+ .''.&mt('Degree of Discrimination').' | '
+ .''.&mt('Time of computation').' | '
.&Apache::loncommon::end_data_table_header_row().$/;
foreach my $identifier (sort(keys(%{$dynmeta{'stats'}}))) {
my $data = $dynmeta{'stats'}->{$identifier};
@@ -1095,10 +1107,15 @@ sub print_dynamic_metadata {
exists($dynmeta{'technical'})){
$r->print(''.&mt('Evaluation Data').'
'.
&Apache::lonhtmlcommon::start_pick_box());
- foreach my $item ('clear','depth','helpful','correct','technical') {
+ my @criteria = ('clear','depth','helpful','correct','technical');
+ my $rownum = 0;
+ foreach my $item (@criteria) {
+ my $lastrow = '';
+ $rownum ++;
+ $lastrow = 1 if ($rownum == @criteria);
$r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
.&prettyprint($item,$dynmeta{$item})
- .&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_closure($lastrow)
);
}
$r->print(&Apache::lonhtmlcommon::end_pick_box());
@@ -1131,8 +1148,19 @@ sub print_dynamic_metadata {
&mt('Additional Metadata (non-standard, parameters, exports)').
'');
$r->print(&Apache::lonhtmlcommon::start_pick_box());
- foreach my $name (sort(keys(%content))) {
- if ($name!~/\.display$/) {
+ my @names;
+ foreach my $key (sort(keys(%content))) {
+ if ($key!~/\.display$/) {
+ push(@names,$key);
+ }
+ }
+ if (@names > 0) {
+ my $rownum = 0;
+ foreach my $name (@names) {
+ my $lastrow = '';
+ $rownum ++;
+ $lastrow = 1 if ($rownum == @names);
+
my $display=&Apache::lonnet::metadata($uri,
$name.'.display');
if (! $display) {
@@ -1152,7 +1180,7 @@ sub print_dynamic_metadata {
if ($otherinfo) {
$r->print(' ('.$otherinfo.')');
}
- $r->print(&Apache::lonhtmlcommon::row_closure());
+ $r->print(&Apache::lonhtmlcommon::row_closure($lastrow));
}
}
$r->print(&Apache::lonhtmlcommon::end_pick_box());