--- loncom/interface/statistics/lonstudentassessment.pm 2003/05/29 21:38:32 1.49
+++ loncom/interface/statistics/lonstudentassessment.pm 2003/06/05 19:21:22 1.52
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentassessment.pm,v 1.49 2003/05/29 21:38:32 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.52 2003/06/05 19:21:22 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -461,7 +461,7 @@ sub CreateAndParseOutputSelector {
my $elementname = 'chartoutputmode';
#
# Format for output options is 'mode, restrictions';
- my $selected = 'html, with links';
+ my $selected = 'html, without links';
if (exists($ENV{'form.'.$elementname})) {
if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) {
$selected = $ENV{'form.'.$elementname}->[0];
@@ -603,7 +603,7 @@ sub html_outputstudent {
my $studentstats;
my $PerformanceStr = '';
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
- my ($performance,$score,$seq_max) =
+ my ($performance,$performance_length,$score,$seq_max) =
&StudentPerformanceOnSequence($student,\%StudentsData,
$seq,$show_links);
my $ratio = $score.'/'.$seq_max;
@@ -616,7 +616,7 @@ sub html_outputstudent {
$performance .= ' 'x($seq->{'width'}-length($performance));
} else {
# Pad with extra spaces
- $performance .= ' 'x($seq->{'width'}-$seq_max-
+ $performance .= ' 'x($seq->{'width'}-$performance_length-
length($ratio)
).$ratio;
}
@@ -709,8 +709,8 @@ sub StudentAverageTotal {
sub SingleStudentTotal {
my $student = &Apache::lonstatistics::current_student();
- my $Str = "
Summary Table For ".$student->{'username'}.'@'.
- $student->{'domain'}."
\n";
+ my $Str = "Summary table for ".$student->{'fullname'}." ".
+ $student->{'username'}.'@'.$student->{'domain'}."
\n";
$Str .= ''."\n";
$Str .=
"Sequence or Folder | Score | Maximum |
\n";
@@ -987,7 +987,7 @@ sub excel_outputstudent {
#
# Write out sequence scores and totals data
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
- my ($performance,$score,$seq_max) =
+ my ($performance,$performance_length,$score,$seq_max) =
&StudentPerformanceOnSequence($student,\%StudentsData,
$seq,'no');
if ($show eq 'totals' || $show eq 'scores') {
@@ -1147,7 +1147,7 @@ sub csv_outputstudent {
#
# Output performance data
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) {
- my ($performance,$score,$seq_max) =
+ my ($performance,$performance_length,$score,$seq_max) =
&StudentPerformanceOnSequence($student,\%StudentsData,
$seq,'no');
if ($show eq 'scores') {
@@ -1219,12 +1219,14 @@ sub StudentPerformanceOnSequence {
$links = 'no' if (! defined($links));
my $Str = '';
my ($sum,$max) = (0,0);
+ my $performance_length = 0;
foreach my $resource (@{$seq->{'contents'}}) {
next if ($resource->{'type'} ne 'assessment');
my $resource_data = $studentdata->{$resource->{'symb'}};
my $value = '';
foreach my $partnum (@{$resource->{'parts'}}) {
$max++;
+ $performance_length++;
my $symbol = ' '; # default to space
#
if (exists($resource_data->{'resource.'.$partnum.'.solved'})) {
@@ -1266,6 +1268,9 @@ sub StudentPerformanceOnSequence {
$symbol = ' ';
}
}
+# if ($symbol ne ' ') {
+# $attempted_sum++;
+# }
#
if ( ($links eq 'yes' && $symbol ne ' ') ||
($links eq 'all')) {
@@ -1282,7 +1287,10 @@ sub StudentPerformanceOnSequence {
}
$Str .= $value;
}
- return ($Str,$sum,$max);
+ if ($seq->{'randompick'}) {
+ $max = $seq->{'randompick'};
+ }
+ return ($Str,$performance_length,$sum,$max);
}
#######################################################