--- loncom/interface/lonmeta.pm 2007/01/12 22:13:51 1.196 +++ loncom/interface/lonmeta.pm 2011/11/14 00:20:34 1.244 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.196 2007/01/12 22:13:51 albertel Exp $ +# $Id: lonmeta.pm,v 1.244 2011/11/14 00:20:34 raeburn 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='
  | '; + $output.=''.(' ' x2).' | '; } else { $output.=''. ' | '; @@ -192,7 +174,7 @@ sub evalgraph { $output.=' | '. ' | '; } else { - $output.=' |   | '; + $output.=''.(' ' x2).' | '; } $output.='('.sprintf("%5.2f",$value).') |
'.
+ $obsoletewarning=' '.
&mt('This resource has been marked obsolete by the author(s)').
- '
-$disuri
-$obsoletewarning
-$versiondisplay
-
'
+ .$disuri.'
'
+ .$obsoletewarning
+ .$versiondisplay
+ .'
'.$lt{$_}.' | '. - ''. - &prettyprint($_,$dynmeta{$_})." |
' + .&mt('No Access or Usages Statistics are available for this resource.') + .'
' + ); } # # Assessment statistics - if ($uri=~/\.(problem|exam|quiz|assess|survey|form)$/) { + if ($uri=~/$LONCAPA::assess_re/) { if (exists($dynmeta{'stdno'}) || exists($dynmeta{'avetries'}) || exists($dynmeta{'difficulty'}) || @@ -968,35 +1062,41 @@ sub print_dynamic_metadata { $r->print(''.$lt{'stdno'}.' | '. - ''. - &prettyprint('stdno',$dynmeta{'stdno'}). - ' | '."
'.$lt{$_}.' | '. - ''. - &prettyprint($_,sprintf('%5.2f',$dynmeta{$_})). - ' | '."
Course | '. - 'Section(s) | '. - 'Num Students | '. - 'Mean Tries | '. - 'Degree of Difficulty | '. - 'Degree of Discrimination | '. - 'Time of computation | '. - ''.&mt('Course').' | ' + .''.&mt('Section(s)').' | ' + .''.&mt('Num Students').' | ' + .''.&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}; my $course = $data->{'course'}; @@ -1007,33 +1107,35 @@ sub print_dynamic_metadata { &Apache::lonnet::logthis('lookup for '.$course.' failed'); next; } - $table .= '
---|---|---|---|---|---|---|
'.$courseinfo{'description'}.' | '; $table .= ''.$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 .= ''; } $table .= ' | '; } $table .= - ''.
&Apache::lonlocal::locallocaltime($data->{'timestamp'}).
- ' | ';
- $table .=
- ' |
' + .&mt('No new dynamic data found.') + .'
' + ); } } else { $r->print(''.$lt{$_}.' | '. - ''. - &prettyprint($_,$dynmeta{$_})." |
' + .&mt('No Evaluation Data is available for this resource.') + .'
' + ); } + # Evaluation Comments $uri=~/^\/res\/($match_domain)\/($match_username)\//; if ((($env{'user.domain'} eq $1) && ($env{'user.name'} eq $2)) || ($env{'user.role.ca./'.$1.'/'.$2})) { + $r->print(''.$dynmeta{'comments'}.''); + $r->print('
'.$dynmeta{'comments'}.''); } else { - $r->print('
' + .&mt('There are no Evaluation Comments on this resource.') + .'
' + ); } my $bombs = &Apache::lonmsg::retrieve_author_res_msg($uri); if (defined($bombs) && $bombs ne '') { - $r->print(''.$display.' | '.$content{$name}); + $r->print(&Apache::lonhtmlcommon::row_title($display) + .$content{$name} + ); if ($otherinfo) { $r->print(' ('.$otherinfo.')'); } - $r->print(" |
'. + &mt('Back To Directory').'
'); + } } $r->print('$displayfile