--- loncom/interface/statistics/lonproblemanalysis.pm 2004/03/11 19:34:10 1.75 +++ loncom/interface/statistics/lonproblemanalysis.pm 2004/03/31 05:24:00 1.83 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemanalysis.pm,v 1.75 2004/03/11 19:34:10 matthew Exp $ +# $Id: lonproblemanalysis.pm,v 1.83 2004/03/31 05:24:00 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -99,7 +99,7 @@ sub BuildProblemAnalysisPage { } $r->rflush(); # - my $problem_types = '(option|radiobutton)'; + my $problem_types = '(option|radiobutton|numerical)'; if (exists($ENV{'form.problemchoice'}) && ! exists($ENV{'form.SelectAnother'})) { foreach my $button (@SubmitButtons) { @@ -160,13 +160,17 @@ sub BuildProblemAnalysisPage { $ProblemData, \@Students); } elsif ($current_problem->{'resptype'} eq 'numerical') { -# if (exists($ENV{'form.ExcelOutput'})) { - &Apache::lonstudentsubmissions::prepare_excel_output - ($r,$current_problem,$ProblemData,\@Students); -# } else { -# &NumericalResponseAnalysis($r,$current_problem, -# $ProblemData,\@Students); -# } + ## + ## analyze all responses of a problem at once + my $res = $current_problem->{'resource'}; + foreach my $partid (@{$res->{'parts'}}) { + $current_problem->{'part'} = $partid; + foreach my $respid (@{$res->{'partdata'}->{$partid}->{'ResponseIds'}}) { + $current_problem->{'respid'}=$respid; + &NumericalResponseAnalysis($r,$current_problem, + $ProblemData,\@Students); + } + } } else { $r->print('
'. + ''.$title.' (N='.$N.')'. + ''. + ' | ||
'.$min.' | '. + ''.$plotresult.' | '. + ''.$max.' | '. + '
'. + 'Maximum Number of Coinciding Values: '.$max_y. + ' |
'.$correctgraph.' | '; # @@ -630,17 +733,10 @@ sub OR_Tries_Foil_Analysis { } $count = $ResponseData{'_total'}->[$try] - $ResponseData{'_correct'}->[$try]; - if ($count == 0) { - $count = 'no submissions'; - } elsif ($count == 1) { - $count = '1 submission'; - } else { - $count = $count.' submissions'; - } - $title = 'Attempt '.$try.', '.$count; + $title = 'Submission '.$try.' (N='.$count.')'; my $incorrectgraph = &Apache::loncommon::DrawBarGraph ($title,'Foil Number','% Option Chosen Incorrectly', - 100,$plotcolors,undef,@Datasets); + 100,$plotcolors,\@Labels,@Datasets); $analysis_html.= ''.$incorrectgraph.' | '; $analysis_html.= ''.$optionkey." | ||||||
'.$conceptindex.' | '. - ''.&HTML::Entities::encode($concept->{'name'}).' | '. + ''.&HTML::Entities::encode($concept->{'name'},'<>&"').' | '. ''.$foilindex++.' | '. - ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'name'}).' | '. + ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'name'},'<>&"').' | '. ''.$Foildata{$firstfoil}->{'text'}.' | '. - ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'value'}).' | '. + ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'value'},'<>&"').' | '. "
'.$foilindex++.' | '. - ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'name'}).' | '. + ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'name'},'<>&"').' | '. ''.$Foildata{$firstfoil}->{'text'}.' | '. - ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'value'}).' | '. + ''.&HTML::Entities::encode($Foildata{$firstfoil}->{'value'},'<>&"').' | '. "'. ' | '. ' | '.$foilindex.' | '. - ''.&HTML::Entities::encode($Foildata{$foilid}->{'name'}).' | '. + ''.&HTML::Entities::encode($Foildata{$foilid}->{'name'},'<>&"').' | '. ''.$Foildata{$foilid}->{'text'}.' | '. ''.&HTML::Entities::encode($Foildata{$foilid}->{'value'}).' | '. "\n"; } else { $table .= '
'.$foilindex.' | '. - ''.&HTML::Entities::encode($Foildata{$foilid}->{'name'}).' | '. + ''.&HTML::Entities::encode($Foildata{$foilid}->{'name'},'<>&"').' | '. ''.$Foildata{$foilid}->{'text'}.' | '. - ''.&HTML::Entities::encode($Foildata{$foilid}->{'value'}).' | '. + ''.&HTML::Entities::encode($Foildata{$foilid}->{'value'},'<>&"').' | '. "|||
'. (' 'x4).' | '. - ''.&HTML::Entities::encode($option).' | '. + ''.&HTML::Entities::encode($option,'<>&"').' | '. "