version 1.71, 2004/04/14 21:22:44
|
version 1.73, 2004/04/16 21:43:56
|
Line 193 sub fieldnames {
|
Line 193 sub fieldnames {
|
'technical' => 'Resource is technically correct', |
'technical' => 'Resource is technically correct', |
'avetries' => 'Average number of tries till solved', |
'avetries' => 'Average number of tries till solved', |
'stdno' => 'Total number of students who have worked on this problem', |
'stdno' => 'Total number of students who have worked on this problem', |
'difficulty' => 'Degree of difficulty' |
'difficulty' => 'Degree of difficulty', |
|
'disc' => 'Degree of discrimination', |
); |
); |
} |
} |
|
|
Line 253 sub prettyprint {
|
Line 254 sub prettyprint {
|
($type eq 'sequsage_list')) { |
($type eq 'sequsage_list')) { |
return join('<br />',map { |
return join('<br />',map { |
my $url = &Apache::lonnet::clutter($_); |
my $url = &Apache::lonnet::clutter($_); |
$_ = '<b>'.&Apache::lonnet::gettitle($url).'</b> '. |
my $title = &Apache::lonnet::gettitle($url); |
|
if ($title eq '') { |
|
$title = 'Untitled'; |
|
if ($url =~ /\.sequence$/) { |
|
$title .= ' Sequence'; |
|
} elsif ($url =~ /\.page$/) { |
|
$title .= ' Page'; |
|
} elsif ($url =~ /\.problem$/) { |
|
$title .= ' Problem'; |
|
} elsif ($url =~ /\.html$/) { |
|
$title .= ' HTML document'; |
|
} elsif ($url =~ m:/syllabus$:) { |
|
$title .= ' Syllabus'; |
|
} |
|
} |
|
$_ = '<b>'.$title.'</b> '. |
'<a href="'.$url.'" target="preview">'. |
'<a href="'.$url.'" target="preview">'. |
'<font size="-1">'.$url.'</font>'. |
'<font size="-1">'.$url.'</font>'. |
'</a>' |
'</a>' |
Line 268 sub prettyprint {
|
Line 284 sub prettyprint {
|
return &evalgraph($value); |
return &evalgraph($value); |
} |
} |
# Difficulty |
# Difficulty |
if ($type eq 'difficulty') { |
if ($type eq 'difficulty' || $type eq 'disc') { |
return &diffgraph($value); |
return &diffgraph($value); |
} |
} |
# List of courses |
# List of courses |
if ($type=~/\_list/) { |
if ($type=~/\_list/) { |
return join('<br />',map { |
my @Courses = split(/\s*\,\s*/,$value); |
my %courseinfo=&Apache::lonnet::coursedescription($_); |
my $Str; |
'<a href="/public/'. |
foreach my $course (@Courses) { |
$courseinfo{'domain'}.'/'.$courseinfo{'num'}.'/syllabus" target="preview">'. |
my %courseinfo = &Apache::lonnet::coursedescription($course); |
$courseinfo{'description'}.'</a>'; |
if (! exists($courseinfo{'num'}) || $courseinfo{'num'} eq '') { |
} split(/\s*\,\s*/,$value)); |
next; |
|
} |
|
if ($Str ne '') { $Str .= '<br />'; } |
|
$Str .= '<a href="/public/'.$courseinfo{'domain'}.'/'. |
|
$courseinfo{'num'}.'/syllabus" target="preview">'. |
|
$courseinfo{'description'}.'</a>'; |
|
} |
|
return $Str; |
} |
} |
# No pretty print found |
# No pretty print found |
return $value; |
return $value; |
Line 496 sub present_uneditable_metadata {
|
Line 519 sub present_uneditable_metadata {
|
} else { |
} else { |
$versiondisplay='Version: '.$currentversion; |
$versiondisplay='Version: '.$currentversion; |
} |
} |
# crumbify displayed URL |
# crumbify displayed URL uri target prefix form size |
$disuri=&Apache::lonhtmlcommon::crumbs($disuri); |
$disuri=&Apache::lonhtmlcommon::crumbs($disuri,undef, undef, undef,'+1'); |
|
$disuri =~ s:<br />::g; |
# obsolete |
# obsolete |
my $obsolete=$content{'obsolete'}; |
my $obsolete=$content{'obsolete'}; |
my $obsoletewarning=''; |
my $obsoletewarning=''; |
Line 509 sub present_uneditable_metadata {
|
Line 533 sub present_uneditable_metadata {
|
# |
# |
my %lt=&fieldnames(); |
my %lt=&fieldnames(); |
my $table=''; |
my $table=''; |
|
my $title = $content{'title'}; |
|
if (! defined($title)) { |
|
$title = 'Untitled Resource'; |
|
} |
foreach ('title', |
foreach ('title', |
'author', |
'author', |
'subject', |
'subject', |
Line 534 sub present_uneditable_metadata {
|
Line 562 sub present_uneditable_metadata {
|
} |
} |
# |
# |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<h2>$content{'title'}</h2> |
<h2>$title</h2> |
<h3><tt>$disuri</tt></h3> |
<p> |
|
$disuri<br /> |
$obsoletewarning |
$obsoletewarning |
$versiondisplay<br /> |
$versiondisplay |
|
</p> |
<table cellspacing=2 border=0> |
<table cellspacing=2 border=0> |
$table |
$table |
</table> |
</table> |
Line 560 sub print_dynamic_metadata {
|
Line 590 sub print_dynamic_metadata {
|
$r->rflush(); |
$r->rflush(); |
my %items=&fieldnames(); |
my %items=&fieldnames(); |
my %dynmeta=&dynamicmeta($uri); |
my %dynmeta=&dynamicmeta($uri); |
|
&Apache::lonnet::logthis('dynamic metadata keys:'.$/. |
|
join("\n",keys(%dynmeta))); |
# |
# |
# General Access and Usage Statistics |
# General Access and Usage Statistics |
if (exists($dynmeta{'count'}) || |
if (exists($dynmeta{'count'}) || |
Line 584 sub print_dynamic_metadata {
|
Line 616 sub print_dynamic_metadata {
|
} |
} |
# |
# |
# Assessment statistics |
# Assessment statistics |
if ($uri=~/\.(problem|exam|quiz|assess|survey|form)$/ && |
if ($uri=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
(exists($dynmeta{'stdno'}) || |
if (exists($dynmeta{'stdno'}) || |
exists($dynmeta{'avetries'}) || |
exists($dynmeta{'avetries'}) || |
exists($dynmeta{'difficulty'}))) { |
exists($dynmeta{'difficulty'}) || |
# This is an assessment, print assessment data |
exists($dynmeta{'disc'})) { |
$r->print( |
# This is an assessment, print assessment data |
'<h4>'.&mt('Assessment Statistical Data').'</h4>'. |
$r->print('<h4>'. |
'<table cellspacing=2 border=0>'); |
&mt('Overall Assessment Statistical Data'). |
foreach ('stdno','avetries','difficulty') { |
'</h4>'. |
$r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'. |
'<table cellspacing=2 border=0>'); |
|
$r->print('<tr><td bgcolor="#AAAAAA">'.$lt{'stdno'}.'</td>'. |
'<td bgcolor="#CCCCCC">'. |
'<td bgcolor="#CCCCCC">'. |
&prettyprint($_,$dynmeta{$_})."</td></tr>\n"); |
&prettyprint('stdno',$dynmeta{'stdno'}). |
|
'</td>'."</tr>\n"); |
|
foreach ('avetries','difficulty','disc') { |
|
$r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'. |
|
'<td bgcolor="#CCCCCC">'. |
|
&prettyprint($_,sprintf('%5.2f',$dynmeta{$_})). |
|
'</td>'."</tr>\n"); |
|
} |
|
$r->print('</table>'); |
|
} |
|
if (exists($dynmeta{'stats'})) { |
|
# |
|
# New assessment statistics |
|
$r->print('<h4>'. |
|
&mt('Detailed Assessment Statistical Data'). |
|
'</h4>'); |
|
my $table = '<table cellspacing=2 border=0>'. |
|
'<tr>'. |
|
'<th>Course</th>'. |
|
'<th>Section(s)</th>'. |
|
'<th>Num Students</th>'. |
|
'<th>Mean Tries</th>'. |
|
'<th>Degree of Difficulty</th>'. |
|
'<th>Degree of Discrimination</th>'. |
|
'<th>Time of computation</th>'. |
|
'</tr>'.$/; |
|
foreach my $identifier (sort(keys(%{$dynmeta{'stats'}}))) { |
|
my $data = $dynmeta{'stats'}->{$identifier}; |
|
my $course = $data->{'course'}; |
|
my %courseinfo = &Apache::lonnet::coursedescription($course); |
|
if (! exists($courseinfo{'num'}) || $courseinfo{'num'} eq '') { |
|
&Apache::lonnet::logthis('lookup for '.$course.' failed'); |
|
next; |
|
} |
|
$table .= '<tr>'; |
|
$table .= |
|
'<td><nobr>'.$courseinfo{'description'}.'</nobr></td>'; |
|
$table .= |
|
'<td align="right">'.$data->{'sections'}.'</td>'; |
|
$table .= |
|
'<td align="right">'.$data->{'stdno'}.'</td>'; |
|
foreach ('avetries','difficulty','disc') { |
|
$table .= '<td align="right">'; |
|
if (exists($data->{$_})) { |
|
$table .= sprintf('%.2f',$data->{$_}).' '; |
|
} else { |
|
$table .= ''; |
|
} |
|
$table .= '</td>'; |
|
} |
|
$table .= |
|
'<td><nobr>'. |
|
&Apache::lonlocal::locallocaltime($data->{'timestamp'}). |
|
'</nobr></td>'; |
|
$table .= |
|
'</tr>'.$/; |
|
} |
|
$table .= '</table>'.$/; |
|
$r->print($table); |
|
} else { |
|
$r->print('No new dynamic data found.'); |
} |
} |
$r->print('</table>'); |
|
} else { |
} else { |
$r->print('<h4>'.&mt('No Assessment Statistical Data is available for this resource').'</h4>'); |
$r->print('<h4>'. |
|
&mt('No Assessment Statistical Data is available for this resource'). |
|
'</h4>'); |
} |
} |
|
|
|
# |
|
# |
if (exists($dynmeta{'clear'}) || |
if (exists($dynmeta{'clear'}) || |
exists($dynmeta{'depth'}) || |
exists($dynmeta{'depth'}) || |
exists($dynmeta{'helpful'}) || |
exists($dynmeta{'helpful'}) || |