--- loncom/interface/statistics/lonproblemanalysis.pm 2004/02/10 19:49:54 1.65 +++ loncom/interface/statistics/lonproblemanalysis.pm 2004/10/05 14:03:45 1.93 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemanalysis.pm,v 1.65 2004/02/10 19:49:54 matthew Exp $ +# $Id: lonproblemanalysis.pm,v 1.93 2004/10/05 14:03:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,7 +33,8 @@ use Apache::lonhtmlcommon(); use Apache::loncoursedata(); use Apache::lonstatistics; use Apache::lonlocal; -use Apache::lonstathelpers; +use Apache::lonstathelpers(); +use Apache::lonstudentsubmissions(); use HTML::Entities(); use Time::Local(); use Spreadsheet::WriteExcel(); @@ -50,23 +51,17 @@ my @SubmitButtons = ({ name => 'PrevProb { name => 'NextProblemAnalysis', text => 'Next Problem' }, { name => 'break'}, - { name => 'ClearCache', - text => 'Clear Caches' }, - { name => 'updatecaches', - text => 'Update Student Data' }, { name => 'SelectAnother', text => 'Choose a different Problem' }, { name => 'ExcelOutput', text => 'Produce Excel Output' }); - sub BuildProblemAnalysisPage { my ($r,$c)=@_; # my %Saveable_Parameters = ('Status' => 'scalar', 'Section' => 'array', 'NumPlots' => 'scalar', - 'AnalyzeAs' => 'scalar', 'AnalyzeOver' => 'scalar', ); &Apache::loncommon::store_course_settings('problem_analysis', @@ -76,29 +71,22 @@ sub BuildProblemAnalysisPage { # &Apache::lonstatistics::PrepareClasslist(); # - $r->print('
'. + ''.$title.' (N='.$N.')'. + ''. + ' | ||
'.$min.' | '. + ''.$plotresult.' | '. + ''.$max.' | '. + '
'. + 'Maximum Number of Coinciding Values: '.$max_y. + ' |
'. + &mt('None of the selected students attempted the problem more than [_1] times.',$try-1). + ' | ||||
'. + &mt('None of the selected students have attempted the problem').' | ||||
'.$correctgraph.' | '; - ## - ## + 100,$plotcolors,\@Labels,$Datasets[0]); + + # + # next if (! defined($Datasets[0])); for (my $i=0; $i< scalar(@{$Datasets[0]});$i++) { $Datasets[0]->[$i]=0; } - $count = $ResponseData{'_total'}->[$i]-$ResponseData{'_correct'}->[$i]; - if ($count == 0) { - $count = 'no submissions'; - } elsif ($count == 1) { - $count = '1 submission'; - } else { - $count = $count.' submissions'; - } - $title = 'Attempt '.$i.', '.$count; - my $incorrectgraph = &Apache::loncommon::DrawBarGraph + $count = $response_data{'_total'}->[$try] - + $response_data{'_correct'}->[$try]; + $title = 'Attempt '.$try.' (N='.$count.')'; + my $incorrect_graph = &Apache::loncommon::DrawBarGraph ($title,'Foil Number','% Option Chosen Incorrectly', - 100,$plotcolors,undef,@Datasets); - $analysis_html.= ''.$incorrectgraph.' | '; - $analysis_html.= ''.$foilkey." | ||
'.$concept_graph.' | '. + ''.$correct_graph.' | '. + ''.$incorrect_graph.' | '. + ''.$optionkey.' | '. + ' |
'.$graphlink." |
'. + &mt('Data from [_1] to [_2]', + &Apache::lonlocal::locallocaltime($starttime), + &Apache::lonlocal::locallocaltime($endtime)).' | |||
'.$concept_correct_plot.' | '. + ''.$foil_correct_plot.' | '. + ''.$foil_incorrect_plot.' | '. + ''.$foilkey.' |
'.
+ &mt('Start time: [_1]',
+ $interval->{'startdateform'}).' '. + &mt('End time: [_1]', + $interval->{'enddateform'}). + ' | |||
  |
'.&mt('Sections').' | '; @@ -1426,60 +1396,55 @@ sub CreateInterface { ## ## $Str .= '';
- { # These braces are here to organize the code, not scope it.
- {
- $Str .= ' '; - } - { - $Str .= ' '; - } - { - $Str .= ' '; + ## + my $analyze_selector = ''; + $Str .= ' '.$/; + ## + my $numplots_selector = ' '; + $Str .= ' | ';
##
##
@@ -1552,58 +1517,6 @@ sub Process_OR_Row {
return %RowData;
}
-##
-## get problem data and put it into a useful data structure.
-## note: we must force each foil and option to not begin or end with
-## spaces as they are stored without such data.
-##
-sub get_problem_data {
- my ($url) = @_;
- my $Answ=&Apache::lonnet::ssi($url,('grade_target' => 'analyze'));
- (my $garbage,$Answ)=split(/_HASH_REF__/,$Answ,2);
- my %Answer;
- %Answer=&Apache::lonnet::str2hash($Answ);
- my %Partdata;
- foreach my $part (@{$Answer{'parts'}}) {
- while (my($key,$value) = each(%Answer)) {
- next if ($key !~ /^$part/);
- $key =~ s/^$part\.//;
- if (ref($value) eq 'ARRAY') {
- if ($key eq 'options') {
- $Partdata{$part}->{'_Options'}=$value;
- } elsif ($key eq 'concepts') {
- $Partdata{$part}->{'_Concepts'}=$value;
- } elsif ($key =~ /^concept\.(.*)$/) {
- my $concept = $1;
- foreach my $foil (@$value) {
- $Partdata{$part}->{'_Foils'}->{$foil}->{'_Concept'}=
- $concept;
- }
- }
- } else {
- if ($key=~ /^foil\.text\.(.*)$/) {
- my $foil = $1;
- $Partdata{$part}->{'_Foils'}->{$foil}->{'name'}=$foil;
- $value =~ s/(\s*$|^\s*)//g;
- $Partdata{$part}->{'_Foils'}->{$foil}->{'text'}=$value;
- } elsif ($key =~ /^foil\.value\.(.*)$/) {
- my $foil = $1;
- $Partdata{$part}->{'_Foils'}->{$foil}->{'value'}=$value;
- }
- }
- }
- }
- return %Partdata;
-}
-
1;
__END__
-
-#####
-# partdata{part}->{_Foils}->{foilid}->{'name'} = $
-# ->{'text'} = $
-# ->{'value'} = $
-# ->{'_Concept'} = $
-# partdata{part}->{_Options} = @
-# partdata{part}->{_Concepts} = @