--- loncom/interface/statistics/lonproblemstatistics.pm 2004/07/12 19:30:12 1.90 +++ loncom/interface/statistics/lonproblemstatistics.pm 2004/08/04 15:07:42 1.93 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemstatistics.pm,v 1.90 2004/07/12 19:30:12 matthew Exp $ +# $Id: lonproblemstatistics.pm,v 1.93 2004/08/04 15:07:42 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -238,6 +238,17 @@ my @Fields = ( format => '%4.1f', sortable => 'yes', graphable => 'yes', + long_title => 'Number of students whose final answer is wrong', + selectable => 'yes', + defaultselected => 'yes', + }, + { name => 'per_wrong', + title => '%Wrng', + align => 'right', + color => '#FFDDDD', + format => '%4.1f', + sortable => 'yes', + graphable => 'yes', long_title => 'Percent of students whose final answer is wrong', selectable => 'yes', defaultselected => 'yes', @@ -819,7 +830,7 @@ sub statistics_html_table_data { if (exists($field->{'special'}) && $field->{'special'} eq 'link') { $row .= ''; } - if (exists($field->{'format'})) { + if (exists($field->{'format'}) && $data->{$field->{'name'}} !~ /[A-Z]/i) { $row .= sprintf($field->{'format'},$data->{$field->{'name'}}); } else { $row .= $data->{$field->{'name'}}; @@ -1581,6 +1592,10 @@ sub compute_discrimination_factor { map { $_->[&Apache::loncoursedata::RNK_student()]; } @{$ranking}[($num_students-$number_to_grab)..($num_students-1)]; + if (! @BottomSet || (@BottomSet == 1 && $BottomSet[0] eq '') || + ! @TopSet || (@TopSet == 1 && $TopSet[0] eq '')) { + return 'nan'; + } my ($bottom_sum,$bottom_max) = &Apache::loncoursedata::get_sum_of_scores($resource,$part,\@BottomSet, undef,$starttime,$endtime);