--- loncom/interface/statistics/lonstudentassessment.pm 2003/12/08 19:37:07 1.77 +++ loncom/interface/statistics/lonstudentassessment.pm 2003/12/09 17:00:07 1.78 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.77 2003/12/08 19:37:07 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.78 2003/12/09 17:00:07 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1491,44 +1491,56 @@ sub StudentTriesOnSequence { $performance_length++; my $symbol = ' '; # default to space # + my $awarded = 0; + if (exists($resource_data->{'resource.'.$partnum.'.awarded'})) { + $awarded = $resource_data->{'resource.'.$partnum.'.awarded'}; + $awarded = 0 if (! $awarded); + } + # + my $status = ''; if (exists($resource_data->{'resource.'.$partnum.'.solved'})) { - my $status = $resource_data->{'resource.'.$partnum.'.solved'}; - if ($status eq 'correct_by_override') { - $symbol = '+'; - $sum++; - } elsif ($status eq 'incorrect_by_override') { - $symbol = '-'; - } elsif ($status eq 'ungraded_attempted') { - $symbol = '#'; - } elsif ($status eq 'incorrect_attempted') { - $symbol = '.'; - } elsif ($status eq 'excused') { + $status = $resource_data->{'resource.'.$partnum.'.solved'}; + } + # + my $tries = 0; + if(exists($resource_data->{'resource.'.$partnum.'.tries'})) { + $tries = $resource_data->{'resource.'.$partnum.'.tries'}; + } + # + if ($awarded > 0) { + # The student has gotten the problem correct to some degree + if ($status eq 'excused') { $symbol = 'x'; $max--; - } elsif (($status eq 'correct_by_scantron' || - $status eq 'correct_by_student') && - exists($resource_data->{'resource.'.$partnum.'.tries'})){ - $tries = $resource_data->{'resource.'.$partnum.'.tries'}; + } elsif ($status eq 'correct_by_override') { + $symbol = '+'; + $sum++; + } elsif ($tries > 0) { if ($tries > 9) { $symbol = '*'; - } elsif ($tries > 0) { - $symbol = $tries; } else { - $symbol = ' '; + $symbol = $tries; } $sum++; - } elsif (exists($resource_data->{'resource.'. - $partnum.'.tries'})){ - $symbol = '.'; } else { - $symbol = ' '; + $symbol = '+'; + $sum++; } } else { - # Unsolved. Did they try? - if (exists($resource_data->{'resource.'.$partnum.'.tries'})){ + # The student has the problem incorrect or it is ungraded + if ($status eq 'excused') { + $symbol = 'x'; + $max--; + } elsif ($status eq 'incorrect_by_override') { + $symbol = '-'; + } elsif ($status eq 'ungraded_attempted') { + $symbol = '#'; + } elsif ($status eq 'incorrect_attempted' || + $tries > 0) { $symbol = '.'; } else { - $symbol = ' '; + # Problem is wrong and has not been attempted. + $symbol=' '; } } #